Sfoglia il codice sorgente

RenderObject: Fix material cache key regression. (#28935)

Michael Herzog 1 anno fa
parent
commit
5c5f02d095
1 ha cambiato i file con 11 aggiunte e 2 eliminazioni
  1. 11 2
      src/renderers/common/RenderObject.js

+ 11 - 2
src/renderers/common/RenderObject.js

@@ -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 = '{';
 
@@ -214,6 +219,10 @@ export default class RenderObject {
 
 					valueKey += '}';
 
+				} else {
+
+					valueKey = String( value );
+
 				}
 
 			} else {