Version of Sunshafts With Volumetric Fog Added

Does anyone know of a variation of the Unity Sunshafts script / shader which adds volumetric fog? I suppose I could make my own but I don’t have time to reinvent the wheel if there’s existing code. Several searches didn’t find any.

You might can check out Unity’s versions that came from the Adam Demo.
It has Volume Fog in it.

https://github.com/Unity-Technologies/VolumetricLighting

Haven’t used it in awhile though, but its in there.

Last time I looked the readme said it didnt support directional light, but they hoped to add it soon. But I’m really not sure they will ever add it, because focus switched to volumetric lighting in HD render pipeline, and they said ‘soon’ a very long time ago. And when they needed these effects for the Book of the Dead demo, which uses HD pipeline but was developed before HD pipeline had its own volumetric fog, they chose to use a modified version of the atmospheric scattering from the blacksmith demo (I think).

Without jumping to the new HD render pipeline, which is a big switch, most people have tended to use 3rd party solutions. There are quite a lot to choose from on the asset store, all with slightly different features and results.

The one called Aura might be an obvious one to try, because it is available for free ( https://discussions.unity.com/t/693492 )

Also I suppose I should point out that its the volumetric fog itself that does the sunshafts/godrays in these sorts of assets, they do not sit on top of the old unity sunshafts effect, that effect is obsolete when these systems are used.

I’m using 5.0.1 so I doubt that will work; and it apparently doesn’t work with directional lights (which I need). I would think that the earlier sunshafts script and shader could be adapted to add fog since the effects are so similar and the default version is fast enough to add more features; so I’m surprised that someone hasn’t added fog to that yet, or at least I can’t find any code.

Proper volumetric fog that is now common these days for games and game engines (thanks in great part to the presentations on the subject by Bart Wronski probably 4 years ago now) is far more sophisticated, and using quite different techniques, than the older variety of sunshaft type effects.

But you might not even want the sophisticated type of volumetric fog that I am on about. Fog in games covers quite a multitude of different things, with different features. Some basic forms of fog would be appropriate to use in conjunction with older sunshaft efffects, but I dont know much about them really, I’m only into the modern stuff that, for example, works with both directional lights and point lights, spot lights etc.

Thats going to reduce your options terribly. I just checked the volumetric fog assets I know about on the asset store for stated version compatibility.

HX Volumetric fog is said to work with 5.1.4:

https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/hx-volumetric-lighting-67665

Aura, which I mentioned before because it is free, requires 2017.2 or higher:

https://assetstore.unity.com/packages/vfx/shaders/aura-volumetric-lighting-111664

Fog Volume 3 requires Unity 5.5.0 or higher:

https://assetstore.unity.com/packages/tools/particles-effects/fog-volume-3-81802

Volumetric Fog Beta, which I have never tried myself, requires 2017.3 or higher:

https://assetstore.unity.com/packages/vfx/shaders/directx-11/volumetric-fog-beta-68776

Volumetric Fog & Mist requires 5.3.4 or higher:

https://assetstore.unity.com/packages/vfx/shaders/fullscreen-camera-effects/volumetric-fog-mist-49858

Sky Master ULTIMATE, which I am only slightly familiar with, requires 5.1.1 or higher:

https://assetstore.unity.com/packages/tools/particles-effects/sky-master-ultimate-25357

2 Likes

^- There’s also “Vapor” from the Alloy Shader developer(s):
https://github.com/ArthurBrussee/Vapor/

Unknown, which min. Unity version that requires…

1 Like