You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-08 12:40:44 +00:00
Sanitize tangents when creating mesh surfaces to avoid triggering the compressed mesh path in the shader
This commit is contained in:
@@ -208,6 +208,11 @@ void ImmediateMesh::surface_end() {
|
||||
uint32_t value = 0;
|
||||
value |= (uint16_t)CLAMP(t.x * 65535, 0, 65535);
|
||||
value |= (uint16_t)CLAMP(t.y * 65535, 0, 65535) << 16;
|
||||
if (value == 4294901760) {
|
||||
// (1, 1) and (0, 1) decode to the same value, but (0, 1) messes with our compression detection.
|
||||
// So we sanitize here.
|
||||
value = 4294967295;
|
||||
}
|
||||
|
||||
*tangent = value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user