summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-14 10:55:50 -0500
committerDave Parks <davep@lindenlab.com>2022-09-14 10:55:50 -0500
commit379ae7eec0fddd2bfc2f7902fc05d1fabd57c28d (patch)
treeaf1948fb362ccd1f864e3ad194a541d1322d445c /indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
parent93389059d5490f4ed9550bc2b38d7973a4c73a18 (diff)
SL-17701 Per pixel binormal generation on PBR alpha to be consistent with PBR opaque.
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl61
1 files changed, 16 insertions, 45 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
index 57a162ad51..b3880ab178 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbralphaV.glsl
@@ -54,29 +54,20 @@ uniform float near_clip;
ATTRIBUTE vec3 position;
ATTRIBUTE vec4 diffuse_color;
ATTRIBUTE vec3 normal;
-ATTRIBUTE vec2 texcoord0;
-
-
-#ifdef HAS_NORMAL_MAP
ATTRIBUTE vec4 tangent;
+ATTRIBUTE vec2 texcoord0;
ATTRIBUTE vec2 texcoord1;
+ATTRIBUTE vec2 texcoord2;
-VARYING vec3 vary_mat0;
-VARYING vec3 vary_mat1;
-VARYING vec3 vary_mat2;
+VARYING vec4 vertex_color;
+VARYING vec2 vary_texcoord0;
VARYING vec2 vary_texcoord1;
-#else
+VARYING vec2 vary_texcoord2;
VARYING vec3 vary_normal;
-#endif
+VARYING vec3 vary_tangent;
+flat out float vary_sign;
-#ifdef HAS_SPECULAR_MAP
-ATTRIBUTE vec2 texcoord2;
-VARYING vec2 vary_texcoord2;
-#endif
-
-VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
void main()
{
@@ -99,41 +90,21 @@ void main()
#endif
vary_texcoord0 = (texture_matrix0 * vec4(texcoord0,0,1)).xy;
-
-#ifdef HAS_NORMAL_MAP
vary_texcoord1 = (texture_matrix0 * vec4(texcoord1,0,1)).xy;
-#endif
-
-#ifdef HAS_SPECULAR_MAP
vary_texcoord2 = (texture_matrix0 * vec4(texcoord2,0,1)).xy;
-#endif
#ifdef HAS_SKIN
- vec3 n = normalize((mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz);
- #ifdef HAS_NORMAL_MAP
- vec3 t = normalize((mat*vec4(tangent.xyz+position.xyz,1.0)).xyz-pos.xyz);
- vec3 b = cross(n, t)*tangent.w;
-
- vary_mat0 = vec3(t.x, b.x, n.x);
- vary_mat1 = vec3(t.y, b.y, n.y);
- vary_mat2 = vec3(t.z, b.z, n.z);
- #else //HAS_NORMAL_MAP
- vary_normal = n;
- #endif //HAS_NORMAL_MAP
+ vec3 n = (mat*vec4(normal.xyz+position.xyz,1.0)).xyz-pos.xyz;
+ vec3 t = (mat*vec4(tangent.xyz+position.xyz,1.0)).xyz-pos.xyz;
#else //HAS_SKIN
- vec3 n = normalize(normal_matrix * normal);
- #ifdef HAS_NORMAL_MAP
- vec3 t = normalize(normal_matrix * tangent.xyz);
- vec3 b = cross(n,t)*tangent.w;
-
- vary_mat0 = vec3(t.x, b.x, n.x);
- vary_mat1 = vec3(t.y, b.y, n.y);
- vary_mat2 = vec3(t.z, b.z, n.z);
- #else //HAS_NORMAL_MAP
- vary_normal = n;
- #endif //HAS_NORMAL_MAP
+ vec3 n = normal_matrix * normal;
+ vec3 t = normal_matrix * tangent.xyz;
#endif //HAS_SKIN
-
+
+ vary_tangent = normalize(t);
+ vary_sign = tangent.w;
+ vary_normal = normalize(n);
+
vertex_color = diffuse_color;
#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)