Skip to content

Improve Bloom 3D lighting#11981

Merged
alice-i-cecile merged 14 commits intobevyengine:mainfrom
BD103:bloom-3d
Mar 7, 2024
Merged

Improve Bloom 3D lighting#11981
alice-i-cecile merged 14 commits intobevyengine:mainfrom
BD103:bloom-3d

Conversation

@BD103
Copy link
Copy Markdown
Member

@BD103 BD103 commented Feb 19, 2024

Objective

  • With the recent lighting changes, the default configuration in the bloom_3d example is less clear what bloom actually does
  • bloom_3d additionally uses a for-loop to spawn the spheres, which can be turned into commands::spawn_batch call.
  • The text is black, which is difficult to see on the gray background.

Solution

  • Increase emmisive values of materials.
  • Set text to white.

Showcase

Before:

before

After:

image

@BD103 BD103 added A-Rendering Drawing game state to the screen C-Examples An addition or correction to our examples labels Feb 19, 2024
@mockersf mockersf added this to the 0.13.1 milestone Feb 19, 2024
@mockersf
Copy link
Copy Markdown
Member

I would prefer the default settings to be useful rather than tailoring the example

@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Feb 19, 2024

I would prefer the default settings to be useful rather than tailoring the example

BloomSettings's default is BloomSettings::NATURAL. None of the other associated constants (OLD_SCHOOL and SCREEN_BLUR) are really useful in highlighting the effects of bloom. Perhaps a new associated constant could be added with the desired effect?

impl Default for BloomSettings {
fn default() -> Self {
Self::NATURAL
}
}

@alice-i-cecile
Copy link
Copy Markdown
Member

I'm neutral on the spawn_batch change. It is harder to read, but it's also nice to demonstrate how to do nested iterators with spawn_batch. I'd probably revert it: it's not the point of the example.

@alice-i-cecile
Copy link
Copy Markdown
Member

I would prefer the default settings to be useful rather than tailoring the example

BloomSettings's default is BloomSettings::NATURAL. None of the other associated constants (OLD_SCHOOL and SCREEN_BLUR) are really useful in highlighting the effects of bloom. Perhaps a new associated constant could be added with the desired effect?

Agreed: if we want to showcase the effect, I would add a more intense associated constant, and then a mechanism to cycle through the intensities (starting with the default).

@BD103 BD103 changed the title Improve Bloom 3D screenshot and use spawn_batch Improve Bloom 3D lighting Feb 22, 2024
Co-authored-by: Alice Cecile <[email protected]>
@rparrett
Copy link
Copy Markdown
Contributor

rparrett commented Feb 25, 2024

There have been various reports of emissive materials needing much higher values to achieve the same brightness after 0.13 in general, unrelated to bloom, and the values in this example haven't been changed. I see output similar to the old output if I multiply the color values by 10.

Another option might be to use a different exposure value.

Pinging some bloom people for a look: @JMS55 @StarLederer .

@JMS55
Copy link
Copy Markdown
Contributor

JMS55 commented Feb 25, 2024

Yes, emissive values need to be higher due to exposure changes.

I multiplied the values by 10, based off of bevyengine#11981 (comment).
@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Feb 26, 2024

Updated screenshot with higher emission values:

image

I think additive is a bit too much here, and probably should be reverted to energy conserving. Thoughts?

@rparrett
Copy link
Copy Markdown
Contributor

I think additive is a bit too much here, and probably should be reverted to energy conserving. Thoughts?

My thought was that probably only changing the color values was necessary.

@BD103 BD103 marked this pull request as draft February 26, 2024 15:04
@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Feb 26, 2024

I reverted most changes except the emission bits, since that achieves the same effect.

image

Marking this as draft until I have the time to update the PR description.

@BD103 BD103 marked this pull request as ready for review February 26, 2024 17:15
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.
@rparrett rparrett added the S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it label Mar 6, 2024
@alice-i-cecile
Copy link
Copy Markdown
Member

@BD103 once you've resolved merge conflicts I'll merge this in :)

@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Mar 6, 2024

@BD103 once you've resolved merge conflicts I'll merge this in :)

Got it, I'll get this done by the end of the day!

@BD103
Copy link
Copy Markdown
Member Author

BD103 commented Mar 7, 2024

Conflicts resolved and tested :D

@alice-i-cecile alice-i-cecile added this pull request to the merge queue Mar 7, 2024
Merged via the queue into bevyengine:main with commit 713d91b Mar 7, 2024
@BD103 BD103 deleted the bloom-3d branch March 7, 2024 15:46
mockersf pushed a commit that referenced this pull request Mar 8, 2024
- With the recent lighting changes, the default configuration in the
`bloom_3d` example is less clear what bloom actually does
- See [this
screenshot](https://github.com/bevyengine/bevy-website/pull/1023/files/4fdb1455d5a3371d69db32b036e38731342b48de#r1494648414)
for a comparison.
- `bloom_3d` additionally uses a for-loop to spawn the spheres, which
can be turned into `commands::spawn_batch` call.
- The text is black, which is difficult to see on the gray background.

- Increase emmisive values of materials.
- Set text to white.

Before:

<img width="1392" alt="before"
src="https://github.com/bevyengine/bevy/assets/59022059/757057ad-ed9f-4eed-b135-8e2032fcdeb5">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/3f9dc7a8-94b2-44b9-8ac3-deef1905221b">

---------

Co-authored-by: Alice Cecile <[email protected]>
spectria-limina pushed a commit to spectria-limina/bevy that referenced this pull request Mar 9, 2024
# Objective

- With the recent lighting changes, the default configuration in the
`bloom_3d` example is less clear what bloom actually does
- See [this
screenshot](https://github.com/bevyengine/bevy-website/pull/1023/files/4fdb1455d5a3371d69db32b036e38731342b48de#r1494648414)
for a comparison.
- `bloom_3d` additionally uses a for-loop to spawn the spheres, which
can be turned into `commands::spawn_batch` call.
- The text is black, which is difficult to see on the gray background.

## Solution

- Increase emmisive values of materials.
- Set text to white.

## Showcase

Before:

<img width="1392" alt="before"
src="https://github.com/bevyengine/bevy/assets/59022059/757057ad-ed9f-4eed-b135-8e2032fcdeb5">

After:

<img width="1392" alt="image"
src="https://github.com/bevyengine/bevy/assets/59022059/3f9dc7a8-94b2-44b9-8ac3-deef1905221b">

---------

Co-authored-by: Alice Cecile <[email protected]>
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-Examples An addition or correction to our examples S-Ready-For-Final-Review This PR has been approved by the community. It's ready for a maintainer to consider merging it

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants