Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,13 @@ export default /* glsl */`

float scale = sign( st1.t * st0.s - st0.t * st1.s ); // we do not care about the magnitude

// This avoids NaNs with degenerate UV coordinates
if ( scale == 0.0 ) {

return normalize( surf_norm );

}

vec3 S = normalize( ( q0 * st1.t - q1 * st0.t ) * scale );
vec3 T = normalize( ( - q0 * st1.s + q1 * st0.s ) * scale );
vec3 N = normalize( surf_norm );
Expand Down