Facepunch / sbox-issues

175 stars 12 forks source link

Envmap Update OnEnabled Inconsistency #6350

Open Jammie3d opened 2 months ago

Jammie3d commented 2 months ago

Describe the bug

I have a scene with a dynamic envmap that's set to update OnEnabled. When you first open the scene the lighting will be dim, if you toggle "Render Dynamically" off and on or move the envmap then it will become brighter.

When you press play it goes back to the dim lighting, but when you set the envmap to update each frame and press play it's bright.

I've also experienced the play mode lighting being different to the lighting when first opening the scene. In that case the play mode lighting looked more correct, video shown below.

To Reproduce

  1. Download my_project.zip
  2. Open scenes/minimal.scene
  3. Toggle "Render Dynamically" on the Envmap Probe

Expected behavior

The OnEnabled lighting should be similar to the other update strategies, and toggling it should give consistent results.

Media/Files

Repro Project: my_project.zip

Video Example:

https://github.com/user-attachments/assets/fa1be6e8-107a-4bbe-9f26-eaccce60e588

Additional context

No response

aylaylay commented 2 months ago

The repro project doesn't include what's shown in your video?

Jammie3d commented 2 months ago

Yeah I tried reproducing that one in a new project but I couldn't for some reason, I'll try again and just send the whole project if I can't.

Jammie3d commented 2 months ago

The scene that gets loaded when you first open the editor seems to matter.

If you open this project and it loads up minimal.scene for you, switching to bathroom.scene will show the same behavior as the video.

If you open the project and bathroom.scene gets loaded first then the lighting will match how it is in play mode.

my_project2.zip

aylaylay commented 2 months ago

The envmaps in this repro are just totally fucked for me

https://github.com/user-attachments/assets/fcdcfbbe-f50f-47a1-812a-6abd1dd7c00a

aylaylay commented 2 months ago

@samzanemesis

Nolankicks commented 2 months ago

I get this too. It happens in some projects but not others.

samzanemesis commented 2 months ago

OnEnabled takes only the first sample capture, other strategies accumulate light bounces over time, so the light brightness is correct behavior, I could add an option to specify a number of samples in that case

In your scene, it's being captured before the map has been loaded, they should be updated when a map is loaded, I'll get it done

Regarding the fucked flickering, I'll boot up my AMD card and see

Jammie3d commented 2 months ago

Multi bounce is working great, thanks!

However, when changing scenes in the editor it seems like the captures still arent being updated.