Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Graphics > RenderMan interface > Voronoi (worley...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 1 Topic 702 of 788
Post > Topic >>

Voronoi (worley) noise in Gelato

by "Slavomir Kaslev" <slavomir.kaslev@[EMAIL PROTECTED] > Dec 14, 2006 at 06:57 AM

Hello,

I am reading Advanced Renderman, and I cannot reproduce the Voronoi
noise thresholding described in the end of chapter 10 using Gelato.
Here is the code I am using:

#include "stdshader.h"
#include "noises.h"

surface test
(
    string shadingspace = "shader"
        [[  string description = "Shading space",
            string UItype = "coordsys" ]],
    float shadingfreq = 1
        [[  string description = "Shading frequency" ]]
)
{
    point Pshad = shadingfreq * transform(shadingspace, P);

    float f1, f2;
    point p1, p2;
    voronoi(Pshad, 1, f1, p1, f2, p2);
    float scalefactor = distance(p1, p2) / (distance(Pshad, p1) +
distance(Pshad, p2));
    C = step(0.05 * scalefactor, f2 - f1);
}

Can someone tell me what I am doing wrong?

SIDE NOTE:
The file implementing voronoi noise noises.h is situated in C:\Program
Files\NVIDIA Cor****ation\Gelato\shaders. From the comments I understand
that it is adapted from Renderman Shading Language implementation.
There is bug on line 171:

// The stuff that Ken Musgrave calls "VLNoise"
#define VLNoise(Pt,scale) (snoise(vsnoise(Pt)*scale+Pt))

since there is no vsnoise in Gelato, snoise should be used.
 




 1 Posts in Topic:
Voronoi (worley) noise in Gelato
"Slavomir Kaslev&quo  2006-12-14 06:57:08 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Nov 21 22:57:21 CST 2008.