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

New Exposure and Lighting Defaults (and calibrate examples) #11868

Merged
merged 9 commits into from
Feb 15, 2024

Conversation

cart
Copy link
Member

@cart cart commented Feb 15, 2024

Objective

After adding configurable exposure, we set the default ev100 value to 7 (indoor). This brought us out of sync with Blender's configuration and defaults. This PR changes the default to 9.7 (bright indoor or very overcast outdoors), as I calibrated in #11577. This feels like a very reasonable default.

The other changes generally center around tweaking Bevy's lighting defaults and examples to play nicely with this number, alongside a few other tweaks and improvements.

Note that for artistic reasons I have reverted some examples, which changed to directional lights in #11581, back to point lights.

Fixes #11577


Changelog

  • Changed Exposure::ev100 from 7 to 9.7 to better match Blender
  • Renamed ExposureSettings to Exposure
  • Camera3dBundle now includes Exposure for discoverability
  • Bumped FULL_DAYLIGHT and DIRECT_SUNLIGHT to represent the middle-to-top of those ranges instead of near the bottom
  • Added new AMBIENT_DAYLIGHT constant and set that as the new DirectionalLight default illuminance.
  • PointLight and SpotLight now have a default intensity of 1,000,000 lumens. This makes them actually useful in the context of the new "semi-outdoor" exposure and puts them in the "cinema lighting" category instead of the "common household light" category. They are also reasonably close to the Blender default.
  • AmbientLight default has been bumped from 20 to 80.

Migration Guide

  • The increased Exposure::ev100 means that all existing 3D lighting will need to be adjusted to match (DirectionalLights, PointLights, SpotLights, EnvironmentMapLights, etc). Or alternatively, you can adjust the Exposure::ev100 on your cameras to work nicely with your current lighting values. If you are currently relying on default intensity values, you might need to change the intensity to achieve the same effect. Note that in Bevy 0.12, point/spot lights had a different hard coded ev100 value than directional lights. In Bevy 0.13, they use the same ev100, so if you have both in your scene, the scale between these light types has changed and you will likely need to adjust one or both of them.

@cart cart added the A-Rendering Drawing game state to the screen label Feb 15, 2024
@cart cart added this to the 0.13 milestone Feb 15, 2024
@superdump
Copy link
Contributor

Maybe worth noting as @fintelia wrote on discord that a the exposure was configurable, point/spot lights had one ev100 value and directional had another, so when using a combination of point/spot and directional lights in a scene you can’t just adjust the ev100 to achieve the old behaviour, you would have to adjust either all lights, or the ev100 and some lights.

Copy link
Contributor

@doonv doonv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Using Blender's default makes sense.

Copy link
Contributor

@superdump superdump left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code-wise it all looks fine. The reasoning behind the changes and new defaults is fine.

I do think we should clearly note how things worked before and how they work now to help people migrate their configurations and to think in the new way. Maybe that was done in the PR that introduced exposure.

Copy link
Contributor

@GitGhillie GitGhillie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO the ambient light is generally too dark with this PR. Easiest to see in animated_fox but it's also in simple examples like 3d_scene.
0.12 vs this PR:
image

examples/window/screenshot.rs Show resolved Hide resolved
@GitGhillie
Copy link
Contributor

Alien_cake_addict is also looking a bit grim

@rparrett
Copy link
Contributor

Some notes on examples not mentioned yet:

custom_skinned_mesh - more ambient light?
gltf_skinned_mesh - more ambient light?
spotlight - more ambient light?
post_processing - too bright
resizing - super dim
minimising - super dim

@cart
Copy link
Member Author

cart commented Feb 15, 2024

Maybe worth noting as @fintelia wrote on discord that a the exposure was configurable, point/spot lights had one ev100 value and directional had another, so when using a combination of point/spot and directional lights in a scene you can’t just adjust the ev100 to achieve the old behaviour, you would have to adjust either all lights, or the ev100 and some lights.

Good call. Added to the migration guide.

@cart
Copy link
Member Author

cart commented Feb 15, 2024

Tweaked everything as suggested and bumped up the default AmbientLight intensity slightly (enough for it to more clearly register while still being reasonably subtle)

Copy link
Contributor

@GitGhillie GitGhillie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cart cart added this pull request to the merge queue Feb 15, 2024
Merged via the queue into bevyengine:main with commit dd619a1 Feb 15, 2024
23 checks passed
FraserLee added a commit to vertesians/bevy_sprite3d that referenced this pull request Feb 26, 2024
github-merge-queue bot pushed a commit that referenced this pull request Feb 26, 2024
# Objective

- #11868 changed the lighting system, forcing lights to increase their
intensity. The PR fixed most examples, but missed a few. These I later
caught in bevyengine/bevy-website#1023.
- Related: #11982, #11981.
- While there, I noticed that the spotlight example could use a few easy
improvements.

## Solution

- Increase lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh`.
- Improve spotlight example.
- Make ground plane move with cubes, so they don't phase into each
other.
  - Batch spawn cubes.
  - Add controls text.
  - Change controls to allow rotating around spotlights.

## Showcase

### Skybox

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/8ba00d74-6d68-4414-97a8-28afb8305570">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/ad15c471-6979-4dda-9889-9189136d8404">

### Spotlight

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/53f966de-acf3-46b8-8299-0005c4cb8da0">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/05c73c1e-0739-4226-83d6-e4249a9105e0">

### Animated Transform

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/6d7d4ea0-e22e-42a5-9905-ea1731d474cf">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/f1ee08d6-d17a-4391-91a6-d903b9fbdc3c">

### gLTF Skinned Mesh

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/547569a6-d13b-4fe0-a8c1-e11f02c4f9a2">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/34517aba-09e4-4e9b-982a-a4a8b893c48a">

---

## Changelog

- Increased lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh` examples.
- Improved usability of `spotlight` example.
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
# Objective

- bevyengine#11868 changed the lighting system, forcing lights to increase their
intensity. The PR fixed most examples, but missed a few. These I later
caught in bevyengine/bevy-website#1023.
- Related: bevyengine#11982, bevyengine#11981.
- While there, I noticed that the spotlight example could use a few easy
improvements.

## Solution

- Increase lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh`.
- Improve spotlight example.
- Make ground plane move with cubes, so they don't phase into each
other.
  - Batch spawn cubes.
  - Add controls text.
  - Change controls to allow rotating around spotlights.

## Showcase

### Skybox

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/8ba00d74-6d68-4414-97a8-28afb8305570">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/ad15c471-6979-4dda-9889-9189136d8404">

### Spotlight

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/53f966de-acf3-46b8-8299-0005c4cb8da0">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/05c73c1e-0739-4226-83d6-e4249a9105e0">

### Animated Transform

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/6d7d4ea0-e22e-42a5-9905-ea1731d474cf">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/f1ee08d6-d17a-4391-91a6-d903b9fbdc3c">

### gLTF Skinned Mesh

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/547569a6-d13b-4fe0-a8c1-e11f02c4f9a2">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/34517aba-09e4-4e9b-982a-a4a8b893c48a">

---

## Changelog

- Increased lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh` examples.
- Improved usability of `spotlight` example.
msvbg pushed a commit to msvbg/bevy that referenced this pull request Feb 26, 2024
# Objective

- bevyengine#11868 changed the lighting system, forcing lights to increase their
intensity. The PR fixed most examples, but missed a few. These I later
caught in bevyengine/bevy-website#1023.
- Related: bevyengine#11982, bevyengine#11981.
- While there, I noticed that the spotlight example could use a few easy
improvements.

## Solution

- Increase lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh`.
- Improve spotlight example.
- Make ground plane move with cubes, so they don't phase into each
other.
  - Batch spawn cubes.
  - Add controls text.
  - Change controls to allow rotating around spotlights.

## Showcase

### Skybox

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/8ba00d74-6d68-4414-97a8-28afb8305570">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/ad15c471-6979-4dda-9889-9189136d8404">

### Spotlight

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/53f966de-acf3-46b8-8299-0005c4cb8da0">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/05c73c1e-0739-4226-83d6-e4249a9105e0">

### Animated Transform

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/6d7d4ea0-e22e-42a5-9905-ea1731d474cf">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/f1ee08d6-d17a-4391-91a6-d903b9fbdc3c">

### gLTF Skinned Mesh

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/547569a6-d13b-4fe0-a8c1-e11f02c4f9a2">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/34517aba-09e4-4e9b-982a-a4a8b893c48a">

---

## Changelog

- Increased lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh` examples.
- Improved usability of `spotlight` example.
mockersf pushed a commit that referenced this pull request Feb 27, 2024
- #11868 changed the lighting system, forcing lights to increase their
intensity. The PR fixed most examples, but missed a few. These I later
caught in bevyengine/bevy-website#1023.
- Related: #11982, #11981.
- While there, I noticed that the spotlight example could use a few easy
improvements.

- Increase lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh`.
- Improve spotlight example.
- Make ground plane move with cubes, so they don't phase into each
other.
  - Batch spawn cubes.
  - Add controls text.
  - Change controls to allow rotating around spotlights.

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/8ba00d74-6d68-4414-97a8-28afb8305570">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/ad15c471-6979-4dda-9889-9189136d8404">

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/53f966de-acf3-46b8-8299-0005c4cb8da0">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/05c73c1e-0739-4226-83d6-e4249a9105e0">

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/6d7d4ea0-e22e-42a5-9905-ea1731d474cf">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/f1ee08d6-d17a-4391-91a6-d903b9fbdc3c">

Before:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/547569a6-d13b-4fe0-a8c1-e11f02c4f9a2">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/34517aba-09e4-4e9b-982a-a4a8b893c48a">

---

- Increased lighting in `skybox`, `spotlight`, `animated_transform`, and
`gltf_skinned_mesh` examples.
- Improved usability of `spotlight` example.
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

default point lights seems wrong after exposure
6 participants