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
- Testing Unity AI Beta
- Ways to Support UnityCoder Development
- Using UI Slider to Create 5-Star Rating Element
- Game Music Library For Unity (editor plugin)
- Fontastic : Easily Test Fonts in Unity Editor!
- GeoTiff Importer & Terrain Generator for Unity
- Create Baked DropShadow for UI images
- .JP2 Ortho Image Converter to PNG/JPG/TIFF
- Convert LAS/LAZ/PLY pointclouds to GLTF (GLB) Point Meshes (standalone converter)
- Detect SRP (URP or HDRP) with Assembly Definition Version Defines
- [LudumDare57] Theme: Depths
- MotionVector Effect: Object “disappears” when paused
Recent Comments
- on [Asset Store] PolygonCollider2D Optimizer
- on Trajectory Test Scene 2.0
- on Vector3 maths for dummies!
- on UnityHub 3.6.0: Remove Version Control & Cloud Dashboard columns
- on Using RenderDoc with Unity (graphics debugger)
- on UI Scroll View automatic Content height
- on [Asset Store] Point Cloud Viewer & Tools
- on [Asset Store] Point Cloud Viewer & Tools
Coin:
CUgDSbRqFcAumDSAcdKDvuXsw26VdkJe8C8WGUQHBAGS
An article by











