Renderman

3delight Renderman

Lights used

2 Area Lights
1 Volume Light

Prman

Renderman Shaders

Displacement

//Reference: Renderman Shading Language by Rudy Cortes
displacement floortest(
                       uniform float Km = 0.01;//0.091//0.010
                       uniform float Freq = 4;
                       float texfreq = 4;//9.866//4.0
                       float txscale = 0.09;//0.090
)
{
  float noi;
  normal NN;
  point PP;
  float disp;
  PP = txscale*transform("camera",P);
  float tt = mod(texfreq * xcomp(PP), 1);
  float ss = mod(texfreq * ycomp(PP), 1);
  varying float disp1 = smoothstep(0.2,0.25,tt) - smoothstep(0.9,0.95,tt);
  varying float disp2 = smoothstep(0.2,0.25,ss) - smoothstep(0.9,0.95,ss);

  disp = disp1*disp2;
  P += disp*normalize(N)*Km;
  N = calculatenormal(P);

}

Floor surface shader ( shader space for 3delight render / camera space for prman render)

//Reference : Renderman Shading Language by Rudy Cortes
surface
floorcol (
        color tile=color(65/255,105/255,225/255);
        color groove=color(26/255,26/255,26/255);
        uniform float Km =0.010;
        float texfreq=4.0;
        float txscale=0.09;//0.268
        float alphan=1;
        float Ka = 1, Kd = .75, Ks = .4;
            )
{
  normal Nf;
  color Ct;

  float noi;
  normal NN;
  point PP;
  point PC = P;
  float disp;
  PP = txscale*transform("camera",P);
  float tt = mod(texfreq * xcomp(PP), 1);
  float ss = mod(texfreq * ycomp(PP), 1);
  varying float disp1 = smoothstep(0.2,0.25,tt) - smoothstep(0.9,0.95,tt);
  varying float disp2 = smoothstep(0.2,0.25,ss) - smoothstep(0.9,0.95,ss);

  disp = disp1*disp2;
  P += disp*normalize(N)*Km;
  N = calculatenormal(P);

  if(disp>0)
    Ct = tile;
  else
    Ct = groove;

    Nf = faceforward(normalize(N),I);
    Oi = Os;
    Ci = Os * (Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
                Ks*specular(Nf,-normalize(I),0.1));
}

Red seat  velvet shader

The idea here is to recreate the King’s Treasure velvet texture from the previous assignment using renderman. Refer https://raytracker.wordpress.com/2011/04/27/the-kings-treasure/

For creating a ramp, the renderman spline function is used and for smooth transition between the colors of the ramp the renderman mix function is used.

The facing ratio is fed as input to the ramp and then an attempt is made to use the specularbrdf() function.

surface
seatsurf(
        uniform float Km =0.010;
        float texfreq=4.0;
        float txscale=1;//0.268
        float alphan=0.5;
        float Ka = 1, Kd = .75, Ks = .4;
            )
{
  normal Nf;
  color Ct;
  color diffcolor = color(0.216,0.004,0.004);
  color refcolor ; //Feed the ramp here
  color ramp1 = color(0.98,0.094,0.094);
  color ramp2 = color(0.216,0.004,0.004);
  color ramp3 = color(0.067,0.001,0.001);
  color ramp12,ramp23;
  color outramp;
  float ramp_pos;
  float facing_ratio;
  vector camera_ray;
  vector reflec_dir;

  //increse brdf values
  //increase reflectivity

  //the reflectivity color = ramp
  // facing ratio into the u v cord inate of ramp 

  //Create ramp

   //smoothtransition smoothstep
   //use smoothstep to calculate  
   ramp12 = mix(ramp1,ramp2,alphan);
   ramp23 = mix(ramp2,ramp3,alphan);

  //Calculate facing ratio

   camera_ray = normalize(-I);
   facing_ratio = abs(camera_ray.N);   

  //Input facing ratio into ramp
   outramp = spline(facing_ratio,ramp1,ramp12,ramp2,ramp23,ramp3);

  //Put this color as reflec color
   Ct =outramp;

   reflec_dir = reflect(I,N);
  //Calculate reflection color

    Nf = faceforward(normalize(N),I);
    Oi = Os;
    Ci = Os * (Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
                Ks*specularbrdf(normalize(L),Nf,normalize(reflec_dir),0.1));
}

Table Wood texture shader

The idea here was to plot a sine wave on the texture itself and generate various patterns resembling wood. The different colored bands are a part of the plotted sine wave. The amplitude of the sine wave is set high making it appear as if they are parallel bands. The portion under the sine wave has a darker brown color and forms the larger part of the texture. The idea was to generate concentric circles in this area, however a simple noise pattern is used here.

surface
sintest (
        float filterwidth=1;
        float amp=1;
        float freq=30;
        float phase=0;
        float txscale=1;
        float alphan=1;
        float Ka = 1, Kd = .75, Ks = .4;
        color wood1 = color(255/255, 239/255, 219/255);
        color wood2 = color(139/255, 115/255, 85/255);

            )
{
  float val,val2;
  float red;
  point PP;
  normal Nf;
  uniform float swt;
  color Ct;
  color variant;
  float rand1;
  float walpha;
  vector woodP;
  float dd;
  point Pnew = (0,0,0);
  point origP;

  origP = transform("NDC",Pnew);
  PP = txscale*transform("NDC", P);
  //PP = mix(xcomp(PP),ycomp(PP), alphan);
 //printf("x = %lf y = %lf z = %lf \n", xcomp(PP), ycomp(PP), zcomp(PP));

  rand1 = mod(random()*5,5);

  val =  rand1 * sin ((freq*xcomp(PP)) + phase);
  val2 =  rand1 * cos ((freq*xcomp(PP)) + phase);

  if(smoothstep(val-2, val+2, ycomp(PP))){
      walpha = noise(random());
      Ct = mix(wood1,wood2,walpha);

    }
    else if(smoothstep(val2-0.01, val2+0.01, ycomp(PP))){

      woodP = PP - origP;
      dd = sqrt(abs(woodP.woodP));
      dd += noise(PP);
      walpha = mod(1*dd,1);
      Ct = mix(wood2,wood1,walpha);

    }
    else{

      Ct = wood2 ;
    }

    Nf = faceforward(normalize(N),I);
    Oi = Os;
    Ci = Os * (Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
                Ks*specular(Nf,-normalize(I),0.01));
}

Slightly modified versions of the wood texture and the velvet texture were used as renderman shaders for the cabinets and the wall respectively.

For generating caustics using renderman,

these setting were used

Posted in Uncategorized | Leave a comment

The King’s Treasure

Final Render:

Lights Used:

5 Spotlights ( Caustic / Non-Caustic)
3 Area Lights


Materials Used:

mia_material_x
gold,copper,silver

dielectric_material
diamond(ior 2.4) 
ruby (ior 1.7)

Textures Used:

Velvet Texture for table cloth using samplerInfo and RAmp

Crown Velvet-like red material

Gold material using mia_material_x 
Adjusted BRDF curve and 0 degree and 90 degree reflection

Posted in Uncategorized | Leave a comment

Matinee

Cloth Texture

Shoe UV

Eye UV ( Fractal and Ramp )

 

Other parameter used

Depth map shadows, Subsurface scattering, mental ray renderer, mental ray materials

 

Issues

Light glow doesn’t work using mental ray. Composited into final render using Nuke.

Posted in Uncategorized | Leave a comment

Natural History Museum Lighting

Lights Used:

1 Volume Light

2 Point Lights

9 Area Lights

18 Spot Lights

 

Some of  the other Parameters used:

Depth Map Shadows

Incandescence

Light Decay

Penumbra Angle

Mental Ray Final Gathering

 

 

 

Textures Used:

Main Wall Texture

Wooden Ceiling Texture

Dark wall texture

Floor Texture

Stained Glass Texture

Side Columns

Posted in Uncategorized | Leave a comment

Raytracer

Ray tracer implements

Reflections

Refractions

Inverse Spherical Mapping

Bump mapping

Antialiasing

In the above figure there the second layer of spheres is refractive as well as a block on the right. The sphere on the left top corner has a denim texture mapping. The bump mapping is not shown here.

Some of the other images generated using this code

Here is a inverse spherical mapping  with (‘bump mapping?’)

 

This is the original image with reflections and antialiasing enabled.

 

This is the a modification of the previous creative image. The top layer here is made completely of glass.

 

This is a spiral with reflection visible below each sphere.

———–

Posted in Uncategorized | Leave a comment

Hello world!

Welcome to WordPress.com. This is your first post. Edit or delete it and start blogging!

Posted in Uncategorized | 1 Comment