summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
diff options
context:
space:
mode:
authorcosmic-linden <111533034+cosmic-linden@users.noreply.github.com>2023-02-24 11:41:04 -0800
committerGitHub <noreply@github.com>2023-02-24 11:41:04 -0800
commit5aa568f3a206d027894ad1edf1d1025136207bc2 (patch)
tree6efd659b40251b5170e81e8f3fe549a7d3c78382 /indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
parent63ae47d8fd479a3cb05ff1d2364d683975e1b052 (diff)
parenta7ecfc9b1907d6ecd5fe50aeb1c41e38540b2665 (diff)
Merge pull request #89 from secondlife/SL-19228
SL-19228: Fix GLTF texture transform rotation + add UV debug
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl18
1 files changed, 11 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
index 8320640e42..f0e3d4f034 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
@@ -60,6 +60,8 @@ out vec3 vary_tangent;
flat out float vary_sign;
out vec3 vary_normal;
+vec2 texture_transform(vec2 vertex_texcoord, mat3 khr_gltf_transform, mat4 sl_animation_transform);
+
void main()
{
#ifdef HAS_SKIN
@@ -75,11 +77,11 @@ void main()
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
#endif
-
- basecolor_texcoord = (texture_matrix0 * vec4(texture_basecolor_matrix * vec3(texcoord0,1), 1)).xy;
- normal_texcoord = (texture_matrix0 * vec4(texture_normal_matrix * vec3(texcoord0,1), 1)).xy;
- metallic_roughness_texcoord = (texture_matrix0 * vec4(texture_metallic_roughness_matrix * vec3(texcoord0,1), 1)).xy;
- emissive_texcoord = (texture_matrix0 * vec4(texture_emissive_matrix * vec3(texcoord0,1), 1)).xy;
+
+ basecolor_texcoord = texture_transform(texcoord0, texture_basecolor_matrix, texture_matrix0);
+ normal_texcoord = texture_transform(texcoord0, texture_normal_matrix, texture_matrix0);
+ metallic_roughness_texcoord = texture_transform(texcoord0, texture_metallic_roughness_matrix, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_matrix, texture_matrix0);
#ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
@@ -118,13 +120,15 @@ out vec2 emissive_texcoord;
out vec4 vertex_color;
+vec2 texture_transform(vec2 vertex_texcoord, mat3 khr_gltf_transform, mat4 sl_animation_transform);
+
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- basecolor_texcoord = (texture_matrix0 * vec4(texture_basecolor_matrix * vec3(texcoord0,1), 1)).xy;
- emissive_texcoord = (texture_matrix0 * vec4(texture_emissive_matrix * vec3(texcoord0,1), 1)).xy;
+ basecolor_texcoord = texture_transform(texcoord0, texture_basecolor_matrix, texture_matrix0);
+ emissive_texcoord = texture_transform(texcoord0, texture_emissive_matrix, texture_matrix0);
vertex_color = diffuse_color;
}