Skip to content

Commit

Permalink
RenderObjects: Force material.needsUpdate=true to update the materi…
Browse files Browse the repository at this point in the history
…al if geometry is changed. (#29873)
  • Loading branch information
sunag authored Nov 13, 2024
1 parent 20c67d6 commit e5e8d20
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/renderers/common/RenderObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ class RenderObjects {

renderObject.updateClipping( clippingContext );

const needsGeometryUpdate = renderObject.needsGeometryUpdate;
if ( renderObject.needsGeometryUpdate ) {

if ( renderObject.version !== material.version || renderObject.needsUpdate || needsGeometryUpdate ) {
renderObject.setGeometry( object.geometry );

}

if ( renderObject.version !== material.version || renderObject.needsUpdate ) {

if ( renderObject.initialCacheKey !== renderObject.getCacheKey() ) {

Expand All @@ -54,12 +58,6 @@ class RenderObjects {

renderObject.version = material.version;

if ( needsGeometryUpdate ) {

renderObject.setGeometry( object.geometry );

}

}

}
Expand Down

0 comments on commit e5e8d20

Please sign in to comment.