Shader uniform value set according to mesh attribute

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I am currently trying to figure out how it is possible with the Maya API to dynamically set the value of a uniform that is defined by a MPxHardwareShader. I am currently able to change the attribute that directs to invalidate the uniform so that it is effectively changed globally for a whole scene. However, I want to do this dependent on an attribute set per MFnMesh. A simple scenario would be to have an objectID defined as an attribute per mesh and a correspondent uniform of equal type defined in the shader, and while drawing the meshes to have the uniform value set to the correspondent objectID. My ultimate goal is to achieve this with a custom matrix that is set per mesh/object in a similar fashion as the World matrix supplied by Maya. I am using the dx11Shader with Viewport 2.0.
Thanks in advance for helping!
Amir