RixPatterns
Color By Ray Type


return to main index

Code: RfM 22.0
    CutrColorByRayType.args
    CutrColorByRayType.cpp


Introduction

The code for the pattern node presented here is based on the answer given by Dan Kripac on the Pixar forum to the question, "Can refraction rays be distinguished from reflection rays?". The simple scene shown in figure 1 demonstrates the effect of using the resultRGB of the CutrColorByRayType pattern node as the input of the diffuseColor of an instance of PxrSurface assigned to the sphere - figure 2.



Figure 1



Figure 2
Shading network assigned to the sphere.



The CutrColorByRayType UI, figure 3, has two checkboxes that control whether or not reflection and/or refraction rays cause the "Reflection Color" and/or the "Refraction Color" to override the default "Direct Color".



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.