visualize micropolys

haggikrey
2010-06-26
2013-04-25
  • haggikrey
    haggikrey
    2010-06-26

    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?

     
  • Moritz Moeller
    Moritz Moeller
    2010-06-26

    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.

    .mm

     
  • haggikrey
    haggikrey
    2010-06-27

    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".

     
  • haggikrey
    haggikrey
    2010-06-27

    It works fine in aqsis, maybe this feature is not implemented in pixie?

     
  • Moritz Moeller
    Moritz Moeller
    2010-06-27

    Some trivia: PRMan has randomgrid() which returns a random color per grid. The difference between:

      uniform color foo = random()

    and

      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.

    -Moritz