Filter Width
怎樣用width這function做抗antialiased的用途,renderman默許的值為1,以下我用1和4做分別,width1比較好和適合,它可分開s和t作方向性設定,用s和t的方向微調數值。
texture (filename, s, t, “width”, 2);
texture (filename, s, t, “width”, 0);
texture (filename, s, t, “swidth”, 1, “twidth”, 4);
1
4
surface texmap(
float Ka = 1,
Kd = 1,
rounghness = 0;
color specularcol = 1;
string texturemap = "";
float sstart = 0, sscale = 1;
float tstart = 0, tscale = 1
)
{
float ss = (s - sstart) / sscale;
float tt = (t - tstart) / tscale;
color Ct = Cs;
if(texturemap != ""){
float opac = float texture(texturemap[3], ss, tt);
Ct = color texture(texturemap, ss, tt, "width", 1) + (1 - opac ) * Cs;
}
else Ct = Cs;
normal Nf = faceforward(normalize(N),I);
vector In = -normalize(I);
Ci = Ct * (Ka * ambient() + Kd * diffuse(Nf)) + color specularcol * specular(Nf, In, rounghness);
Oi = Os;
Ci *= Oi;
}
書講最理想是0!