Skip to content

Commit

Permalink
RenderObject: Fix material cache key regression. (#28935)
Browse files Browse the repository at this point in the history
  • Loading branch information
Mugen87 authored Jul 22, 2024
1 parent 4755144 commit 5c5f02d
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/renderers/common/RenderObject.js
Original file line number Diff line number Diff line change
Expand Up @@ -199,10 +199,15 @@ export default class RenderObject {

if ( value !== null ) {

// some material values require a formatting

const type = typeof value;

if ( type === 'number' ) valueKey = value !== 0 ? '1' : '0'; // Convert to on/off, important for clearcoat, transmission, etc
else if ( type === 'object' ) {
if ( type === 'number' ) {

valueKey = value !== 0 ? '1' : '0'; // Convert to on/off, important for clearcoat, transmission, etc

} else if ( type === 'object' ) {

valueKey = '{';

Expand All @@ -214,6 +219,10 @@ export default class RenderObject {

valueKey += '}';

} else {

valueKey = String( value );

}

} else {
Expand Down

0 comments on commit 5c5f02d

Please sign in to comment.