summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl16
2 files changed, 9 insertions, 16 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
index 7b5eba14b7..f788b46aa7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
@@ -82,7 +82,7 @@ vec4 sample_and_mix_color4(float alpha1, float alpha2, float alphaFinal, Terrain
vec3 sample_and_mix_vector3(float alpha1, float alpha2, float alphaFinal, TerrainCoord texcoord, vec3[4] factors, sampler2D tex0, sampler2D tex1, sampler2D tex2, sampler2D tex3);
vec3 sample_and_mix_normal(float alpha1, float alpha2, float alphaFinal, TerrainCoord texcoord, sampler2D tex0, sampler2D tex1, sampler2D tex2, sampler2D tex3);
-#if 1 // TODO: Remove
+#if 0 // TODO: Remove
#define TERRAIN_DEBUG 1 // TODO: Remove debug
struct TerrainMix
{
@@ -147,6 +147,7 @@ void main()
tnorm *= gl_FrontFacing ? 1.0 : -1.0;
+#if TERRAIN_DEBUG // TODO: Remove
#if 0 // TODO: Remove (terrain weights visualization)
TerrainMix tm = _t_mix(alpha1, alpha2, alphaFinal);
#if 1
@@ -187,11 +188,13 @@ void main()
//col.rgb = vec3(0.0, 1.0, 0.0);
//col.rgb = spec.rgb;
//col.rgb = (vNt + 1.0) / 2.0;
- col.rgb = (tnorm + 1.0) / 2.0;
- spec.rgb = vec3(1.0, 1.0, 0.0);
+ //col.rgb = (tnorm + 1.0) / 2.0;
+ //spec.rgb = vec3(1.0, 1.0, 0.0);
+ col.rgb = spec.rgb;
tnorm = vary_normal;
emissive = vec3(0);
#endif
+#endif
frag_data[0] = max(vec4(col.xyz, 0.0), vec4(0)); // Diffuse
frag_data[1] = max(vec4(spec.rgb, base_color_factor_alpha), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal.
frag_data[2] = max(vec4(encode_normal(tnorm), base_color_factor_alpha, GBUFFER_FLAG_HAS_PBR), vec4(0)); // normal, environment intensity, flags
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl
index 13f3934689..9d1990bd4a 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainUtilF.glsl
@@ -57,7 +57,9 @@ vec3 srgb_to_linear(vec3 c);
#define MIX_Z 1 << 1
#define MIX_W 1 << 0
-#define TERRAIN_DEBUG 1 // TODO: Remove debug
+#if 0 // TODO: Remove debug
+#define TERRAIN_DEBUG 1
+#endif
struct TerrainMix
{
vec4 weight;
@@ -105,18 +107,6 @@ float terrain_mix(vec4 samples, float alpha1, float alpha2, float alphaFinal)
tm.weight.w * samples.w;
}
-#if 0 // TODO: Decide if still needed, and if so, use _t_mix internally for weights
-vec3 terrain_mix(vec3[4] samples, float alpha1, float alpha2, float alphaFinal)
-{
- return mix( mix(samples[3], samples[2], alpha2), mix(samples[1], samples[0], alpha1), alphaFinal );
-}
-
-vec4 terrain_mix(vec4[4] samples, float alpha1, float alpha2, float alphaFinal)
-{
- return mix( mix(samples[3], samples[2], alpha2), mix(samples[1], samples[0], alpha1), alphaFinal );
-}
-#endif
-
vec4 terrain_mix(TerrainMix tm, TerrainMixSample tms)
{
// Assume weights add to 1