Prevent a device by zero.
This commit is contained in:
parent
095e535082
commit
9c69635df9
3 changed files with 3 additions and 0 deletions
Binary file not shown.
Binary file not shown.
|
@ -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;
|
||||
|
|
Loading…
Add table
Reference in a new issue