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

Turn off direct lighting when environment maps are supplied #12027

Open
jjhembd opened this issue Jun 6, 2024 · 1 comment
Open

Turn off direct lighting when environment maps are supplied #12027

jjhembd opened this issue Jun 6, 2024 · 1 comment

Comments

@jjhembd
Copy link
Contributor

jjhembd commented Jun 6, 2024

Feature

In LightingStageFS, if image-based lighting is enabled, we currently add it to the already-computed direct lighting color. However, if users provide an environment map for lighting, they most likely expect that map to be the only light source.

The current setup can provide some surprising results. For example, here is the Clearcoat Car Paint model, with two specular reflections from the sun: one from the environment map, and one from the default Sunlight.
image

The two-sun effect can be avoided with some hacks, such as setting Scene.light to a DirectionalLight with an intensity of 0. However, this is probably non-intuitive for most users. Also, the resulting lighting is somewhat too dim, and our current imageBasedLightingFactor does not allow values greater than 1.0.

Questions for the implementation:

  • Do we still want to support the current weighted combination of direct lighting and image-based lighting?
  • How should the API be structured to switch between lighting types?
@jjhembd
Copy link
Contributor Author

jjhembd commented Jul 9, 2024

Summing the direct and IBL lighting results can also result in clipping artifacts when both light sources are near their maxima. See this image from @ggetz, as reported in #12070 (comment)
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment