Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Autodesk: Add more strict check when using texture prim path as hash #3523

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from

Conversation

erikaharrison-adsk
Copy link
Contributor

Description of Change(s)

If a scene have multiple texture prims with same names, e.g., there're lots of texture prim named as /full_color_texture in the ALab scene (link), when different USD prims with materials refer to its own /full_color_texture are put together into the scene, and the problem happens when we do "texture off" and "texture on" mode switch on the scene:

When switch to "texture off" mode, we dirty the scene by disconnect texture inputs nodes of all materials via HdDataSourceMaterialNetworkInterface::DeleteNodeInputConnection(), then some prims might be drawn in a batch now as the texture inputs are disconnected.
When we switch to "texture on" mode by reconnect texture inputs nodes of all materials, then in HdStMaterial::Sync(...), the previous batched draw prims are still not broken as now the texture prim path are all /full_color_texture, which produces same hash code due to that perf optimization code, and the drawing result is incorrect as those prims are actually referring to different texture files.

To fix is, when _isInitialized is true, adding another check on that TextureDescriptor to see if the texture's prim path is changed or not, if yes, do not use texture prim path as hash.

Link to proposal (if applicable)

  • N/A

Fixes Issue(s)

Checklist

@jesschimein
Copy link
Collaborator

Filed as internal issue #USD-10656

(This is an automated message. See here for more information.)

@jesschimein
Copy link
Collaborator

/AzurePipelines run

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants