Mixing
eharetea

Mixing it up with Renderman™.

A basic Renderman shader.

Date Created:Friday December 29th, 2006 03:41 AM
Date Modified:Thursday July 31st, 2008 10:14 PM


/*
*
* Author: Dan Lynch
*
*/

surface
d_surf
    (
    float Ka 1,
    Kd 0.5, 
    Ks 0.7, 
    roughness 0.1;
    color hilite 1;
    float frequency 20;
    float radius 0.4;
    )
    
{


    normal nfn;
    color ambientcolordiffusecolorspeccolorsurfcolor .5surfopac Os;

    float   ss mod(frequency1.0);
     float   tt mod(frequency1.0);
    float   sDist 0.5 ss;
    float   tDist 0.5 tt;
     float   distance sqrt(sDist sDist tDist tDist);
    
    
    float opac1 noise(s*10,t*10);


    normalize(N);      
    nf faceforward(nI);

    color mix1=0;
    if (ss 0.5)
        mix1 *= opac1;
    else
        mix1 surfopac;

    color mix2=0;
    if(distance radius)
        mix2 0;
    else
        mix2 surfopac;

    Oi *= mix(mix1,mix2,float noise(t*10));
    
    
    color map texture"s-wave.tdl"st"width"0.8 );
    setcomp(surfcolor01);
    surfcolor mix(surfcolormaps);


    ambientcolor Ka ambient();
    diffusecolor Kd diffuse(nf);
    speccolor Ks specular(nfnormalize(-I), roughness) * hilite;

    Ci Oi Cs surfcolor * (ambientcolor diffusecolor speccolor);
}



Downloads:
Download: mixed_surface.sl 1 KB

Please login or Click Here to register for downloads
Creative Commons License
Mixing by Dan Lynch
is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License
Based on a work at www.3daet.com
Permissions beyond the scope of this license may be available at http://www.3daet.com