Stop dividing by zero

This commit is contained in:
Andras Schmelczer 2026-06-10 21:36:13 +01:00
parent 9a06d92ed7
commit bd2307f782
5 changed files with 20 additions and 10 deletions

View file

@ -63,7 +63,7 @@ export const InvertedTunnelFactory = (
vec2 targetFromDelta = target - froms[i];
float h = dot(targetFromDelta, toFromDeltas[i])
/ dot(toFromDeltas[i], toFromDeltas[i]);
/ max(dot(toFromDeltas[i], toFromDeltas[i]), 0.00000001);
float clampedH = clamp(h, 0.0, 1.0);