...
Geometric Primitive Support
One of the required parameters for the ptexture() call is __faceindex. This index is a facevarying, postive integer at each quad face of the surface, usually starting at 0. For Catmull-Clark surfaces, non-quad faces are numbered at each vertex, and the first level of subdivision of the non-quad faces will generate N-subfaces, where N is the number of vertices. For quad faces, the same faceindex` value is used on each vertex. An example of the faceindex layout is shown below. Note that the __faceindex follows special subdivision rules that will ensure the value is constant across quad-faces and that the shader parameter will be of varying detail. For Loop surfaces, only triangular faces are supported; each vertex of the face should be numbered with the same __faceindex value. A RIF called RifSubdivFaceIndex.so is included for convenience that will take a subdivision surface without a faceindex and create the appropriate __faceindex values at each vertex.
Here is the RIB file example utilizing Ptex:
Code Block |
---|
##RenderMan RIBversion 3.03
Projection "perspective" "fov" [45]
Format 256 256 1.0
Option "ribparse" "string varsubst" ["$"]
Display "test.tif" "tiff" "rgba"
WorldBegin
Attribute "visibility" "camera" [1]
Translate 0 0 3
Pattern "PxrPtexture" "ptex" "string filename" "./plateface.ptx"
Bxdf "PxrDiffuse" "mydiffuse" "reference color diffuseColor" ["ptex:resultRGB"]
ShadingRate 1
SubdivisionMesh "catmull-clark"
[4 4 4 4 3 3 4 4 4 4]
[4 5 1 0 5 6 2 1 6 7
3 2 8 9 5 4 9 10 5
10 6 5 10 11 7 6
12 13 9 8 13 14 10 9
14 15 11 10]
["interpolateboundary" "smoothtriangles"] [0 0 1 0] [1] []
"P" [-1.0 -1.0 0
-0.3333333333333 -1.0 0
0.3333333333333 -1.0 0
1.0 -1.0 0
-1.0 -0.3333333333333 0
-0.3333333333333 -0.3333333333333 0
0.3333333333333 -0.3333333333333 0
1.0 -0.3333333333333 0
-1.0 0.3333333333333 0
-0.3333333333333 0.3333333333333 0
0.3333333333333 0.3333333333333 0
1.0 0.3333333333333 0
-1.0 1.0 0
-0.3333333333333 1.0 0
0.3333333333333 1.0 0
1.0 1.0 0]
"facevarying float __faceindex" [6 6 6 6
7 7 7 7
8 8 8 8
9 9 9 9
0 1 2
3 4 5
10 10 10 10
11 11 11 11
12 12 12 12
13 13 13 13]
"constant string __handleid" ["${RMANREGRESS_TESTOBJDIR}/plate"]
WorldEnd |
...