Skip to content

refiaa/FakeGlassShader_Unity

Repository files navigation

Realistic Volumetric Glass Shader (Unity BRP)

Working in Progress

Introduction

A physically-based glass shader designed for the Unity Built-in Render Pipeline (BRP) and VRChat environments.

This shader applies the Beer-Lambert Law to simulate physical light absorption based on the thickness of the glass. This achieves a realistic glass material where thin areas appear transparent, while thicker areas appear denser and darker.

The shader has been verified to work in Unity 2022.3.22f1, 2022.3.22f2, 2022.3.6f1 and VRChat.

Key Features

  • Instead of simple texture compositing, it calculates the distance (thickness) light travels through the glass to reproduce exponential color absorption based on depth.
  • It calculates the refractive index differences based on light wavelength to express prism-like edge details (Chromatic Aberration).

Gallery

demo.mp4
demo_rain.mp4
Thickness Visualization

Compatibility

This shader has been tested and verified in the following environments:

  • Unity Version:

    • 2022.3.22f1 (Verified)
    • 2022.3.22f2 (Verified)
    • 2022.3.6f1 (Verified)
  • Platform:

    • VRChat

About

(WIP) Realistic Volumetric Glass Shader (Unity BRP) for Unity compatible with VRChat

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors