diff --git a/CHANGES.md b/CHANGES.md index af1c081c3808..b671e95f76b1 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -8,6 +8,7 @@ - Updated geometric self-shadowing function to improve direct lighting on models using physically-based rendering. [#12063](https://github.com/CesiumGS/cesium/pull/12063) - Fixed environment map LOD selection in image-based lighting. [#12070](https://github.com/CesiumGS/cesium/pull/12070) +- Fixed performance issues with GLTF extension CESIUM_primitive_outline since version 1.96. [#12077](https://github.com/CesiumGS/cesium/issues/12077) - Corrected calculation of diffuse component in image-based lighting. [#12082](https://github.com/CesiumGS/cesium/pull/12082) ### 1.119 - 2024-07-01 diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 32135cd53279..c75d76aaeab5 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -391,3 +391,4 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute to Cesiu - [Peter A. Jonsson](https://github.com/pjonsson) - [Zhongxiang Wang](https://github.com/plainheart) - [Tim Schneider](https://github.com/Tim-S) +- [朱铭凡](https://github.com/MingFanZhu) diff --git a/packages/engine/Source/Scene/PrimitiveLoadPlan.js b/packages/engine/Source/Scene/PrimitiveLoadPlan.js index 31d1f5928f5f..7df391b7f4df 100644 --- a/packages/engine/Source/Scene/PrimitiveLoadPlan.js +++ b/packages/engine/Source/Scene/PrimitiveLoadPlan.js @@ -193,6 +193,15 @@ function generateOutlines(loadPlan) { indices.typedArray = generator.updatedTriangleIndices; indices.indexDatatype = IndexDatatype.fromTypedArray(indices.typedArray); + // Some vertices may be copied due to the addition of the new attribute + // which may have multiple values at a vertex depending on the face + const attributePlans = loadPlan.attributePlans; + const attributesLength = loadPlan.attributePlans.length; + for (let i = 0; i < attributesLength; i++) { + const attribute = attributePlans[i].attribute; + attribute.typedArray = generator.updateAttribute(attribute.typedArray); + } + // The outline generator creates a new attribute for the outline coordinates // that are used with a lookup texture. const outlineCoordinates = makeOutlineCoordinatesAttribute( @@ -203,15 +212,6 @@ function generateOutlines(loadPlan) { outlineCoordinatesPlan.loadTypedArray = false; loadPlan.attributePlans.push(outlineCoordinatesPlan); primitive.outlineCoordinates = outlineCoordinatesPlan.attribute; - - // Some vertices may be copied due to the addition of the new attribute - // which may have multiple values at a vertex depending on the face - const attributePlans = loadPlan.attributePlans; - const attributesLength = loadPlan.attributePlans.length; - for (let i = 0; i < attributesLength; i++) { - const attribute = attributePlans[i].attribute; - attribute.typedArray = generator.updateAttribute(attribute.typedArray); - } } function makeOutlineCoordinatesAttribute(outlineCoordinatesTypedArray) {