Skip to content

Commit

Permalink
Merge pull request #1414 from CesiumGS/fix-lod-fade
Browse files Browse the repository at this point in the history
Fix LOD dithering artifacts
  • Loading branch information
kring authored May 20, 2024
2 parents 405ea08 + d400660 commit 3f830c5
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

##### Fixes :wrench:

- Fixed an issue with pixel dithering artifacts that could appear on tilesets.
- Fixed an issue where DynamicPawn could get stuck after interrupting a flight from `UCesiumFlyToComponent`.

### v2.5.0 - 2024-05-01
Expand Down
Binary file modified Content/Materials/Layers/ML_DitherFade.uasset
Binary file not shown.
6 changes: 3 additions & 3 deletions Source/CesiumRuntime/Private/CesiumGltfComponent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3568,8 +3568,6 @@ void UCesiumGltfComponent::UpdateFade(float fadePercentage, bool fadingIn) {
return;
}

fadePercentage = glm::clamp(fadePercentage, 0.0f, 1.0f);

UCesiumMaterialUserData* pCesiumData =
BaseMaterial->GetAssetUserData<UCesiumMaterialUserData>();

Expand All @@ -3582,10 +3580,12 @@ void UCesiumGltfComponent::UpdateFade(float fadePercentage, bool fadingIn) {
return;
}

fadePercentage = glm::clamp(fadePercentage, 0.0f, 1.0f);

for (USceneComponent* pChild : this->GetAttachChildren()) {
UCesiumGltfPrimitiveComponent* pPrimitive =
Cast<UCesiumGltfPrimitiveComponent>(pChild);
if (!pPrimitive || !pPrimitive->GetMaterials().Num()) {
if (!pPrimitive || pPrimitive->GetMaterials().IsEmpty()) {
continue;
}

Expand Down

0 comments on commit 3f830c5

Please sign in to comment.