In houdini there was a nice tutorial where I could visualize the micropolygons with different colors.
Is there a way to do something like this in pixie?
In RenderMan this can be done with a surface shader by randomly coloring a uniform primitive variable. Here's a shader from Aqsis's shader collection that should get the job done ;)
Eric Back (WHiTeRaBBiT)
If you want clearly see individual u-polys, you need to use a varying random color value. Additionally you should set ShadingInterpolation to "constant" in our RIB and maybe use a higher number for ShadingRate, so inidvidual u-polys are larger than a pixel..
If you want to see grids of u-polygons, you need to use a /uniform/ random color value. Of course, both can be intersected by e.g. using one color channel for the grid affiliation and the other two for indivdiual u-poly distinction. Or you could just multiply the twt.
Some shader code:
varying color microPoly = color random();
uniform color grid = color random();
Oi = 1;
Ci = Oi * microPoly * grid;
Hope that makes sense.
Thanks a lot for your ideas.
Works fine if I use urandom() for uniform color variable. This way I can now see the grids, but to be honest, I dont see any difference if I set ShadingInterpolation to "smooth" or "constant".
It works fine in aqsis, maybe this feature is not implemented in pixie?
Some trivia: PRMan has randomgrid() which returns a random color per grid. The difference between:
uniform color foo = random()
uniform color foo = randomgrid();
eludes most TDs I know (incl. me).
Maybe whoever added it to PRMan at the time was just completely clueless about how REYES works or had their brain switched off that day.
The randomgrid() shadeop is neither mentioned in the PRMan docs' RSL function reference nor RSL quick reference any more.
Possibly someone at Pixar realized the redundancy and sillyness of it and they are silently deprecating it.
It is still supported though; the 'Refinement Method' app note which was only added last year uses it in the 1st example shader's code.