diff options
| author | yum <yum.food.vr@gmail.com> | 2026-01-20 22:15:09 -0800 |
|---|---|---|
| committer | yum <yum.food.vr@gmail.com> | 2026-01-20 22:15:09 -0800 |
| commit | a54b415ab89302cf1f74f78360595ec0eff8fc7b (patch) | |
| tree | 678cd3c8076c0c8995d6e1033f401738a22c1bea /glitter.cginc | |
| parent | d24a5d839bad7ae0a9a6525f7c4d30fa0877e073 (diff) | |
Push eyeVec into fragment
Diffstat (limited to 'glitter.cginc')
| -rw-r--r-- | glitter.cginc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/glitter.cginc b/glitter.cginc index e8df133..dc353df 100644 --- a/glitter.cginc +++ b/glitter.cginc @@ -35,7 +35,7 @@ static const float2 glitter_offset_vectors[6] = { };
-float4 getGlitter(v2f i, GlitterParams params, float3 normal) {
+float4 getGlitter(v2f i, f2f f, GlitterParams params, float3 normal) {
float c_acc = 0;
[loop]
for (uint layer_i = 0; layer_i < params.layers; layer_i++) {
@@ -71,7 +71,7 @@ float4 getGlitter(v2f i, GlitterParams params, float3 normal) { c_acc = c + (1 - c) * c_acc;
}
#if defined(_GLITTER_ANGLE_LIMIT)
- float VdotN = dot(-normalize(i.eyeVec.xyz), normal);
+ float VdotN = dot(-f.viewDir, normal);
float angle_mask = smoothstep(
cos(params.angle_limit * PI),
cos(params.angle_limit * (1 - params.angle_limit_transition_width) * PI),
|
