summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl30
1 files changed, 23 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..aeb6b85e12 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
@@ -53,6 +53,9 @@ out vec2 basecolor_texcoord;
out vec2 normal_texcoord;
out vec2 metallic_roughness_texcoord;
out vec2 emissive_texcoord;
+#if DEBUG_TEXCOORD
+out vec2 original_texcoord;
+#endif
out vec4 vertex_color;
@@ -60,6 +63,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 +80,14 @@ 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);
+#if DEBUG_TEXCOORD
+ original_texcoord = texcoord0;
+#endif
#ifdef HAS_SKIN
vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
@@ -115,16 +123,24 @@ in vec2 texcoord0;
out vec2 basecolor_texcoord;
out vec2 emissive_texcoord;
+#if DEBUG_TEXCOORD
+out vec2 original_texcoord;
+#endif
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);
+#if DEBUG_TEXCOORD
+ original_texcoord = texcoord0;
+#endif
vertex_color = diffuse_color;
}