The white sphere is there to show that bright pixels in the foreground don’t bleed into the background (which is what happens if you use regular bloom). With actual bloom added on top of that this is the final result:
It has a fancy name but it’s basically a DOF effect. Only issue right now is that transparent objects don’t work well with it, something to do with not being able to write their values to the depth buffer I guess. Other than that it looks great, just add it after fog in the camera stack:
I just tried it in my project and it looks lovely, though when I build the game it seems to freeze the rendering, it works fine in the Editor but not in a standalone build for some reason.
Just tried this out, but for some reason it isn’t having any visual effect. No errors, and changing any of the properties, order in the fx stack, on, off, etc all make no difference at all.
Another benefit is that alpha blended particles no longer look like crap. OK, sometimes they do.
I should have mentioned this earlier but it only works properly on Deferred. In Forward the vertical UV coordinates are flipped so that causes some problems.
Included in the package are the SSMS files and modified versions of GlobalFog.cs and GlobalFog.shader. They need other components from the “Effects” package from the Standard Effects so make sure you have those imported beforehand.
I also uploaded a very basic project (tested on 5.5) that shows how to set it up.
Very nice change, though I am getting a difference in the fog from the standard GlobalFog and your modified version which makes it unusable in my case which is a shame as it looks lovely.
What difference are you getting? For some reason when you import the updated Global fog script the shader becomes unassigned. Maybe that’s the problem?
Another update: to avoid conflicts with the Standard Assets I copied the fog effect into another file . I also changed file names so this time in order to update:
Copy your settings for fog and SSMS.
Remove them from the camera.
Delete the SSMS folder.
Import the package.
Add the effects back (SSMS Global Fog and SSMS).
The downsides of ad-hoc coding . I promise next updates will be more straightforward.
The new feature is energy loss. The idea being that depending on what the fog is made of some light will be absorbed by it so the image that reaches the eye/camera is much darker. To simulate this the pixels behind the fog are darkened based on its density. This doesn’t affect the fog color.
This is looks great, Thanks for sharing.
Btw i think it would be easier to distribute update by using a repo for this.
It seems you keep having trouble doing update
In the new version I have to manually enable and disable the SSMS before it starts working. If I enable it in a start function, that also doesn’t work. Is it waiting for something else to initialize?
The latest version requires SSMS Global Fog to be in the camera stack, before SSMS itself since it creates the necessary fog rendertexture to calculate how blurry each part of the screen should be.