俄國網頁講Renderman,看不懂寫什麼?但shader可以用,而且效果幾好。http://www.renderman.ru/about.html
color LocIllumGlossy ( normal N; vector V; float roughness, sharpness; )
{
color C = 0;
float w = .18 * (1-sharpness);
extern point P;
illuminance (P, N, PI/2) {
/* Must declare extern L & Cl because we're in a function */
extern vector L;
extern color Cl;
float nonspec = 0;
lightsource ("__nonspecular", nonspec);
if (nonspec <1) {
vector H = normalize(normalize(L)+V);
C += Cl * ((1-nonspec) *
smoothstep (.72-w, .72+w,
pow(max(0,N.H), 1/roughness)));
}
}
return C;
}
float linstep(float min, max, x)
{
float f;
if (x < min) f = 0;
if (x >= max) f = 1;
f = (x-min)/(max-min);
return f;
}
surface eyeBallShader ( float Ka = 1, Kd = 0.8, Ks = .8, roughness = 0.05;
color eyeBallcolor = color (1,1,1);
color Pupilcol = color (0.439, 0.346, 0.217);
float PupilcolMax = 1.1;
float PupilcolMin = 0.2;
float PupilPos = 0.2;
float IrisPos = 0.1;
float SpecSharpness = 0.01;
)
{
normal Nf = faceforward (normalize(N), I);
vector V = -normalize(I);
color e = eyeBallcolor * (Ka*ambient()+Kd*diffuse(Nf));
color p0 = Pupilcol+PupilcolMax*Pupilcol;
color p1 = Pupilcol;
color p2 = Pupilcol-PupilcolMin*Pupilcol;
float grad = linstep (IrisPos, PupilPos,t);
color Ceye = spline(grad,p0,p0,p1,p1,p2,p2,p2);
Ceye = Ceye * (Ka*ambient()+Kd*diffuse(Nf));
color i = color(0,0,0);
float i_pos = smoothstep (IrisPos, IrisPos,t);
float p_pos = smoothstep (PupilPos, PupilPos,t);
color Csurf = mix(mix(i,Ceye,i_pos),e, p_pos);
Ci = Csurf + Ks*LocIllumGlossy(Nf, V, roughness, SpecSharpness);
Oi = Os; Ci *= Oi;
}
近期常用renderman renderproject,速度很好,但我不懂怎能net work render和可否將它的使用率調節最高的能力,我只用Houdini執行prman的應用程式,運行rendering的工作。大家可否指教本人方法,謝謝!