Download Trial Buy now

Search  | Login  | Register

Post new topic Reply to topic  [ 87 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next
Offline
User avatar
Indigo 100
OnoSendai wrote:
Implemented a basic Voronoi function.
Messing around with it:
The ones with rings are based on pulse()ing the distance from the voronoi cell points. There's also 4 scales of Voronoi regions mixed together :)


Will these be easily accessible to a shader nublet like me without needing a maths degree? :wink:
If so then that will be great indeed

_________________
Doug

Doug Armand


 Profile  
 
Offline
User avatar
Site Admin
Doug Armand wrote:
OnoSendai wrote:
Implemented a basic Voronoi function.
Messing around with it:
The ones with rings are based on pulse()ing the distance from the voronoi cell points. There's also 4 scales of Voronoi regions mixed together :)


Will these be easily accessible to a shader nublet like me without needing a maths degree? :wink:
If so then that will be great indeed


Yes, we've been working on that as well. Will post some details soon.


 Profile  
 
Offline
User avatar
1st Place Winner
Hello,

If you want, I can try to explain my shader. It gives a result quite different than these

Etienne

_________________
Eclat-Digital Research
http://www.eclat-digital.com


 Profile  
 
Offline
User avatar
Site Admin
Hi Etienne,
That's fine thanks.
These pictures are from 'fractal' Voronoi regions, e.g. a sum of voronoi regions of different scales.


 Profile  
 
Offline
User avatar
Site Admin
Here's a visualisation of the basic voronoi noise, with the code:

Code:
def scaledVoronoiDist(vec2 p, real scale) real :
  dist(p * scale, voronoi(p * scale, 1.0))
 
def eval(vec3 pos) vec3 :
  vec3(scaledVoronoiDist(getTexCoords(0), 10.0))


You can see the underlying grid pattern, which I will do some work to get rid of soon.


Attachments:
voronoi_shader_test.jpg
voronoi_shader_test.jpg [ 98.93 KiB | Viewed 1405 times ]
 Profile  
 
Offline
User avatar
Very nice, so we can map the cells size... some control over randomness might be of use too.

Looking forward for these improvements in accessibility you are talking about, I'm wondering wether that may concern sharing of code snippets :)

_________________
Back from Lagrange 5


 Profile  
 
Offline
User avatar
Site Admin
You will be able to define shader 'parameters' like so, which will then be available in your shader as pre-defined functions:

We're still working on the code, we'll make a fuss about it when it's done, because it should be pretty cool, and should finally make shaders easily tweakable by artists :)

Code:
   <albedo>
            <shader>
          <param>
            <colour3>
              <name>BrickBaseColour</name>
              <description>Base colour for the brick.</description>
              <value>0.6 0.2 0.2</value>
            </colour3>
          </param>

          <param>
            <colour3>
              <name>GroutBaseColour</name>
              <description>Base colour for the grouting.</description>
              <value>0.5 0.5 0.5</value>
            </colour3>
          </param>
         
          <param>
            <real>
              <name>BrickColourVariation</name>
              <description></description>
              <min>0</min>
              <max>1.0</max>
              <value>0.3</value>
            </real>
          </param>

               <shader>
                  <![CDATA[   
                     
def brickColour() vec3 :
  paramBrickBaseColour() +
  vec3(
    noise(vec2(0.5 + brickXNum() * 10.0, 0.5 + brickYNum() * 10.0)) * paramBrickColourVariation(),
    0.0,
    0.0
  )
 
def groutColour() vec3 :
  paramGroutBaseColour()

def eval(vec3 pos) vec3 :
  if(
    (brickX() < grout()) ||
    (brickY() < grout()) ||
    (brickX() > (paramBrickWidth() - grout())) ||
    (brickY() > (paramBrickHeight() - grout()))
    ,
    groutColour(),
    brickColour()
  )
                  ]]>
               </shader>
            </shader>
         </albedo>


Attachments:
shader_params.jpg
shader_params.jpg [ 100.96 KiB | Viewed 1382 times ]
 Profile  
 
Offline
User avatar
Mmmh tasty, I remember about that one now. Is this something that will be able [for] use early ?

_________________
Back from Lagrange 5


 Profile  
 
Offline
Etienne-

Im working on a voronoi map as well and wondering if you would be willing to share how you are getting the rounded corners on your stones. Ive been playing with any number of combinations of the feature points but have yet to figure out how you achieve the rounded appearance. Any help would be great.

Thanks!

-Michael


 Profile  
 
Offline
User avatar
1st Place Winner
Hi,

Yes, I can share the shader! I have to look at home and find back the file... It was quite complex

I can remember the principle behind it.

If you want to model a pyramid in ISL, you can decribe it like that:
- Find the equation z(u,v) of each 4 planes of the pyramid
- If you take for any point the minimum of these 4 equations, you have a procedural pyramid

Now, instead of the min function, just take a softmin. You will get a rounded pyramid. This is basically how I make the ceramic tiles in a database material.

The rounded stones works similarly, but for this I need to make voronoi pyramids instead of voronoi cells. The pyramid panes are defined by the distance to the closest voronoi cell edge. This was a pretty big ISL shader...

Etienne

_________________
Eclat-Digital Research
http://www.eclat-digital.com


 Profile  
 
Offline
Etienne-

Id love to see the codes for sure. I'm wondering if it can be made into a 3d solid procedural? It sounds like if I already have a voronoi function I need to check the point to be shaded against all the edges and do a soft min, if I understand correctly? Id love to see what that might look like in C++ but if you have a working version I may be able to tease out the rest. The trick I gather is building up a sum of all the boundaries.

Looking forward to it!

Thanks

-Michael


 Profile  
 
Offline
User avatar
1st Place Winner
What do you mean by 3D solid procedural?

In fact, it is not easy to start from a voronoi func to compute the distance to edges. It is more easy to build a "voronoi pyramids" function from scratch.

Of course, it should be doable in C++, which is much more flexible than ISL!

Etienne

_________________
Eclat-Digital Research
http://www.eclat-digital.com


 Profile  
 
Offline
Im actually working on a map for 3ds max. By solid procedural i mean a map that takes a XYZ input vs UV and computed the value in 3d space. I gather yours is in UV space?

Yeah computing the boundaries is a trick but it should be doable.

-Michael


 Profile  
 
Offline
Etienne-

Any luck digging out the code?

Thanks!

-Michael


 Profile  
 
Offline
User avatar
1st Place Winner
Hi!

Please find the materials attached.
pyra is more a base shader for you to understand how to make some interesting effects
stones is the stone material. It is unfinished and ugly, but all the base code is there. All it needs is artistic optimization...

I will have less and less time to work on these free-time things now : I am the father of a little girl named Augustine since yesterday evening! I will continue the work on coated glass though (this is not free time but work time!)

Regards,

Etienne


Attachments:
stones.pigm [1.2 MiB]
Downloaded 68 times
pyra.igm [2.63 KiB]
Downloaded 70 times

_________________
Eclat-Digital Research
http://www.eclat-digital.com
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 87 posts ]  Go to page Previous  1, 2, 3, 4, 5, 6  Next



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group