From dfa19c5e436edb102d8bd121c853153303631b4d Mon Sep 17 00:00:00 2001 From: Cosmic Linden Date: Fri, 13 Oct 2023 10:33:16 -0700 Subject: DRTVWR-592: PBR terrain fallback for Mac/Intel: Drop emissive texture. Bump featuretable. --- indra/newview/app_settings/settings.xml | 11 +++++++++++ .../app_settings/shaders/class1/deferred/pbrterrainF.glsl | 10 ++++++++++ 2 files changed, 21 insertions(+) (limited to 'indra/newview/app_settings') diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml index 013f0ca8ff..94cc5a14a4 100644 --- a/indra/newview/app_settings/settings.xml +++ b/indra/newview/app_settings/settings.xml @@ -10711,6 +10711,17 @@ Value 12.0 + RenderTerrainPBRDetail + + Comment + Detail level for PBR terrain. 0 is full detail. Negative values drop rendering features in accordance with the GLTF specification, which reduces the number of texture binds. Some Intel and Mac graphics drivers do not support more than 16 texture binds. Because PBR terrain exceeds this limit at the highest detail level, reducing texture binds is necessary for compatibility. + Persist + 1 + Type + S32 + Value + 0 + RenderTrackerBeacon Comment diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl index 85691ae9b6..344c342189 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrterrainF.glsl @@ -23,6 +23,8 @@ * $/LicenseInfo$ */ +#define TERRAIN_PBR_DETAIL_EMISSIVE 0 + out vec4 frag_data[4]; uniform sampler2D alpha_ramp; @@ -42,16 +44,20 @@ uniform sampler2D detail_0_metallic_roughness; uniform sampler2D detail_1_metallic_roughness; uniform sampler2D detail_2_metallic_roughness; uniform sampler2D detail_3_metallic_roughness; +#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE) uniform sampler2D detail_0_emissive; uniform sampler2D detail_1_emissive; uniform sampler2D detail_2_emissive; uniform sampler2D detail_3_emissive; +#endif // *TODO: More efficient packing? uniform vec4[4] baseColorFactors; // See also vertex_color in pbropaqueV.glsl uniform vec4 metallicFactors; uniform vec4 roughnessFactors; +#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE) uniform vec3[4] emissiveColors; +#endif uniform vec4 minimum_alphas; // PBR alphaMode: MASK, See: mAlphaCutoff, setAlphaCutoff() in vec3 vary_normal; @@ -170,7 +176,11 @@ void main() // metal 0.0 vec3 spec = sample_and_mix_vector3(alpha1, alpha2, alphaFinal, terrain_texcoord, orm_factors, detail_0_metallic_roughness, detail_1_metallic_roughness, detail_2_metallic_roughness, detail_3_metallic_roughness); +#if (TERRAIN_PBR_DETAIL >= TERRAIN_PBR_DETAIL_EMISSIVE) vec3 emissive = sample_and_mix_color3(alpha1, alpha2, alphaFinal, terrain_texcoord, emissiveColors, detail_0_emissive, detail_1_emissive, detail_2_emissive, detail_3_emissive); +#else + vec3 emissive = vec3(0); +#endif float base_color_factor_alpha = terrain_mix(vec4(baseColorFactors[0].z, baseColorFactors[1].z, baseColorFactors[2].z, baseColorFactors[3].z), alpha1, alpha2, alphaFinal); -- cgit v1.2.3