bevy
bevy copied to clipboard
Change light defaults & fix light examples
Objective
Fix https://github.com/bevyengine/bevy/issues/11577.
Solution
Fix the examples, add a few constants to make setting light values easier, and change the default lighting settings to be more realistic. (Now designed for an overcast day instead of an indoor environment)
I did not include any example-related changes in here.
Changelogs (not including breaking changes)
bevy_pbr
- Added
light_constsmodule (included in prelude), which contains common lux and lumen values for lights. - Added
AmbientLight::NONEconstant, which is an ambient light with a brightness of 0. - Added non-EV100 variants for
ExposureSettings's EV100 constants, which allow easier construction of anExposureSettingsfrom a EV100 constant.
Breaking changes
bevy_pbr
The several default lighting values were changed:
PointLight's defaultintensityis now2000.0SpotLight's defaultintensityis now2000.0DirectionalLight's defaultilluminanceis nowlight_consts::lux::OVERCAST_DAY(1000.)AmbientLight's defaultbrightnessis now20.0
to fix #11577, you should also change the defaults so that the default values for lights work with the default values for exposure
you should also change the defaults so that the default values for lights work with the default values for exposure
I can't really, the default camera's exposure is designed for full sunlight while the point lights act similarly to real lightbulbs. And because of that the point lights are really dim. Theres nothing I can really do to make everything look good without compromising on realism or visual quality.
you should also change the defaults so that the default values for lights work with the default values for exposure
I can't really, the default camera's exposure is designed for full sunlight while the point lights act similarly to real lightbulbs. And because of that the point lights are really dim. Theres nothing I can really do to make everything look good without compromising on realism or visual quality.
The default ExposureSettings is EV100_INDOOR, is that full sunlight?
https://github.com/bevyengine/bevy/blob/397d111ea7b4353babdf448e175c24ebad935d12/crates/bevy_render/src/camera/camera.rs#L116-L122
If the default exposure is for the full sunlight, then the default directional light should be full sunlight, and the one used in examples. otherwise we should change the default exposure to be indoor so that it works correctly with point light, and use point lights in the examples
the default for exposure and for lights should make sense together, and be used in examples
ah my bad, I just assumed it would be for full sunlight (why else would the point lights be that bright).
I do think we should use EV100_OVERCAST instead, as it's more a middleground between indoor lighting and outdoor lighting
I do think we should use
EV100_OVERCASTinstead, as it's more a middleground between indoor lighting and outdoor lighting
no strong opinion on my side, as long as the defaults make sense together 🙂
I like the overcast as a default, and agreed that we should ensure all of our default values look sensible together.
It looks like your PR is a breaking change, but you didn't provide a migration guide.
Could you add some context on what users should update when this change get released in a new version of Bevy?
It will be used to help writing the migration guide for the version. Putting it after a ## Migration Guide will help it get automatically picked up by our tooling.
For those who haven't seen it this was the reasoning behind changing the default exposure to indoors: https://github.com/bevyengine/bevy/pull/8407#issuecomment-1858836978
But in the end the default exposure is pretty much arbitrary + small effort to add ExposureSettings::INDOOR so I don't have a strong opinion there
For those who haven't seen it this was the reasoning behind changing the default exposure to indoors: #8407 (comment) But in the end the default exposure is pretty much arbitrary + small effort to add
ExposureSettings::INDOORso I don't have a strong opinion there
I like the reasoning used there, so I think I'll revert the change and use INDOOR again.
While I think this PR is a step in the right direction if I follow the steps listed here I'm not sure it actually fixes #11577. Maybe there is a deeper issue? Edit: Or the distances to the pointlights before this PR were just large
The deeper issue is that the examples are trying to use point lights as a sun, instead of a DirectionalLight. And obviously your average bulb light isn't as powerful as the sun.
What's the current state of this PR?
What's the current state of this PR?
Ready to merge I think. But I might have missed examples outside of the 3d examples. I'll check the other examples later.
I do feel like the directional lights make the examples look less appealing in general. See for example cubic_curve where the ground plane turns from a nice gradient to a single color:
I do agree with this. I think (for now) I'll revert these in most cases in the interest of render quality. Both the shadows and shading take a quality / interest-level hit.