Skip to content

Commit

Permalink
RenderObjects: Force update if geometry has changed. (#29807)
Browse files Browse the repository at this point in the history
* getParallaxCorrectNormal: fix import

* force update if geometry has changed
  • Loading branch information
sunag authored Nov 5, 2024
1 parent c9bdf26 commit 6933414
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/nodes/functions/material/getParallaxCorrectNormal.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { positionWorld } from '../../accessors/Position';
import { positionWorld } from '../../accessors/Position.js';
import { float, Fn, min, normalize, sub, vec3 } from '../../tsl/TSLBase.js';

// https://devlog-martinsh.blogspot.com/2011/09/box-projected-cube-environment-mapping.html
Expand Down
7 changes: 5 additions & 2 deletions src/renderers/common/RenderObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,12 @@ class RenderObjects {

renderObject.updateClipping( clippingContext );

if ( renderObject.version !== material.version || renderObject.needsUpdate ) {
// force update if geometry has changed
const forceUpdate = renderObject.geometry.id !== renderObject.object.geometry.id;

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

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

renderObject.dispose();

Expand Down

0 comments on commit 6933414

Please sign in to comment.