Dome light on windows and macOS

When I add Dome Light from the code, on windows build I see no difference. On macOS build I suddenly see a dome spherical background (see below). Is there a difference between windows and macOS in this area? Or am I missing something?

    GlfSimpleLight l;
    l.SetIsDomeLight(true);
    lights.push_back(l);

Hi,
Has the texture applied been set by you ? As I recall to work properly the domelight always needs to have a texture applied, maybe that is for Windows only, nbot sure.
Regards,
David

I haven’t added any textures to the dome light, but as you can see in the screenshot, on macos there’s some texture - no idea where it’s coming from. Perhaps it’s a default env texture in the USD?
On windows the same code doesn’t do anything (no texture and no difference in the render).

I would say the texture comes from someone’s vacation :grin:
But more seriously, try to add a texture with GlfSimpleLight::SetDomeLightTextureFile to see if it makes a difference on Windows, I think it should.
Regards,
David

Yes, I can load a file on both macOS and Windows and see the effect of it on the model, but the difference is that on macOS the dome “sphere” is rendered in the background and on Windows it isn’t.

Is there something that controls that?

macOS left, Windows right:

Whether or not the dome light is rendered as a background is an option in Storm, though I don’t think it’s always exposed (eg in usdrecord).

It’s possible the metal and OpenGL (or Vulcan?) back ends have a different default here?

Hi,

This is probably not it, but make sure that this checkbox is set (see attached image). Usdview store its settings on close, so might be that you just have during your testing accidentaly disabled that checkbox on windows?

image

Yes, this is my impression that there’s a different default for the OpenGL/Windows and Metal/macOS. Just looking for a way to change that default, which is not so obvious…

@denglesson - I am not using UsdView, the problem happens when using c++ API on Windows and macOS.

1 Like

I’m only building on macOS so I cannot test its impact on Windows but I am able to toggle display of the dome light texture using the following snippet of code when rendering with Storm. This is with v24.08.

  imaging_gl_engine_->SetRendererSetting(
      pxr::HdRenderSettingsTokens->domeLightCameraVisibility, pxr::VtValue(do_display_dome_light_textures_));

One thing that gives me pause though is that the associated group of UsdImagingGLEngine functions (GetRendererSettingsList(), GetRendererSetting(), SetRendererSetting()) has a comment in the header describing them as legacy. I’ve also observed that this setting has no effect when rendering with Intel’s OSPRay via their Hydra delegate. However, I’m not sure if that’s just a limitation of their implementation or if it’s because there is a different, non-legacy setting that hdOSPRay is using instead.

It’s on my todo list to investigate that.

This works! Thanks a lot! Hope it will continue working even though it’s marked as deprecated…

1 Like

Awesome! Glad that it worked for you! :slight_smile:

Just one note regarding usdview. It is using the same commands to set the domelightvisibility as @thayer mentioned.

You can also set it through the renderparams that is past to the Render function.

@denglesson, thank you for pointing out the self._renderParams.domeLightCameraVisibility = self._dataModel.viewSettings.domeLightTexturesVisible statement in usdviewq/stageView.py. I had not found that when searching around before.

But a weird thing about self._renderParams.domeLightCameraVisibility is that I cannot find a corresponding C++ class member in UsdImagingGLRenderParams. And I’m not familiar enough with the Python to C++ bindings to know if it could be handled specially somewhere.

Yes, I was going to say that c++ params struct doesn’t have this field. I was looking for it before and couldn’t find it.

1 Like

Hmm yeah that looks like it is not doing anything with self._renderParams.domeLightCameraVisibility actually :confused:

But the domeLightCameraVisibility in the RenderSettings is used :slight_smile: OpenUSD/pxr/usdImaging/usdImagingGL/engine.cpp at v24.08 · PixarAnimationStudios/OpenUSD · GitHub

The only thing I have noticed is that it works with Metal renderer, but doesn’t have an effect on Windows with OpenGL using UsdImagingGLEngine.