I have a system where an asset is instanced onto a large # of scattered points. The asset has a “Cd” attribute, and the particles have a “CdMult” attribute. I have a simple shader that takes the Cd and the CdMult and multiplies the two for the final diffuse color. It's pretty simple.
My ultimate question is, what is the most efficient way to display the multiplication of the two point attributes in the viewport, one attribute coming from a particle, and the other the asset being instanced?
This is not an uncommon task. Even the Copy SOP has a built in feature to multiply attributes when copying assets. But, I have a lot of geometry to copy, and the Copy SOP isn't known for it's speed… So how would you go about doing this common task?
The most efficient way I can think to do this involves PolySoup and a Copy SOP. Sadly, this is still quite slow.
Is this something you could do with a OpenGL Shader? Or do we not have access to the scattered points attributes in OpenGL? If it IS possible, could I beg someone to show me a simple example?
Visualizing Instances + Cd + OGSL
1761 2 1- Brian Walters
- Member
- 155 posts
- Joined: Sept. 2015
- Offline
- malexander
- Staff
- 5161 posts
- Joined: July 2005
- Offline
There's currently no way to do this using instancing, as it's not possible to indicate that an attribute is a per-instance attribute.
We do have plans to get packed primitive Cd multiplying the packed geometry's Cd, which is basically what you'd want. This would be the copy SOP with Pack Geometry on, with Cd on the copied geometry and Cd on the template geometry (points being instanced on). But that's not currently in any build yet.
We do have plans to get packed primitive Cd multiplying the packed geometry's Cd, which is basically what you'd want. This would be the copy SOP with Pack Geometry on, with Cd on the copied geometry and Cd on the template geometry (points being instanced on). But that's not currently in any build yet.
- Brian Walters
- Member
- 155 posts
- Joined: Sept. 2015
- Offline
-
- Quick Links