summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl29
1 files changed, 23 insertions, 6 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
index da27be6e7f..ee44ad874c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
@@ -64,6 +64,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;
@@ -71,6 +74,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()
{
@@ -90,10 +95,13 @@ void main()
vary_fragcoord.xyz = vert.xyz + vec3(0,0,near_clip);
#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;
@@ -135,9 +143,15 @@ 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
@@ -145,8 +159,11 @@ void main()
gl_Position = vert;
vary_position = vert.xyz;
- 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;
}