diff options
| author | yum <yum.food.vr@gmail.com> | 2024-07-18 16:52:34 -0700 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2024-07-18 16:52:34 -0700 |
| commit | 17c5f581851799676af414ae7f35bc20b295e0b2 (patch) | |
| tree | 074ee038d82a93ffb2b7486baababf233cc6411a | |
| parent | e97073efc2c960ad2d28c0649615ef0d6b69a93b (diff) | |
Fix glitter again
Flickering got worse. Use rcp() as suggested in shader dev discord. When
I originally fixed this, I could still get away with using a normal
divide.
| -rw-r--r-- | tooner_lighting.cginc | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tooner_lighting.cginc b/tooner_lighting.cginc index 8215ea8..2040c6d 100644 --- a/tooner_lighting.cginc +++ b/tooner_lighting.cginc @@ -438,7 +438,7 @@ float get_glitter(float2 uv, float3 worldPos, // A regular divide here causes flickering. The leading guess is that NVIDIA // hardware implements the divide instruction slightly differently on // different cores. - precise float idensity = 1.0 / density; + precise float idensity = rcp(density); float glitter = rand2(floor(uv * density) * idensity); float thresh = 1 - amount / 100; |
