Page 5 of 6 [ 87 posts ] Go to page Previous  1, 2, 3, 4, 5, 6  Next
 Previous topic | Next topic
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?
If so then that will be great indeed

_________________
Doug

Doug Armand

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?
If so then that will be great indeed

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

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

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

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 [ 98.93 KiB | Viewed 2238 times ]
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

_________________
I don't have a toaster anyway... can I call my PC that ?

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>
<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>

<![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()
)
]]>
</albedo>

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

_________________
I don't have a toaster anyway... can I call my PC that ?

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

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

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

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

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

Etienne-

Any luck digging out the code?

Thanks!

-Michael

Hi!

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

_________________
Eclat-Digital Research
http://www.eclat-digital.com
 Display posts from previous: All posts1 day7 days2 weeks1 month3 months6 months1 year Sort by AuthorPost timeSubject AscendingDescending
 Page 5 of 6 [ 87 posts ] Go to page Previous  1, 2, 3, 4, 5, 6  Next

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

Search for:
 Jump to:  Select a forum ------------------ General    Indigo News and Announcements    Indigo General Stuff    Off Topic Artwork    Works in Progress    Finished Artwork    Indigo Competition    Materials Support    Indigo Help    Tutorials    Bugs and Requests Exporters    3D Studio MAX    Blender    Cinema 4D    Maya    SketchUp    Revit    Other Exporters Website and Forum    Website & Community Forum    Language Forum Development    Exporter Development    SDK Discussion    Beta Group