Fix rendering material when UV2 is compressed

This commit is contained in:
BlueCube3310
2025-02-06 20:17:49 +01:00
parent f0f5319b0b
commit 8714b36171
3 changed files with 24 additions and 3 deletions

View File

@@ -713,7 +713,14 @@ void main() {
#endif
#ifdef RENDER_MATERIAL
gl_Position.xy = (uv2_attrib.xy + uv_offset) * 2.0 - 1.0;
vec2 uv_dest_attrib;
if (uv_scale != vec4(0.0)) {
uv_dest_attrib = (uv2_attrib.xy - 0.5) * uv_scale.zw;
} else {
uv_dest_attrib = uv2_attrib.xy;
}
gl_Position.xy = (uv_dest_attrib + uv_offset) * 2.0 - 1.0;
gl_Position.z = 0.00001;
gl_Position.w = 1.0;
#endif