Copying with Packed Primitives vs. Pack Sop

   2992   2   0
User Avatar
Member
37 posts
Joined: March 2014
Offline
Hey guys,

I've come across a difference in behavior when trying to colorize packed primitives.
When packing with the copy sop, I can't seem to get the color showing in the viewport…whereas when packing “manually” after the copy sop it seems to work as expected.
Rendering wise it differs in that the manual packed Geo renders the color with the Cd Attribute and the copy sop packed Geo renders with the packed:Cd renderstate Variable.

The question is, is this the expected behavior, am I doing something wrong and what's the best way to go about this?

Attached you find an example file

Attachments:
PackingAndCopyingDifference.hipnc (994.8 KB)

User Avatar
Staff
2595 posts
Joined: July 2005
Offline
gotchee
Hey guys,

I've come across a difference in behavior when trying to colorize packed primitives.
When packing with the copy sop, I can't seem to get the color showing in the viewport…whereas when packing “manually” after the copy sop it seems to work as expected.
Rendering wise it differs in that the manual packed Geo renders the color with the Cd Attribute and the copy sop packed Geo renders with the packed:Cd renderstate Variable.

The question is, is this the expected behavior, am I doing something wrong and what's the best way to go about this?

Attached you find an example file

With one method, you're packing to “Packed Geometry” primitives, the other you're creating “Packed Fragment” primitives. Different types of packed primitives have different properties (http://www.sidefx.com/docs/houdini15.0/model/packed) [sidefx.com]

The viewport currently doesn't keep track of the attribute stack when unpacking “packed geometry” primitives. However, when the viewport (and mantra) render packed fragments differently, and are able to deal with attributes on the fragments properly.

If you render in mantra, you should see that both styles actually work, it's the viewport that has trouble with the complexity of keeping track of attribute values when unpacking.

For the technical reasons… the viewport does instancing of packed geometry, so the color attribute has to be handled differently than if it were a geometry attribute. And that special case isn't supported currently. Also, when mantra renders the instances, the only way this works is because of the renderstate() function in the shader (see the referenced document).

Hope this helps.
User Avatar
Member
37 posts
Joined: March 2014
Offline
Thanks for the clarification Mark!
This helps a lot
  • Quick Links