diff options
author | Brad Linden <brad@lindenlab.com> | 2024-05-15 15:41:24 -0700 |
---|---|---|
committer | Brad Linden <brad@lindenlab.com> | 2024-05-15 15:41:24 -0700 |
commit | 3cb329d4fa53df9ab1ab371f26a178ef48ae3ca3 (patch) | |
tree | b07ac60e9dcfbc93a86f7c0755e497978b3bba6e | |
parent | 6252449cd392918d976f0af0317c44688e052b32 (diff) | |
parent | 29be88d60d654193926add496d2d851f7c217356 (diff) |
Merge commit '29be88d60d654193926add496d2d851f7c217356' into project/gltf_development
7 files changed, 14 insertions, 19 deletions
diff --git a/doc/testplans/pbr_terrain_appearance.md b/doc/testplans/pbr_terrain_appearance.md index 4f0ee5c943..f6d54029b5 100644 --- a/doc/testplans/pbr_terrain_appearance.md +++ b/doc/testplans/pbr_terrain_appearance.md @@ -2,6 +2,8 @@ ## Tiling +The southwest corner of a region with PBR materials should exactly match up with the bottom left corner of the material texture(s). + If two adjacent regions have the same PBR terrain settings, then: - There should not be seams between the two regions at their shared border diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl index 1d1545be7e..35b7602569 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbrShadowAlphaMaskF.glsl @@ -35,7 +35,7 @@ uniform float minimum_alpha; void main() { - float alpha = texture(diffuseMap,vary_texcoord0.xy).a; + float alpha = texture(diffuseMap,vary_texcoord0.xy).a * vertex_color.a; if (alpha < minimum_alpha) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl index 1d5f810cf3..380d493636 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbropaqueF.glsl @@ -69,12 +69,16 @@ void main() mirrorClip(vary_position); vec4 basecolor = texture(diffuseMap, base_color_texcoord.xy).rgba; + basecolor.rgb = srgb_to_linear(basecolor.rgb); + + basecolor *= vertex_color; + if (basecolor.a < minimum_alpha) { discard; } - vec3 col = vertex_color.rgb * srgb_to_linear(basecolor.rgb); + vec3 col = basecolor.rgb; // from mikktspace.com vec3 vNt = texture(bumpMap, normal_texcoord.xy).xyz*2.0-1.0; @@ -108,7 +112,7 @@ void main() //emissive = tnorm*0.5+0.5; // See: C++: addDeferredAttachments(), GLSL: softenLightF frag_data[0] = max(vec4(col, 0.0), vec4(0)); // Diffuse - frag_data[1] = max(vec4(spec.rgb,vertex_color.a), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal. + frag_data[1] = max(vec4(spec.rgb,0.0), vec4(0)); // PBR linear packed Occlusion, Roughness, Metal. frag_data[2] = vec4(tnorm, GBUFFER_FLAG_HAS_PBR); // normal, environment intensity, flags frag_data[3] = max(vec4(emissive,0), vec4(0)); // PBR sRGB Emissive } diff --git a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl index 40b7f9cf0e..d077670c96 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/atmosphericsFuncs.glsl @@ -98,7 +98,7 @@ void calcAtmosphericVars(vec3 inPositionEye, vec3 light_dir, float ambFactor, ou haze_glow = max(haze_glow, .001); // set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) haze_glow *= glow.x; // higher glow.x gives dimmer glow (because next step is 1 / "angle") - haze_glow = clamp(pow(haze_glow, glow.z), -10, 10); + haze_glow = clamp(pow(haze_glow, glow.z), -100000, 100000); // glow.z should be negative, so we're doing a sort of (1 / "angle") function // add "minimum anti-solar illumination" diff --git a/indra/newview/lldrawpoolterrain.cpp b/indra/newview/lldrawpoolterrain.cpp index 7e089c77b7..0697c5a0c5 100644 --- a/indra/newview/lldrawpoolterrain.cpp +++ b/indra/newview/lldrawpoolterrain.cpp @@ -431,7 +431,6 @@ void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) LLGLSLShader* shader = LLGLSLShader::sCurBoundShaderPtr; llassert(shader); - // Like for PBR materials, PBR terrain texture transforms are defined by // the KHR_texture_transform spec, but with the following notable @@ -446,7 +445,6 @@ void LLDrawPoolTerrain::renderFullShaderPBR(bool local_materials) // i.e. this isn't fully compliant with KHR_texture_transform, but is // compliant when all texture infos used by a material have the same // texture transform. - LLGLTFMaterial::TextureTransform::PackTight transforms_packed[terrain_material_count]; for (U32 i = 0; i < terrain_material_count; ++i) { diff --git a/indra/newview/llface.cpp b/indra/newview/llface.cpp index 6ef0894ae4..fa7b5f2b17 100644 --- a/indra/newview/llface.cpp +++ b/indra/newview/llface.cpp @@ -1261,11 +1261,11 @@ bool LLFace::getGeometryVolume(const LLVolume& volume, { color = tep->getGLTFRenderMaterial()->mBaseColor; } - - if (rebuild_color) + + if (rebuild_color) { //decide if shiny goes in alpha channel of color if (tep && - !isInAlphaPool()) // <--- alpha channel MUST contain transparency, not shiny + !isInAlphaPool() && tep->getGLTFRenderMaterial() == nullptr) // <--- alpha channel MUST contain transparency, not shiny { LLMaterial* mat = tep->getMaterialParams().get(); diff --git a/indra/newview/llfetchedgltfmaterial.cpp b/indra/newview/llfetchedgltfmaterial.cpp index e58027e579..6e45e2a0f3 100644 --- a/indra/newview/llfetchedgltfmaterial.cpp +++ b/indra/newview/llfetchedgltfmaterial.cpp @@ -77,16 +77,7 @@ void LLFetchedGLTFMaterial::bind(LLViewerTexture* media_tex) { if (mAlphaMode == LLGLTFMaterial::ALPHA_MODE_MASK) { - // dividing the alpha cutoff by transparency here allows the shader to compare against - // the alpha value of the texture without needing the transparency value - if (mBaseColor.mV[3] > 0.f) - { - min_alpha = mAlphaCutoff / mBaseColor.mV[3]; - } - else - { - min_alpha = 1024.f; - } + min_alpha = mAlphaCutoff; } shader->uniform1f(LLShaderMgr::MINIMUM_ALPHA, min_alpha); } |