From a54b415ab89302cf1f74f78360595ec0eff8fc7b Mon Sep 17 00:00:00 2001 From: yum Date: Tue, 20 Jan 2026 22:15:09 -0800 Subject: Push eyeVec into fragment --- glitter.cginc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'glitter.cginc') 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), -- cgit v1.2.3