21
2019
Modified Standard shader to start fading based on Camera Y distance

Needed this kind of effect for a small game, where:
– objects below would be faded out
– player can move up and down (fade should “follow”)
– realtime lights should be supported
basically like the old unity global fog for height, but that one doesn’t work with newer unitys.. and shadergraph might have helped to create this effect, but i’m not using new render pipelines..
Source:
https://github.com/UnityCommunity/UnityLibrary/blob/master/Assets/Shaders/3D/Effects/VerticalCameraDistanceFade.shader
Without custom lighting in shader, it didn’t work, even with black ambient color, since there are lights in the scene (image below)

Related Posts
Leave a comment
Recent posts
- Adding Real World Location to Ice Fishing Prototype
- [web tool] Image Channel Inspector : AlphaScope
- Editor Tool: Smart Recompile (don’t recompile if edit comments)
- Editor Tool: Scene Size Analyzer
- LudumDare 60: Old Tech
- uBasic Scripting Language for Unity
- GreaseMonkey+Editor Plugin: 1-Click Copy script from ChatGPT (Web) to Unity Editor (as script)
- Editor Tool: Property Watcher
- .unityignore : Hide files from Project window
- PostBuild Script to Create Single exe Standalone File
- Game Loop Designer
- Favorites in PackageManager
Recent Comments
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











