summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2022-09-09 20:56:22 -0500
committerDave Parks <davep@lindenlab.com>2022-09-09 20:56:22 -0500
commitc822da9fe644e4a420caabb30a25b487ce75c099 (patch)
tree7d06f66a46c62dc5bbcf6cccbab8acfca552fdab /indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
parentdfe19c257dbb9d5af6f1e2961015e95847525412 (diff)
SL-18095 WIP -- Allow mikktspace generator to add more vertices (skip re-welding step for now).
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl77
1 files changed, 12 insertions, 65 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
index e17d91af38..c90a17993f 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueV.glsl
@@ -37,41 +37,24 @@ uniform mat3 normal_matrix;
uniform mat4 modelview_projection_matrix;
#endif
-#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
-
-#if !defined(HAS_SKIN)
-uniform mat4 modelview_matrix;
-#endif
-
-VARYING vec3 vary_position;
-
-#endif
-
uniform mat4 texture_matrix0;
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 vec2 vary_texcoord0;
VARYING vec2 vary_texcoord1;
-#endif
-
-#ifdef HAS_SPECULAR_MAP
-ATTRIBUTE vec2 texcoord2;
VARYING vec2 vary_texcoord2;
-#endif
VARYING vec4 vertex_color;
-VARYING vec2 vary_texcoord0;
+
VARYING vec3 vary_tangent;
flat out float vary_sign;
-
VARYING vec3 vary_normal;
void main()
@@ -83,64 +66,28 @@ void main()
vec3 pos = (mat*vec4(position.xyz,1.0)).xyz;
-#if (DIFFUSE_ALPHA_MODE == DIFFUSE_ALPHA_MODE_BLEND)
- vary_position = pos;
-#endif
-
gl_Position = projection_matrix*vec4(pos,1.0);
#else
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
-
#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);
- vary_tangent = t;
- vary_sign = tangent.w;
- vary_normal = n;
+ vec3 n = normal_matrix * normal;
+ vec3 t = normal_matrix * tangent.xyz;
+#endif
- //vec3 b = cross(n,t)*tangent.w;
- //vec3 t = cross(b,n) * binormal.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
-#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)
-#if !defined(HAS_SKIN)
- vary_position = (modelview_matrix*vec4(position.xyz, 1.0)).xyz;
-#endif
-#endif
}