Autodesk / maya-usd

A common USD (Universal Scene Description) plugin for Autodesk Maya
768 stars 201 forks source link

Maya To Hydra (MtoH) built with PixarUSD 21.08 or later: Selection issue on hdRPR and Arnold render delegates #1741

Closed Vsevolod1983 closed 2 years ago

Vsevolod1983 commented 3 years ago

Describe the bug Hello ! I use Pixar USD within Maya To Hydra (MtoH) project for rendering using hdRPR render delegate. Actually the problem I'm going to share also gets reproduced on Arnold render delegate as well.

I have strange issue regarding selection. When I select any object in Maya, e.g. simple cube, all rendered picture suddenly disappears in the viewport (for hdRPR or Arnold Hydra render delegate). I made some investigation and figured out that PixarUSD 21.05 works ok, problem started to appear on PixarUSD 21.08

Some investigation regarding commits (inside PixarUSD repo) Pixar USD 21.05 (090ef0d) - works ok, selected mesh is fully filled with yellow color. image

Starting from commit Apr 15 c1d846c ([Hgi] Added buffer binding support for Hgi shader codegen) - selection works but selected mesh looks like just outlined (not fully filled with yellow color). image

commit Apr 27 36223b8 (Do not restore framebuffer in HgiGLScopedStateHolder and HgiInterOpOpenGL.) - selection does not work at all. If any of meshes is selected, the entire rendered image gets disappeared. image

If disable execution of ColorizeSelectionTask in Hydra - image does not get disappeared but obviously selection does not work.

I see no issues while using the same render delegate hdRPR in USD Viewer application with any version of PixarUSD (21.05, 21.08, 21.11).

So it looks like something wrong with the way how Maya viewport interacts with graphics low level of PixarUSD. All commits I mentioned above have changes in things regarding textures, GL calls, etc.

Does anybody could help with that ? (PixarUSD guys redirected me to this repository for posting an issue). Thank you!

Steps to reproduce

  1. Use MtoH plugin with PixarUSD 21.08 or later
  2. Select Hydra Render Delegate (Use Arnold render delegate for example)
  3. Make a cube and select it
  4. Notice that the entire image gets disappeared.

Expected behavior If you select a mesh entire scene should not get disappeared.

Specs (if applicable):

santosg87 commented 3 years ago

I can reproduce this issue on our Side as well.

it seems it might be something with how Arnold itself is tapping onto mtoh here, as hydraGL does display the selection on my testing. I will pass this info along and see what we can find out. :)

Vsevolod1983 commented 3 years ago

I can reproduce this issue on our Side as well.

it seems it might be something with how Arnold itself is tapping onto mtoh here, as hydraGL does display the selection on my testing. I will pass this info along and see what we can find out. :)

hydraGL does not execute ColorizeSelectionTask (it executes SelectionTask) this is the possible reason why it works.

kxl-adsk commented 2 years ago

@Vsevolod1983 we have a PR #1863 open to address this issue. Feel free to test it out before we merge.

Vsevolod1983 commented 2 years ago

I will try, thank you !

Vsevolod1983 commented 2 years ago

@kxl-adsk Hello ! Thank you for the fix! The image does not disappear anymore, however, selection looks like just being outlined (selected shape is not fully-filled with yellow color). Is it expected ?

image

perrauo-adsk commented 2 years ago

Yes, the image disappearing was tied to fc63eaef295edb2f90099614f833c26fac11764c.

We will have a look at the outline issue separately. I am not sure of the root cause yet.

williamkrick commented 2 years ago

Hi @Vsevolod1983, I took a look at this one today. In the Arnold (Hydra) render settings the default value for Selection Outline (cut off in my image) is 4.0, which turns on selection outline for selection highlighting. In GL (Hydra) the default value is 0 and so the objects draw with full highlight.

Is it possible that you have the default outline value set for Arnold (Hydra) and that is why you are seeing outlines? Locally with USD 21.11 & up-to-date MayaUSD when I set the outline to 0 pixels I see objects with full highlighting.

image image

Vsevolod1983 commented 2 years ago

Hello @williamkrick ! Yes, it seems to be working with this parameter set to 0. Thank you!