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.glsl17
1 files changed, 11 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 b7715fbe6e..24faf1763f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
@@ -70,6 +70,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()
{
@@ -87,10 +89,10 @@ void main()
vary_fragcoord.xyz = vert.xyz + vec3(0,0,near_clip);
- 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;
@@ -135,6 +137,9 @@ 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
@@ -142,8 +147,8 @@ 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);
vertex_color = diffuse_color;
}