summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-10-13 09:57:24 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-10-13 09:57:24 -0700
commit49a5b79c2b1ba5f4b909d1bfab89bb7ad9c1e888 (patch)
tree8b523f42c6c778967fa01a54db186fab1df1c520 /indra/newview/app_settings/shaders/class1/deferred
parent474923e3cb29df35e8807006ad16861eb1dc24d0 (diff)
DRTVWR-592: (WIP) Debugging, rethinking
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl7
2 files changed, 10 insertions, 0 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
index 96903aeba8..2426199056 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
@@ -33,6 +33,8 @@ uniform sampler2D alpha_ramp;
in vec3 pos;
in vec3 vary_normal;
+in vec3 vary_tangent; // TODO: Decide if we want to keep this
+flat in float vary_sign; // TODO: Decide if we want to keep this
in vec4 vary_texcoord0;
in vec4 vary_texcoord1;
@@ -53,6 +55,7 @@ void main()
outColor.a = 0.0; // yes, downstream atmospherics
frag_data[0] = outColor;
+ frag_data[0] = vec4((0.5 * (1.0 + vary_sign)) * vary_tangent.xyz, 1.0); // TODO: Remove
frag_data[1] = vec4(0.0,0.0,0.0,-1.0);
vec3 nvn = normalize(vary_normal);
frag_data[2] = vec4(encode_normal(nvn.xyz), 0.0, GBUFFER_FLAG_HAS_ATMOS);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl
index e8747a1f6b..fcc4448a80 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl
@@ -29,15 +29,20 @@ uniform mat4 modelview_projection_matrix;
in vec3 position;
in vec3 normal;
+in vec4 tangent;
in vec4 diffuse_color;
in vec2 texcoord0;
in vec2 texcoord1;
out vec3 pos;
out vec3 vary_normal;
+out vec3 vary_tangent; // TODO: Decide if we want to keep this
+flat out float vary_sign; // TODO: Decide if we want to keep this
out vec4 vary_texcoord0;
out vec4 vary_texcoord1;
+out vec4 debug_tangent; // TODO: Remove
+
uniform vec4 object_plane_s;
uniform vec4 object_plane_t;
@@ -65,6 +70,8 @@ void main()
pos = t_pos.xyz;
vary_normal = normalize(normal_matrix * normal);
+ vary_tangent = normalize(normal_matrix * tangent.xyz); // TODO: Decide if we want to keep this
+ vary_sign = tangent.w; // TODO: Decide if we want to keep this
// Transform and pass tex coords
vary_texcoord0.xy = texgen_object(vec4(position, 1.0), vec4(texcoord0,0,1), texture_matrix0, object_plane_s, object_plane_t).xy;