summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2023-10-13 10:38:48 -0700
committerCosmic Linden <cosmic@lindenlab.com>2023-10-13 10:38:48 -0700
commit35d889f7af9686b79fe0e5255121a444a044beab (patch)
tree957faaf5ba58c0ed392fd62b8d33d561158bcbf7 /indra/newview/app_settings/shaders
parentb9ba57fd0004751dfbcbea90264a6e16c5849e5e (diff)
DRTVWR-592: Create separate config option for terrain repeats. Clean up debug
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl21
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl12
2 files changed, 2 insertions, 31 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
index 5f94855963..e6261ca85e 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
@@ -70,7 +70,6 @@ vec2 encode_normal(vec3 n);
vec3 linear_to_srgb(vec3 c);
vec3 srgb_to_linear(vec3 c);
-in vec4 debug_pos; // TODO: Remove
// *TODO: This mixing function feels like it can be optimized. The terrain code's use of texcoord1 is dubious. It feels like the same thing can be accomplished with less memory bandwidth by calculating the offsets on-the-fly
float terrain_mix(vec4 samples, float alpha1, float alpha2, float alphaFinal)
{
@@ -150,7 +149,6 @@ vec3 sample_and_mix_vector3_no_scale(float alpha1, float alpha2, float alphaFina
void main()
{
vec2 terrain_texcoord = vary_texcoord0.xy;
- terrain_texcoord -= vec2(21.0);// TODO: Remove
float alpha1 = texture(alpha_ramp, vary_texcoord0.zw).a;
float alpha2 = texture(alpha_ramp,vary_texcoord1.xy).a;
float alphaFinal = texture(alpha_ramp, vary_texcoord1.zw).a;
@@ -162,25 +160,6 @@ void main()
discard;
}
- // TODO: Remove all of this
- float debug_pos_x = debug_pos.x;
- //float debug_pos_x = terrain_texcoord.y;
- float debug_metric = debug_pos_x;
- debug_metric = debug_metric - floor(debug_metric);
- debug_metric *= debug_metric;
- float debug_metric2 = debug_pos_x / 4.0;
- debug_metric2 = debug_metric2 - floor(debug_metric2);
- debug_metric2 *= debug_metric2;
- debug_metric2 *= debug_metric2;
- debug_metric2 *= 16.0;
- float debug_metric3 = debug_pos_x / 16.0;
- debug_metric3 = debug_metric3 - floor(debug_metric3);
- debug_metric3 *= debug_metric3;
- debug_metric3 *= debug_metric3;
- debug_metric3 *= debug_metric3;
- debug_metric3 *= 16.0;
- //col.xyz = vec3(debug_metric3, debug_metric2, debug_metric);// TODO: Remove
-
vec3 normal_texture = sample_and_mix_vector3_no_scale(alpha1, alpha2, alphaFinal, terrain_texcoord, detail_0_normal, detail_1_normal, detail_2_normal, detail_3_normal);
vec3[4] orm_factors;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl
index fd80d1bb2c..1653cc1a90 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainV.glsl
@@ -52,18 +52,15 @@ vec4 texgen_object_pbr(vec4 tc, mat4 mat, vec4 tp0, vec4 tp1)
tcoord.z = tcoord.z;
tcoord.w = tcoord.w;
- tcoord = mat * tcoord;
+ tcoord = mat * tcoord;
return tcoord;
}
-out vec4 debug_pos; // TODO: Remove
-
void main()
{
//transform vertex
gl_Position = modelview_projection_matrix * vec4(position.xyz, 1.0);
- debug_pos = vec4(texcoord0, 0.0, 1.0);
vec3 n = normal_matrix * normal;
vec3 t = normal_matrix * tangent.xyz;
@@ -71,15 +68,10 @@ void main()
vary_tangent = normalize(t);
vary_sign = tangent.w;
vary_normal = normalize(n);
-
+
// Transform and pass tex coords
// *NOTE: KHR texture transform is ignored for now
vary_texcoord0.xy = texgen_object_pbr(vec4(texcoord0, 0, 1), texture_matrix0, object_plane_s, object_plane_t).xy;
- // Adjust the texture repeats for a more sensible default.
- // *TODO: Remove this extra factor when KHR texture transform is added
- float texture_density_factor = 3.0;
- //texture_density_factor /= 256.0; // TODO: Remove
- vary_texcoord0.xy *= texture_density_factor;
vec4 tc = vec4(texcoord1,0,1);