SLIDE 4 4
Textures in RenderMan
Can access color or floating point values
from file
f = float texture (“foo.tex”); c = color texture (“bar.tex”);
Can access specific channels from file
f = texture (“foo.tex” [1]);
Textures in RenderMan
texture() function provides manual
control over filtering
Blur Filter width Type of filter Fill data (for missing channels) See Section 8.1.4 in text.
Texture format
prman has a proprietary format for textures.
txmake [args] infile outfile
Converts images into this format Args:
-mode [black clamp periodic] -smode, -tmode -short, -float -resize up-
Textures in RenderMan
surface paintedplastic ( float Ka = 1, Kd = .5, Ks = .5, roughness = .1; color speccolor = 1; string texname = “”;) { color Ct = Cs; if (texname != “”) Ct *= color texture (texname); normal Nf = faceforward (normalize(N), I); vector V = -normalize (I); Ci = Ct * (Ka*ambient() + Kd*diffuse(Nf)) + speccolor * Ks * specular (Nf, V, roughness); Oi = Os; Ci *= Oi; }
Textures in RenderMan
Questions?
Textures in GLSL
Texture access in GLSL is almost as
easy
EXCEPT… Texture state must be set up in OpenGL
program!
Places texture into texture memory for use
by shaders