Appendix C: Custom vertex data

 
 
 

Previously, UVs, ColorPerVertex, and User Data per Vertex are being referenced by index. This creates a pipeline challenge since it is difficult to enforce indices.

Now, by default, a data block is added to each shape node that provides the name of each piece of data (UVs, CVP, and custom data per vertex). You can query this table from within the shader API in order to retrieve and resolve the string value passed to a shader.

You can assign shading networks to many objects and assign the ColorPerVertex and UVs at render time without explicitly creating a connection within the Maya scene. At render time, the shader would be responsible for converting Name references into per-instance or per-shapeNode indices.

An example of this data block is shown below:

data "pPlaneShape1:PerVertexNomenclature"
 "PerVertexNomenclature"
 (
 "magicnumber" 5149248936,
 "tex" // texture space or Maya UVs
 [
 { "name" "uvset1", "index" 0 }
 { "name" "myUVset", "index" 1 }
 { "name" "bakeUV", "index" 2 }
 ],
 "cpv" // color per vertex (RGB only)
 [
 { "name" "ColorSet1", "index" 3 }
 { "name" "CPV_DirtMask", "index" 4 }
 { "name" "CPV_WetMask", "index" 5 }
 ],
 "cudpv" //custom data per vertex
 [
 { "name" "LightIndexField", "index" 6 }
 ]
 )
object "pPlaneShape1"
 visible on
 shadow 3
 transparency 3
 reflection 3
 refraction 3
 finalgather 3
 face both
 tagged
 trilist vertex 4 p n t 2 b 2 u 3 triangle 2
 [
 vertex data goes here
 ]
 [
 0 0 1 3
 0 3 1 2
 ]
 end trilist
 data "pPlaneShape1:PerVertexNomenclature"
end object
shader "DirtMapCPVLookup1" "myCustomVertexColor" ( "cpvname" "CPV_Dirtmask", .... )

To turn this off, you can select between the following methods: