OSL
|
Introduction
This tutorial presents a shader called |
|
The shader reads two custom rib attributes that refer to a list of 3d coordinates.
For example,
Attribute "user" "int verts_count" [4] Attribute "user" "point[400] verts_data" [ 0.000 1.200 0.000 0.875 2.160 -0.045 0.000 1.200 0.000 -0.537 0.074 0.367 0 0 0 0 0 0 396 additional "padding" xyz coordinates ]
The A Fixed List of Coordinates - Why?When reading an array of values from an attribute, for example, point data[MAX_VERTICES]; int result = getattribute("user:verts_data", data);
the size of the array ( How the Coordinates are CreatedFor an example of how the edges of polygonal mesh can be used to control the displacement of another object refer to the tutorial "RiMel - WyvillEdges". How the Coordinates are Used
At each shading point, |
|
Additioally, the distance to each line is converted to a
Wyvill "field function" value.
The sum of the field values are assigned to the |
|
Listing 1 - WyvillLines.osl
|
|
© 2002- Malcolm Kesson. All rights reserved.