1
0
Fork 0

Prevent a device by zero.

This commit is contained in:
Erik Hofman 2011-07-16 15:49:31 +02:00
parent 095e535082
commit 9c69635df9
3 changed files with 3 additions and 0 deletions

Binary file not shown.

Binary file not shown.

View file

@ -68,6 +68,9 @@ void main (void)
vec3 V = normalize(ecPosition.xyz);
float a = dot(VNormal, -V);
vec2 s = vec2(dot(V, VTangent), dot(V, VBinormal));
// prevent a device by zero
if (a > -1e-3 && a < 1e-3) a = 1e3;
s *= depth_factor / a;
ds = s;
dp = gl_TexCoord[0].st;