(end lightning) add missing normalize()

This commit is contained in:
Xonk
2026-08-17 23:37:03 -04:00
parent e8e06e9bdc
commit b11574dda5
+2 -1
View File
@@ -434,7 +434,8 @@ gl_FragData[0].rgb = clamp(mix(frameHistory, currentFrame, clamp(mixhistory,0.0,
vec3 randomDir = normalize(randomPosXYZ.xyz);
// guide the bolt back to the origin with randomized jagged movement.
float heuristic = clamp(dot(-randomDir,PrevPos),-1.0,1.0) * (1.0-clamp(10.0-travelledDist,0.0,1.0));
float heuristic = clamp(dot(-randomDir,normalize(PrevPos)),-1.0,1.0) * (1.0-clamp(10.0-travelledDist,0.0,1.0));
float rate = frameTime*500.0;
vec3 CurrPos = PrevPos + randomDir * rate * heuristic;