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
- MotionVector Effect: Object “disappears” when paused
- [GreaseMonkey] Unity Forum Fixer
- UnityHub: Make Hub application background Translucent
- Customize SpriteShapeRenderer quality (but has issues)
- Editor tool: Copy selected gameobject’s names into clipboard as rows (for Excel)
- Editor tool: Replace string in selected gameobject’s names
- UnityHub: Enable built-in Login Dialog (no more browser login/logout issues!)
- Use TikTok-TTS in Unity (with WebRequest)
- Create Scene Thumbnail Image using OnSceneSaved & OnPreviewGUI
- webgl+javascript TTS
- Using Moonsharp (LUA) + Unity Webgl
- Using 3D gameobject prefabs with Unity Tilemap + NavMesh Surface
Recent Comments
- [Asset Store] Point Cloud Viewer & Tools on
- [Asset Store] Point Cloud Viewer & Tools on
- Vector3 maths for dummies! on
- UnityHub: Make Hub application background Translucent on
- UnityHub: Make Hub application background Translucent on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- Install Android SDK+JDK+NDK for Unity (without AndroidStudio or Unity Hub) on
- [Asset Store] Point Cloud Viewer & Tools on