Skip to content

Support for multiple UV sets #72

Description

@mzschwartz5

Currently, the subscene override replicates the voxelized geometry by getting its connected shaders, querying each for vertex buffer requirements, and using an MGeometryExtractor to populate vertex buffers based on those requirements.

The issue is, the VB requirement descriptors given to us specify semantics like TEXCOORD0 or TEXCOORD1, but do not specify which UV set to use for each. Even if it did, MGeometryExtractor has no knowledge of those UV sets and would fail to populate buffers for descriptors with named UV sets.

So, implicitly, the plugin only supports models with 1 UV set, and that UV set has to be the first UV set.

I'm not sure what the canonical solution is here... I formulated a solution, but it's really complex:

  • Query uv linking information (mapping of UV sets to textures)
  • Query shader parameters and build a mapping of parameter names to semantics
  • Using those two mappings, I think you can go from UV set -> TEXCOORDn, i.e. figure out which parameter corresponds to which UV set.
  • But then, you still need a way to actually populate a descriptor that specifies a UV set name. This can be done using a custom registered MPxVertexBufferGenerator which queries (via MDagPath) the mesh's UV data based on the UV set name provided from the mappings above. Basically, this generator needs to do the above logic and use the mapping to fill a buffer.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions