From 58a8aceb97dad070a80b1c0441f7baf095aeb385 Mon Sep 17 00:00:00 2001 From: huangdarwin Date: Thu, 2 Dec 2021 13:45:30 +0000 Subject: [PATCH] Transformer GL: Apply transformation_matrix to vertex position. Previously, transformation_matrix was incorrectly applied to texture sampling coordinates, which led to transformations seemingly moving in the opposite position, and an undesirable GL_CLAMP_TO_EDGE behavior when sampling outside the edge of the texture. PiperOrigin-RevId: 413653360 --- .../transformer/src/main/assets/shaders/vertex_shader.glsl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/transformer/src/main/assets/shaders/vertex_shader.glsl b/libraries/transformer/src/main/assets/shaders/vertex_shader.glsl index 993760ce29..a7057694c5 100644 --- a/libraries/transformer/src/main/assets/shaders/vertex_shader.glsl +++ b/libraries/transformer/src/main/assets/shaders/vertex_shader.glsl @@ -17,6 +17,6 @@ uniform mat4 tex_transform; uniform mat4 transformation_matrix; varying vec2 v_texcoord; void main() { - gl_Position = a_position; - v_texcoord = (transformation_matrix * tex_transform * a_texcoord).xy; + gl_Position = transformation_matrix * a_position; + v_texcoord = (tex_transform * a_texcoord).xy; }