Skip to content

Commit a596178

Browse files
committed
Merge pull request #117401 from Gaktan/fix-skeleton-oct-encoding
Fix Tangent decoding detection when computing vertex skinning
2 parents fb17724 + c05c855 commit a596178

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

servers/rendering/renderer_rd/shaders/skeleton.glsl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,13 @@ uint encode_tang_to_uint_oct(vec4 base) {
110110
// Encode binormal sign in y component
111111
oct.y = oct.y * 0.5f + 0.5f;
112112
oct.y = base.w >= 0.0f ? oct.y : 1 - oct.y;
113+
114+
if (oct.x == 0.0 && oct.y == 1.0) {
115+
// (1, 1) and (0, 1) decode to the same value, but (0, 1) messes with our compression detection.
116+
// So we sanitize here.
117+
oct.x = 1.0;
118+
}
119+
113120
return vec2_to_uint(oct);
114121
}
115122

0 commit comments

Comments
 (0)