Video Examples:
Bob | Realfow Simulation | Custom Renderman Shader | Iskander Mellakh from iskander mellakh on Vimeo.
Custom Renderman Shader | Iskander Mellakh from iskander mellakh on Vimeo.
Here is the code:
- surface im_mottleNoise(
- uniform color myColor = color(0,1,0);
- uniform float myOc = 0.1;
- uniform float roughness = 0.1;
- float Km = 1.0;
- float face = 1.0;
- float mag = 0.0;
- uniform float freqency = 1.0;
- )
- {
- float size = 1.0,
- magnitude = 0.0,
- i;
- point P2;
- P2 = transform ("shader", P);
- for (i = 0; i <6.0; i+= 1.0){
- magnitude += abs (.5 - noise (P2 * size) * freqency) / size;
- }
- P2 = P - normalize (N) *(magnitude * magnitude * magnitude) *Km * mag;
- N = calculatenormal(P2);
- normal Nn = normalize (N);
- vector In = normalize(-I);
- normal Nf = faceforward(Nn,-I);
- normal Nb = faceforward(Nn,I);
- //Oi = myOc * diffuse(Nf * -face);
- //Oi = myOc * face + specular(Nf, In, roughness);
- Oi = myOc;
- Ci = myColor *Oi * diffuse(Nb) + specular(Nf, In, roughness);
- }
No comments:
Post a Comment