RixPatterns
Stocastic Culling


return to main index

Code: RfM 22.0
    CutrCullByThreshold.args
    CutrCullByThreshold.cpp



Introduction

The pattern node presented here can be used to "cull" objects by connecting it's resultMask output to the presence input of a material. The node reads the value of a user (float) attribute associated with each object. For example.

    Attribute "user" "float probability" [0.8444]

It is assumed the attribute values are random and are in the range 0 to 1. The value of the "Presence Threshold" determines when the attribute value will cause the plugin to output resultMask values of 0 or 1 for the geometry being shaded.



Figure 1


The following animation shows the effect of the culling when applied to 500 nurbs planes. The geometry was created by a procedure called gen_random_planes. The value of the "Presence Threshold" was keyframed from 1 to 0.



Figure 2


Each of the planes were assigned a float attribute called rmanFprobability with a random value between 0 and 1 using a MEL script called addRmanFloatAttr.mel. Note the procedure adds the prefix rmanF. The prefix causes the RfM plugin to output the following rib statement for each nurbs plane.

    Attribute "user" "float probability" [0.881849647]


Figure 3


Instructions on compiling the plugin can be found here,
    "RixPattern Plugins: Step 6".
Information about registering the plugin can be found here,
    "Args nodeid Registration".







© 2002- Malcolm Kesson. All rights reserved.