From ca5119d577c6b621fc4ca96f0e408953126036a7 Mon Sep 17 00:00:00 2001 From: Brad Linden <46733234+brad-linden@users.noreply.github.com> Date: Tue, 26 Nov 2024 11:04:28 -0800 Subject: #2696 Viewer crashes on gestures : fix the bug (#3152) Co-authored-by: Alexander Gavriliuk --- indra/llcharacter/llkeyframemotion.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indra') diff --git a/indra/llcharacter/llkeyframemotion.cpp b/indra/llcharacter/llkeyframemotion.cpp index 6790f1ad56..b82734615f 100644 --- a/indra/llcharacter/llkeyframemotion.cpp +++ b/indra/llcharacter/llkeyframemotion.cpp @@ -2427,9 +2427,15 @@ void LLKeyframeMotion::onLoadComplete(const LLUUID& asset_uuid, LLCharacter* character = *char_iter; // look for an existing instance of this motion - LLKeyframeMotion* motionp = static_cast (character->findMotion(asset_uuid)); - if (motionp) + if (LLMotion* asset = character->findMotion(asset_uuid)) { + LLKeyframeMotion* motionp = dynamic_cast(asset); + if (!motionp) + { + // This motion is not LLKeyframeMotion (e.g., LLEmote) + return; + } + if (0 == status) { if (motionp->mAssetStatus == ASSET_LOADED) -- cgit v1.2.3 From 3d9ee4072dd829350c60c9c31535bdc6e2d9b789 Mon Sep 17 00:00:00 2001 From: Brad Linden <46733234+brad-linden@users.noreply.github.com> Date: Tue, 26 Nov 2024 13:33:44 -0800 Subject: fix GL3 fallback on mac intel gpu systems. secondlife/viewer#3145 (#3159) --- indra/newview/llfeaturemanager.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp index 7e52b4afc0..2ad1257695 100644 --- a/indra/newview/llfeaturemanager.cpp +++ b/indra/newview/llfeaturemanager.cpp @@ -655,8 +655,16 @@ void LLFeatureManager::applyBaseMasks() if (gGLManager.mIsIntel) { maskFeatures("Intel"); + + static constexpr F32 TARGET_GL_VERSION = +#if LL_DARWIN + 4.09f; +#else + 4.59f; +#endif + // check against 3.33 to avoid applying this fallback twice - if (gGLManager.mGLVersion < 4.59f && gGLManager.mGLVersion > 3.33f) + if (gGLManager.mGLVersion < TARGET_GL_VERSION && gGLManager.mGLVersion > 3.33f) { // if we don't have OpenGL 4.6 on intel, set it to OpenGL 3.3 // we also want to trigger the GL3 fallbacks on these chipsets -- cgit v1.2.3 From 38845a1e05a5932b9fb23ab249b7d272bd80643f Mon Sep 17 00:00:00 2001 From: Andrey Kleshchev Date: Tue, 26 Nov 2024 20:51:41 +0200 Subject: viewer#3147 Thumbnail picker's image is grey when both thumnail and normal image attempt to fetch, one creates a fetcher, another fails, since fetcher is already there, potentially in a transitional state, so it thinks fetch failed. --- indra/newview/llviewertexture.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'indra') diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index 4a15b8624a..d2511aef7b 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -1965,7 +1965,9 @@ bool LLViewerFetchedTexture::updateFetch() if (!mIsFetching) { - if ((decode_priority > 0) && (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL)) + if ((decode_priority > 0) + && (mRawDiscardLevel < 0 || mRawDiscardLevel == INVALID_DISCARD_LEVEL) + && mFetchState > 1) // 1 - initial, make sure fetcher did at least something { // We finished but received no data if (getDiscardLevel() < 0) @@ -2003,6 +2005,9 @@ bool LLViewerFetchedTexture::updateFetch() { // We have data, but our fetch failed to return raw data // *TODO: FIgure out why this is happening and fix it + // Potentially can happen when TEX_LIST_SCALE and TEX_LIST_STANDARD + // get requested for the same texture id at the same time + // (two textures, one fetcher) destroyRawImage(); } } -- cgit v1.2.3 From a90377df950f83347e988754d15400b47a739cce Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Tue, 26 Nov 2024 19:01:24 -0500 Subject: #3157 Fix alpha not having ambient lighting on low. (#3162) * #3157 Fix alpha not having ambient lighting on low. --- .../shaders/class2/deferred/alphaF.glsl | 20 +++++++++++++++----- .../shaders/class2/deferred/pbralphaF.glsl | 4 ++-- .../shaders/class3/deferred/materialF.glsl | 21 +++++++++++++++++---- 3 files changed, 34 insertions(+), 11 deletions(-) (limited to 'indra') diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl index 210ecce8db..89fe4b6007 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl @@ -36,6 +36,7 @@ out vec4 frag_color; uniform mat3 env_mat; uniform vec3 sun_dir; uniform vec3 moon_dir; +uniform int classic_mode; #ifdef USE_DIFFUSE_TEX uniform sampler2D diffuseMap; @@ -241,10 +242,10 @@ void main() calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten); - vec3 sunlit_linear = srgb_to_linear(sunlit); + vec3 sunlit_linear = sunlit; vec3 amblit_linear = amblit; - vec3 irradiance; + vec3 irradiance = amblit; vec3 glossenv; vec3 legacyenv; sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true, amblit_linear); @@ -260,11 +261,20 @@ void main() color.a = final_alpha; - vec3 sun_contrib = min(final_da, shadow) * sunlit_linear; - color.rgb = irradiance; + if (classic_mode > 0) + { + final_da = pow(final_da,1.2); + vec3 sun_contrib = vec3(min(final_da, shadow)); - color.rgb += sun_contrib; + color.rgb = srgb_to_linear(color.rgb * 0.9 + linear_to_srgb(sun_contrib) * sunlit_linear * 0.7); + sunlit_linear = srgb_to_linear(sunlit_linear); + } + else + { + vec3 sun_contrib = min(final_da, shadow) * sunlit_linear; + color.rgb += sun_contrib; + } color.rgb *= diffuse_linear.rgb; diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl index 95110005dc..cec844559f 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl @@ -161,7 +161,7 @@ void main() vec3 atten; calcAtmosphericVarsLinear(pos.xyz, norm, light_dir, sunlit, amblit, additive, atten); - vec3 sunlit_linear = srgb_to_linear(sunlit); + vec3 sunlit_linear = sunlit; vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; @@ -182,7 +182,7 @@ void main() // PBR IBL float gloss = 1.0 - perceptualRoughness; - vec3 irradiance = vec3(0); + vec3 irradiance = amblit; vec3 radiance = vec3(0); sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true, amblit); diff --git a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl index e62f401817..e15317f5b5 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/materialF.glsl @@ -36,6 +36,7 @@ uniform float emissive_brightness; // fullbright flag, 1.0 == fullbright, 0.0 otherwise uniform int sun_up_factor; +uniform int classic_mode; vec4 applySkyAndWaterFog(vec3 pos, vec3 additive, vec3 atten, vec4 color); vec3 scaleSoftClipFragLinear(vec3 l); @@ -329,10 +330,10 @@ void main() vec3 atten; calcAtmosphericVarsLinear(pos.xyz, norm.xyz, light_dir, sunlit, amblit, additive, atten); - vec3 sunlit_linear = srgb_to_linear(sunlit); + vec3 sunlit_linear = sunlit; vec3 amblit_linear = amblit; - vec3 ambenv; + vec3 ambenv = amblit; vec3 glossenv; vec3 legacyenv; sampleReflectionProbesLegacy(ambenv, glossenv, legacyenv, pos.xy*0.5+0.5, pos.xyz, norm.xyz, glossiness, env, true, amblit_linear); @@ -340,8 +341,20 @@ void main() color = ambenv; float da = clamp(dot(norm.xyz, light_dir.xyz), 0.0, 1.0); - vec3 sun_contrib = min(da, shadow) * sunlit_linear; - color.rgb += sun_contrib; + if (classic_mode > 0) + { + da = pow(da,1.2); + vec3 sun_contrib = vec3(min(da, shadow)); + + color.rgb = srgb_to_linear(color.rgb * 0.9 + linear_to_srgb(sun_contrib) * sunlit_linear * 0.7); + sunlit_linear = srgb_to_linear(sunlit_linear); + } + else + { + vec3 sun_contrib = min(da, shadow) * sunlit_linear; + color.rgb += sun_contrib; + } + color *= diffcol.rgb; vec3 refnormpersp = reflect(pos.xyz, norm.xyz); -- cgit v1.2.3