シェーダは次の通り
surface reflect (
float Ka = 1;
float Kd = .5;
float Ks = .4;
float Kr = .3;
float roughness = .1;
color specularcolor = 1;)
{
normal Nf = faceforward (normalize(N),I);
vector V = -normalize(I);
color Ct;
vector Rcurrent=reflect(I,Nf);
vector Rworld=vtransform("world",Rcurrent);
color Cr=color environment("envlati.tx",Rworld);
Ct=Cs;
Oi = Os;
Ci = Oi * ( Ct * (Ka*ambient() + Kd*diffuse(Nf)) +
specularcolor * (Ks*specular(Nf,V,roughness)+Kr*Cr));
}
RIBは次の通り
MakeLatLongEnvironment "studio2.tif" "envlati.tx" "gaussian" 2 2
Display "reflect3.tiff" "file" "rgb"
Display "+teapot" "framebuffer" "rgb"
Format 640 400 1.0
Projection "perspective" "fov" 25
Translate 0 0 5
WorldBegin
#Translate -10 -45 0
Rotate -115 1 0 0
LightSource "ambientlight" 1 "intensity" .4
LightSource "distantlight" 2 "intensity" 0.4
"from" [-50 300 200] "to" [0 0 0]
LightSource "distantlight" 2 "intensity" 0.2
"from" [-50 -300 200] "to" [0 0 0]
LightSource "distantlight" 2 "intensity" 0.1
"from" [50 -200 10] "to" [0 0 0]
Color [1 1 1]
Surface "reflect"
Sphere 1 -1 1 360
WorldEnd
PRMan
MacRenderManではシェーダの変数の宣言部分を書き直す。
そしてAqsisでは、フィルターがかかっているようである。
環境マップ
Essential RenderManのサンプルを利用しました。Thank you
- -
- -