Huai-Ping Lee
I tried out some built-in shaders in PRMan (in /usr/local/prman/lib/shaders
) such as "glass," which uses
(comp(Ci,0) + comp(Ci,1) + comp(Ci,2))/3 + (1-Cs)as the output opacity, which depends on the colors. I changed it to depend on the angle between the viewing direction and the normal:
... Nf = faceforward( normalize(N), I); V = -normalize(I); ... P_tr = transform("shader", P); C_tmp = 2 * color noise(P_tr); Kl = (comp(C_tmp,0) + comp(C_tmp,1) + comp(C_tmp,2))/3; Oi = Kl * (0.75 - 0.5 * abs(V.Nf)); ...Here are the resulting pictures:
built-in glass shader | modified glass shader |
I tried out a procedural displacement shader from RenderMan Repository:
... PP = transform ("shader", P); size = frequency; for (i = 0; i < maxoctaves; i += 1) { magnitude += abs (.5 - noise (PP*size)) / size; size *= 2; } P = P - (Km * pow (magnitude, power)) * normalize (N); N = calculatenormal (P); ...which is basically moving each fragment along its normal direction according to some turbulence (sum of multiple noise functions with varying amplitude and frequency). Here are some results:
Km = 1 | Km = 5 |
RenderMan Repository, http://www.renderman.org/.