Skip to content

Use non-volumetric fog in WorldEnvironment sky reflections #107958

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Kaleb-Reid
Copy link
Contributor

@Kaleb-Reid Kaleb-Reid commented Jun 25, 2025

Fog is now calculated in sky reflections for the WorldEnvironment, where it previously wasn't.

Screenshots have a default ProceduralSkyMaterial set in the WorldEnvironment, and the sphere's material has metallic == 1.0 and roughness == 0.0.

4.5 beta 1:
image

This pr:
image

If you test this in the editor the redraws with the new reflections after updating a fog property don't happen until something else causes a redraw sometimes and I'm not sure why. I couldn't get this to happen in the running project but I'm pretty sure I've had this issue with something not redrawing in the editor previously so I'm not sure it's this pr that is at fault.

Closes #107925.

@Kaleb-Reid Kaleb-Reid requested a review from a team as a code owner June 25, 2025 00:45
@akien-mga akien-mga added this to the 4.x milestone Jun 25, 2025
@jcostello
Copy link
Contributor

Before comparison?

@Kaleb-Reid
Copy link
Contributor Author

@jcostello Updated with a before screenshot.

@jcostello
Copy link
Contributor

Looks great

@Kaleb-Reid Kaleb-Reid force-pushed the environment-reflection-fog branch from 3695ea7 to 96ee460 Compare June 25, 2025 06:02
@jcostello
Copy link
Contributor

I got 3 issues:

Doesn't work while playing:
Screenshot from 2025-06-25 10-16-04

I got this weird looking issue:
Screenshot from 2025-06-25 10-16-14

Doesn't work with reflection probes:
Screenshot from 2025-06-25 10-16-25

MRP:
https://drive.google.com/file/d/1DppqQ9wFVLnbJdl0JjKpa8Y-g67jZE3L/view?usp=sharing

@Kaleb-Reid
Copy link
Contributor Author

Kaleb-Reid commented Jun 25, 2025

@jcostello In this pr I was trying to make the WorldEnvironment sky reflections match the sky reflections when using a ReflectionProbe. ReflectionProbes already use regular fog but not volumetric fog from what I can tell. Issue 1 is because the reflections don't update when you change volumetric fog settings. Issue 2 is because I accidentally enabled volumetric fog in the reflections without any other changes which I wasn't intending on adding with this pr. For issue 3 I don't think I changed the behaviour of ReflectionProbes with this pr, their update mode is set to "once" in the mrp and so they don't change when you modify the fog.

At this point I might try to make the volumetric fog work though.

EDIT:
Now that I think of it volumetric fog in the reflections would definitely be out of the scope of this pr and is much more complicated. It samples a 3d froxel buffer which I think is per-camera and so the sky gets this colour by getting the values at the far end of the buffer whereas regular fog just colours the sky based on colour, energy, etc.

@Kaleb-Reid Kaleb-Reid force-pushed the environment-reflection-fog branch from 96ee460 to 550bdf3 Compare June 25, 2025 19:54
@Kaleb-Reid Kaleb-Reid changed the title Use fog in WorldEnvironment sky reflections Use non-volumetric fog in WorldEnvironment sky reflections Jun 25, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fog doesn't affect background or sky reflections
4 participants