summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings
diff options
context:
space:
mode:
authorCosmic Linden <cosmic@lindenlab.com>2024-05-28 13:25:02 -0700
committerCosmic Linden <cosmic@lindenlab.com>2024-05-28 14:04:45 -0700
commit5f3a6bdd7f122688aff5c0e63f03928fa15bb0c9 (patch)
tree47c8d6e4231449a98121d14fe6e31a80bc5def8b /indra/newview/app_settings
parent7ed053d9a257087b76937d750b9f2b0c96f6df38 (diff)
secondlife/viewer#1531: Attempt to fix PBR terrain fragment shader.
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl30
1 files changed, 15 insertions, 15 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
index de4745c1c4..0de2d348c3 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl
@@ -180,7 +180,7 @@ void main()
rm_factors[3] = vec2(roughnessFactors.w, metallicFactors.w);
#endif
- PBRMix mix = init_pbr_mix();
+ PBRMix pbr_mix = init_pbr_mix();
PBRMix mix2;
switch (tm.type & MIX_X)
{
@@ -207,7 +207,7 @@ void main()
, emissiveColors[0]
#endif
);
- mix = mix_pbr(mix, mix2, tm.weight.x);
+ pbr_mix = mix_pbr(pbr_mix, mix2, tm.weight.x);
break;
default:
break;
@@ -237,7 +237,7 @@ void main()
, emissiveColors[1]
#endif
);
- mix = mix_pbr(mix, mix2, tm.weight.y);
+ pbr_mix = mix_pbr(pbr_mix, mix2, tm.weight.y);
break;
default:
break;
@@ -267,7 +267,7 @@ void main()
, emissiveColors[2]
#endif
);
- mix = mix_pbr(mix, mix2, tm.weight.z);
+ pbr_mix = mix_pbr(pbr_mix, mix2, tm.weight.z);
break;
default:
break;
@@ -297,14 +297,14 @@ void main()
, emissiveColors[3]
#endif
);
- mix = mix_pbr(mix, mix2, tm.weight.w);
+ pbr_mix = mix_pbr(pbr_mix, mix2, tm.weight.w);
break;
default:
break;
}
float minimum_alpha = terrain_mix(tm, minimum_alphas);
- if (mix.col.a < minimum_alpha)
+ if (pbr_mix.col.a < minimum_alpha)
{
discard;
}
@@ -312,7 +312,7 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_NORMAL)
// from mikktspace.com
- vec3 vNt = mix.vNt;
+ vec3 vNt = pbr_mix.vNt;
vec3 vN = vary_normal;
vec3 vT = vary_tangent.xyz;
@@ -327,21 +327,21 @@ void main()
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE)
-#define emissive mix.emissive
+#define mix_emissive pbr_mix.emissive
#else
-#define emissive vec3(0)
+#define mix_emissive vec3(0)
#endif
#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_OCCLUSION)
-#define orm mix.orm
+#define mix_orm pbr_mix.orm
#elif (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_METALLIC_ROUGHNESS)
-#define orm vec3(1.0, mix.rm)
+#define mix_orm vec3(1.0, pbr_mix.rm)
#else
// Matte plastic potato terrain
-#define orm vec3(1.0, 1.0, 0.0)
+#define mix_orm vec3(1.0, 1.0, 0.0)
#endif
- frag_data[0] = max(vec4(mix.col.xyz, 0.0), vec4(0)); // Diffuse
- frag_data[1] = max(vec4(orm.rgb, base_color_factor_alpha), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal.
+ frag_data[0] = max(vec4(pbr_mix.col.xyz, 0.0), vec4(0)); // Diffuse
+ frag_data[1] = max(vec4(mix_orm.rgb, base_color_factor_alpha), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal.
frag_data[2] = vec4(tnorm, GBUFFER_FLAG_HAS_PBR); // normal, flags
- frag_data[3] = max(vec4(emissive,0), vec4(0)); // PBR sRGB Emissive
+ frag_data[3] = max(vec4(mix_emissive,0), vec4(0)); // PBR sRGB Emissive
}