vigneshwarv
06-11-2010, 01:24 PM
Im stuck,please give me a direction
I use 3Delight for compiling the shaders
I have the error when i compile and it tells that
ERROR:undefined variable `RCurrent`
ERROR:undefined variable `RWorld`
surface plastic(float Ka=1,Kd=0.5,Kr=0.04,Ks=.5,roughness=.1;color specularcolor=1;)
{
vector V;
normal Nf;
Nf=faceforward(normalize(N),I);
V=-normalize(I);
color mytexture;
/* Texture (Advanced Renderman:creating cgi for motion pictures.
By Anthony A. Apodaca, Larry Gritz, Ronen Barzel listing 8.1 page no 187 */
float sstart=0,sscale=1;
float tstart=0,tscale=1;
string texturename="BASKETBALL.tx";
/*simple scaled and offset s-t mapping*/
float ss=(s-sstart)/sscale;
float tt=(t-tstart)/tscale;
/* texture check */
if(texturename!="")
{
mytexture=color texture(texturename);
}
else
{
mytexture=color(1,0,0);
}
//Environment map(Essential Renderman Fast-Ian Stephenson)
vector Rcurrent=normalize(reflect(I,Nf));
vector Rworld=vtransform("world",RCurrent);
color Crefl=color environment("facade.jpg.tx",RWorld);
Oi=Os;
Ci=Oi*(mytexture*(Ka*ambient()+Kd*diffuse(Nf))+specularcolor*(Ks * specular(Nf,V,roughness)+Crefl*Kr));
}
I use 3Delight for compiling the shaders
I have the error when i compile and it tells that
ERROR:undefined variable `RCurrent`
ERROR:undefined variable `RWorld`
surface plastic(float Ka=1,Kd=0.5,Kr=0.04,Ks=.5,roughness=.1;color specularcolor=1;)
{
vector V;
normal Nf;
Nf=faceforward(normalize(N),I);
V=-normalize(I);
color mytexture;
/* Texture (Advanced Renderman:creating cgi for motion pictures.
By Anthony A. Apodaca, Larry Gritz, Ronen Barzel listing 8.1 page no 187 */
float sstart=0,sscale=1;
float tstart=0,tscale=1;
string texturename="BASKETBALL.tx";
/*simple scaled and offset s-t mapping*/
float ss=(s-sstart)/sscale;
float tt=(t-tstart)/tscale;
/* texture check */
if(texturename!="")
{
mytexture=color texture(texturename);
}
else
{
mytexture=color(1,0,0);
}
//Environment map(Essential Renderman Fast-Ian Stephenson)
vector Rcurrent=normalize(reflect(I,Nf));
vector Rworld=vtransform("world",RCurrent);
color Crefl=color environment("facade.jpg.tx",RWorld);
Oi=Os;
Ci=Oi*(mytexture*(Ka*ambient()+Kd*diffuse(Nf))+specularcolor*(Ks * specular(Nf,V,roughness)+Crefl*Kr));
}
