cpichard / usdtweak

Universal Scene Description standalone editor
Apache License 2.0
232 stars 23 forks source link

textures? #10

Closed meshula closed 1 year ago

meshula commented 1 year ago

Do you expect materials with textures to draw? Kitchen is colored, but if I load a scene with texture cards, they show up as gray rectangles. I'm wondering if there's different render display modes that I haven't spotted in the UI. I'm about to go and read the code but thought I would ask as well :)

cpichard commented 1 year ago

Hi @meshula , did you see the "Enable scene material" option available when you click on the "Viewport" button ? Toggling it should force the render delegate to load the materials and textures, hopefully... By default it is off, just to make sure the scenes are loaded as fast as possible. In the upcoming update there will be a push button in the viewport for enabling scene material, it will be more convenient than looking into a list of options.

C

meshula commented 1 year ago

Gotcha! A silly thing I did, was to explore the UI without a scene loaded. The viewport buttons don't have a popup menu if there's no scene, and I assumed that maybe they were future functionality. When my scene was loaded I didn't go back to pushing those buttons..! A popup menu with a disabled entry saying something like "[No scene loaded]" might be a helpful breadcrumb to people following the same invalid steps I did :)

Toggling the scene materials turns the objects in the scene black, so probably I just need to introduce a light into the scene to see the textures.

cpichard commented 1 year ago

"A popup menu with a disabled entry saying something like "[No scene loaded]" might be a helpful breadcrumb to people following the same invalid steps I did :) " That's a great idea, I'll work out something to make those buttons less confusing. And thanks for the feedback, this is really helpful.

Don't hesitate to let me know if you have issues with the textures being black. There was a report saying sometimes the textures don't load the first time with storm, and they had to change render delegate and back, and they showed up. This doesn't happen with usdview and I haven't been able to reproduce this issue on my machine unfortunately.

Thanks

meshula commented 1 year ago

Textures are working for me, for the most part! I've got one scene where the textures don't show up, so it's in my queue to build another render delegate so I can attempt switching back and forth. ATM I've only built a Metal delegate.

meshula commented 1 year ago

If I open the file, and then open it again immediately, the textures show up.

The first time, the entire mesh is colored per the top left pixel of the corresponding texture. Very weird, I can't repro in other apps.

meshula commented 1 year ago

Further note ~ if we start with enableSceneMaterials = true, line 29 in src/ImageSettings.cpp, everything works fine verified at another user's computer in their independent build ~ both of us are on MacOS running the Metal backend

meshula commented 1 year ago

testEXR2.zip

Here's the file that shows the behavior

creijon commented 1 year ago

I’ve reproduced this in a small usd viewer application.

If I change the UsdImagingGLRenderParams.enableSceneMaterials to default to false on startup and then add a hotkey to flip this to true, the cards asset shows no UVs on the quads.

If I load it with this flag default to true on startup then it renders correctly.

Jon

On Mon, 12 Jun 2023 at 07:10, Nick Porcino @.***> wrote:

testEXR2.zip https://github.com/cpichard/usdtweak/files/11718596/testEXR2.zip

Here's the file that shows the behavior

— Reply to this email directly, view it on GitHub https://github.com/cpichard/usdtweak/issues/10#issuecomment-1586652148, or unsubscribe https://github.com/notifications/unsubscribe-auth/APVAIQGTVY5WBZAUQTBRAHLXK2XGPANCNFSM6AAAAAAYSDH3I4 . You are receiving this because you are subscribed to this thread.Message ID: @.***>

cpichard commented 1 year ago

Thanks a lot for the feedback @meshula and @jonny-apple ! I can reproduce the issue with your test scene in storm/macos/usd 23.05. It doesn't look like a usdtweak issue now, although UT could start with enableSceneMaterials set to true. I'll compile and test with another delegate this weekend to check if the problem is coming from hydra or from storm. Thanks again,

C

creijon commented 1 year ago

Yes, it's definitely something in Storm; I've also reproduced the issue in usdview on Linux and macOS.

And I have to say, usdtweak is an awesome tool. Great work.

Jon

On Tue, 13 Jun 2023 at 06:47, cpichard @.***> wrote:

Thanks a lot for the feedback @meshula https://github.com/meshula and @jonny-apple https://github.com/jonny-apple ! I can reproduce the issue with your test scene in storm/macos/usd 23.05. It doesn't look like a usdtweak issue now, although UT could start with enableSceneMaterials set to true. I'll compile and test with another delegate this weekend to check if the problem is coming from hydra or from storm. Thanks again,

C

— Reply to this email directly, view it on GitHub https://github.com/cpichard/usdtweak/issues/10#issuecomment-1588585725, or unsubscribe https://github.com/notifications/unsubscribe-auth/APVAIQCXWOXY5LJDERQ6PODXK75HZANCNFSM6AAAAAAYSDH3I4 . You are receiving this because you were mentioned.Message ID: @.***>

cpichard commented 1 year ago

Thanks @jonny-apple ! I am happy to see that usdtweak can be useful :) I'll open an issue for this storm bug on the pixar repo. Cheers, C

meshula commented 1 year ago

We noticed that

setenv USDIMAGINGGL_ENGINE_ENABLE_SCENE_INDEX 1

resolves the problem. So maybe it's not a priority to fix, as will no longer be an issue when the new scene indexing tech becomes default.

cpichard commented 1 year ago

Thanks a lot for the info @meshula , I have added a note in the README. Best, C

meshula commented 1 year ago

Thanks! I'm going to go ahead and close this issue, as I don't think there's anything that needs to be done to usdtweak!