Voronoi ISL Shader

General questions about Indigo, the scene format, rendering etc...
User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Voronoi ISL Shader

Post by CTZn » Fri Oct 08, 2010 4:51 am

A straight border between cells you mean ? Look, this base shader is already a great thing. Then, shifting the UVs with another noise func plus a simple condition with the displaced distance as input would be enough in most cases. With a fbm at a matching frequency, one can trick tiles into variated shades (works better with large gaps though)... but, bring us all the candy you want with :)

Image
source: http://www.google.com/imgres?imgurl=htt ... CDoQ9QEwBw

Looking at those fruits, I'm noticing that the point value is dependent on the e:smallest cell dimension... hihi.
Last edited by CTZn on Fri Oct 08, 2010 4:20 pm, edited 1 time in total.
obsolete asset

pvbeeber
Indigo 100
Posts: 23
Joined: Sat Apr 11, 2009 4:48 am

Re: Voronoi ISL Shader

Post by pvbeeber » Fri Oct 08, 2010 5:07 am

This is great. Galvanized metal would be a good application.

User avatar
snorky
Indigo 100
Posts: 313
Joined: Fri Apr 17, 2009 8:54 pm
Location: Parma, Italy

Re: Voronoi ISL Shader

Post by snorky » Fri Oct 08, 2010 7:58 pm

i try voronoi on my bathroom glass door, i fail:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<scenedata>
	<medium>
		<name>v1_medium</name>
		<precedence>2</precedence>
		<basic>
			<ior>1.5</ior>
			<cauchy_b_coeff>0</cauchy_b_coeff>
			<absorption_coefficient_spectrum>
				<rgb>
					<rgb>
						41.6496 41.6496 10.1429
					</rgb>
					<gamma>1</gamma>
				</rgb>
			</absorption_coefficient_spectrum>
		</basic>
	</medium>
	<material>
		<name>v1</name>
		<specular>
			<internal_medium_name>v1_medium</internal_medium_name>
			<transparent>true</transparent>
			<absorption_layer_transmittance>
				<shader>
					<shader><![CDATA[def mypos() vec2:
	getTexCoords(0)*10.

def tile(vec2 mypos) vec2:
	vec2(
		floor(doti(mypos)), 
		floor(dotj(mypos))      )

def node(vec2 tile) vec2:
	tile + vec2 ( noise(tile*1.456169584),  noise(tile*1.65465165) )

def closest(vec2 node_a, vec2 node_b, vec2 xy) vec2:
	vec2(
		if(
			lt(
				length(node_a - xy), 
				length(node_b - xy)
			),
			doti(node_a),
			doti(node_b)
		),
		if(
			lt(
				length(node_a - xy), 
				length(node_b - xy)
			),
			dotj(node_a),
			dotj(node_b)
		)
	)

		
def voronoi(vec2 curtile, vec2 xy) vec2:
	closest(
	closest(
	closest(
	closest(
	closest(
	closest(
	closest( 
	closest( node(curtile), node(curtile + vec2(1.,0.)) , xy )
	,  node(curtile + vec2(1.,1.)), xy )
	,  node(curtile + vec2(0.,1.)), xy )
	,  node(curtile + vec2( -1. ,1.)), xy )
	,  node(curtile + vec2( -1. ,0.)), xy )
	,  node(curtile + vec2( -1., -1.)), xy )
	,  node(curtile + vec2( 0., -1. )), xy )
	,  node(curtile + vec2( 1., -1. )), xy )


def color(vec2 pt) vec3:
	vec3(fract(doti(pt)), fract(dotj(pt)), 1.)

def eval(vec3 pos) vec3 :
	color(voronoi(tile(mypos()), mypos()))]]></shader>
				</shader>
			</absorption_layer_transmittance>
			<displacement>
				<shader>
					<shader><![CDATA[def eval() real :
	0.00 # Return zero displacement/bump
def mypos() vec2:
	getTexCoords(0)*10.

def tile(vec2 mypos) vec2:
	vec2(
		floor(doti(mypos)), 
		floor(dotj(mypos))      )

def node(vec2 tile) vec2:
	tile + vec2 ( noise(tile*1.456169584),  noise(tile*1.65465165) )

def closest(vec2 node_a, vec2 node_b, vec2 xy) vec2:
	vec2(
		if(
			lt(
				length(node_a - xy), 
				length(node_b - xy)
			),
			doti(node_a),
			doti(node_b)
		),
		if(
			lt(
				length(node_a - xy), 
				length(node_b - xy)
			),
			dotj(node_a),
			dotj(node_b)
		)
	)

		
def voronoi(vec2 curtile, vec2 xy) vec2:
	closest(
	closest(
	closest(
	closest(
	closest(
	closest(
	closest( 
	closest( node(curtile), node(curtile + vec2(1.,0.)) , xy )
	,  node(curtile + vec2(1.,1.)), xy )
	,  node(curtile + vec2(0.,1.)), xy )
	,  node(curtile + vec2( -1. ,1.)), xy )
	,  node(curtile + vec2( -1. ,0.)), xy )
	,  node(curtile + vec2( -1., -1.)), xy )
	,  node(curtile + vec2( 0., -1. )), xy )
	,  node(curtile + vec2( 1., -1. )), xy )


def color(vec2 pt) vec3:
	vec3(fract(doti(pt)), fract(dotj(pt)), 1.)

def eval(vec3 pos) vec3 :
	color(voronoi(tile(mypos()), mypos()))]]></shader>
				</shader>
			</displacement>
			<layer>0</layer>
		</specular>
	</material>

</scenedata>
can you find the problem?
thanks

triplej28
Posts: 15
Joined: Mon Sep 27, 2010 10:38 pm
Location: Wellington, NZ

Re: Voronoi ISL Shader

Post by triplej28 » Fri Oct 08, 2010 11:06 pm

I was going to integrate voronoi glazing panels into the design of my latest building facade.. This would perhaps made the visualization process alot easier.

Instead I made 1800 custom panels from Grasshopper in Rhino.

I can see lots of cool things you can do with this in the architecture world :D

my 2c

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Voronoi ISL Shader

Post by galinette » Wed Nov 03, 2010 11:18 pm

Hi triplej28,

I'm working in the glass facade business, and that looks like a nightmare for the glass processor and the facade assembler :D

Here is a small update of my development of the ISL shader.
Attachments
stones.jpg
Procedural stone wall (in development...). The stone look plastic but I did not focus on the stone material yet, only on the shape generation.
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Voronoi ISL Shader

Post by CTZn » Thu Nov 04, 2010 12:53 am

That's very cool Etienne !

I'm refraining from throwing more random ideas based on your work, go go go go ^^

You were prized already but I must say that your material board is great.
obsolete asset

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Voronoi ISL Shader

Post by galinette » Thu Nov 04, 2010 12:55 am

The letchee is baking....

I'm also working on a stained glass
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Voronoi ISL Shader

Post by CTZn » Thu Nov 04, 2010 12:59 am

galinette wrote:The letchee is baking....
Aw... now that's seduction :lol:

Nice pick with stained glass !
obsolete asset

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Voronoi ISL Shader

Post by galinette » Thu Nov 04, 2010 1:24 am

That's inspiration and challenge... :wink:
Attachments
letchee.png
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
dakiru
Indigo 100
Posts: 745
Joined: Mon Jun 22, 2009 6:51 am

Re: Voronoi ISL Shader

Post by dakiru » Thu Nov 04, 2010 2:01 am

galinette wrote:That's inspiration and challenge... :wink:
Yummy Indigo lychee :)

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Voronoi ISL Shader

Post by CTZn » Thu Nov 04, 2010 2:04 am

obsolete asset

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Voronoi ISL Shader

Post by galinette » Sat Nov 06, 2010 11:42 pm

Just a little update with displacement:
Attachments
stones.png
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
CTZn
Posts: 7240
Joined: Thu Nov 16, 2006 4:34 pm
Location: Paris, France

Re: Voronoi ISL Shader

Post by CTZn » Sun Nov 07, 2010 1:38 am

Nicely scaled for rustic water places: public baths, a fountain or something akin, even for some low-grade garden sculptures :)

Comment for my previous post should be: "for inspiration and challenge", I don't want to let you think it was a request or something else. I'm assuming that ISL may not make nested cells levels easy to set on the fly.

You Sir, are inspiring !
obsolete asset

User avatar
galinette
1st Place Winner
Posts: 923
Joined: Sat Jan 09, 2010 1:39 am
Location: Nantes, France
Contact:

Re: Voronoi ISL Shader

Post by galinette » Sun Nov 07, 2010 11:19 pm

Still under development
Attachments
stainedglass.png
Last edited by galinette on Mon Nov 08, 2010 2:57 am, edited 1 time in total.
Eclat-Digital Research
http://www.eclat-digital.com

User avatar
Headroom
Indigo 100
Posts: 972
Joined: Wed Aug 08, 2007 1:07 pm
Location: Spartanburg, SC, USA

Re: Voronoi ISL Shader

Post by Headroom » Mon Nov 08, 2010 2:12 am

WOW :shock: :shock:
Breathtaking!

Post Reply
87 posts

Who is online

Users browsing this forum: No registered users and 0 guests