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

Dim point and spot lights by the same factor as directional lights #8378

Closed
wants to merge 1 commit into from

Conversation

benny-n
Copy link

@benny-n benny-n commented Apr 13, 2023

Objective

Solution

  • Apply the 4800x dimming factor to point and spot lights as well.

Changelog

  • Point and spot lights are now 4800x dimmer.

Migration Guide

  • Users who have used point and spot lights in their projects may need to increase the strength of these lights by a factor of 4800.

Results

The PBR example without environment map lighting, before the change:
image
After the change:
image
Directional light with the same strength for comparison (copied from the issue):
image

@github-actions
Copy link
Contributor

Welcome, new contributor!

Please make sure you've read our contributing guide and we look forward to reviewing your pull request shortly ✨

@mockersf
Copy link
Member

mockersf commented Apr 13, 2023

You should fix the example so that it still displays the same.

In this case, that would mean setting the point light to an intensity of 600_000 * 4_800 = 2_880_000_000 lumens which feels very wrong... maybe this is the wrong fix?

@mockersf mockersf added the A-Rendering Drawing game state to the screen label Apr 13, 2023
@fintelia
Copy link
Contributor

fintelia commented Apr 14, 2023

The problem is that Bevy lacks automatic exposure. Right now scenes with only directional lights have a manual exposure set to EV=12 while scenes with only point and spot light have an EV=0. That produces a "fake automatic exposure". But if you start mixing directional lights and point lights then you discover that they're using different scales and no single EV value describes what you see.

This PR changes everything to use an EV=12 which is appropriate for an overcast outdoor scene, but is immediately going to cause issues for any indoor scene. It isn't particularly surprising that you need an outrageously strong light bulb to seem as bright as the sun, especially in this case where you've got only a single light and it is 86 meters away from the subjects being illuminated!

@benny-n
Copy link
Author

benny-n commented Apr 15, 2023

So should I proceed with fixing the PBR example (by increasing the point light's strength) or are we seeking a different solution?

@mockersf
Copy link
Member

All examples with a (point|spot)light will need to be fixed, not just the pbr one...

And the fix is probably not going to be "just multiply the light intensity", but checking what's the purpose of the light... For example, in the pbr example it may make more sense to replace it with a directional light.

Sorry, no definitive answer for you, I don't know about light enough so I'll trust @fintelia or other rendering people about that, but all the examples should display more or less the same, and without ridiculously high values.

@alice-i-cecile alice-i-cecile added C-Bug An unexpected or incorrect behavior C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide X-Controversial There is active debate or serious implications around merging this PR labels Apr 15, 2023
@alice-i-cecile
Copy link
Member

Closing in favor of a more complete fix in #8407.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Rendering Drawing game state to the screen C-Breaking-Change A breaking change to Bevy's public API that needs to be noted in a migration guide C-Bug An unexpected or incorrect behavior X-Controversial There is active debate or serious implications around merging this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Directional lights are 4800x dimmer than point lights and spot lights
4 participants