diff --git a/manual/resources/threejs-material-table.js b/manual/resources/threejs-material-table.js index cfe5552b74ea8d..c6ba1d49c6f47f 100644 --- a/manual/resources/threejs-material-table.js +++ b/manual/resources/threejs-material-table.js @@ -9,6 +9,8 @@ const materials = [ 'color', 'combine', 'envMap', + 'envMapRotation', + 'fog', 'lightMap', 'lightMapIntensity', 'map', @@ -16,6 +18,9 @@ const materials = [ 'refractionRatio', 'specularMap', 'wireframe', + 'wireframeLinecap', + 'wireframeLinejoin', + 'wireframeLinewidth' ], }, { @@ -29,13 +34,16 @@ const materials = [ 'bumpScale', 'color', 'combine', + 'displacementBias', 'displacementMap', 'displacementScale', - 'displacementBias', 'emissive', - 'emissiveMap', 'emissiveIntensity', + 'emissiveMap', 'envMap', + 'envMapRotation', + 'flatShading', + 'fog', 'lightMap', 'lightMapIntensity', 'map', @@ -46,6 +54,9 @@ const materials = [ 'refractionRatio', 'specularMap', 'wireframe', + 'wireframeLinecap', + 'wireframeLinejoin', + 'wireframeLinewidth' ], }, { @@ -59,13 +70,16 @@ const materials = [ 'bumpScale', 'color', 'combine', + 'displacementBias', 'displacementMap', 'displacementScale', - 'displacementBias', 'emissive', - 'emissiveMap', 'emissiveIntensity', + 'emissiveMap', 'envMap', + 'envMapRotation', + 'flatShading', + 'fog', 'lightMap', 'lightMapIntensity', 'map', @@ -78,6 +92,9 @@ const materials = [ 'specular', 'specularMap', 'wireframe', + 'wireframeLinecap', + 'wireframeLinejoin', + 'wireframeLinewidth' ], }, { @@ -90,14 +107,17 @@ const materials = [ 'bumpMap', 'bumpScale', 'color', + 'displacementBias', 'displacementMap', 'displacementScale', - 'displacementBias', 'emissive', - 'emissiveMap', 'emissiveIntensity', + 'emissiveMap', 'envMap', 'envMapIntensity', + 'envMapRotation', + 'flatShading', + 'fog', 'lightMap', 'lightMapIntensity', 'map', @@ -106,10 +126,12 @@ const materials = [ 'normalMap', 'normalMapType', 'normalScale', - 'refractionRatio', 'roughness', 'roughnessMap', 'wireframe', + 'wireframeLinecap', + 'wireframeLinejoin', + 'wireframeLinewidth' ], }, { @@ -119,38 +141,46 @@ const materials = [ 'alphaMap', 'aoMap', 'aoMapIntensity', + 'anisotropy', + 'anisotropyRotation', + 'anisotropyMap', + 'attenuationColor', + 'attenuationDistance', 'bumpMap', 'bumpScale', 'clearcoat', 'clearcoatMap', + 'clearcoatNormalMap', + 'clearcoatNormalScale', 'clearcoatRoughness', 'clearcoatRoughnessMap', - 'clearcoatNormalScale', - 'clearcoatNormalMap', 'color', + 'displacementBias', 'displacementMap', 'displacementScale', - 'displacementBias', 'emissive', - 'emissiveMap', 'emissiveIntensity', + 'emissiveMap', 'envMap', 'envMapIntensity', + 'envMapRotation', + 'flatShading', + 'fog', + 'ior', 'iridescence', - 'iridescenceMap', 'iridescenceIOR', - 'iridescenceThicknessRange', + 'iridescenceMap', 'iridescenceThicknessMap', + 'iridescenceThicknessRange', 'lightMap', 'lightMapIntensity', - 'ior', 'map', 'metalness', 'metalnessMap', 'normalMap', 'normalMapType', 'normalScale', - 'refractionRatio', + 'reflectivity', 'roughness', 'roughnessMap', 'sheen', @@ -158,31 +188,28 @@ const materials = [ 'sheenColorMap', 'sheenRoughness', 'sheenRoughnessMap', + 'specularColor', + 'specularColorMap', + 'specularIntensity', + 'specularIntensityMap', 'thickness', 'thicknessMap', 'transmission', 'transmissionMap', - 'attenuationDistance', - 'attenuationColor', - 'anisotropy', - 'anisotropyRotation', - 'anisotropyMap', - 'specularIntensity', - 'specularIntensityMap', - 'specularColor', - 'specularColorMap', 'wireframe', - 'reflectivity', + 'wireframeLinecap', + 'wireframeLinejoin', + 'wireframeLinewidth' ], }, ]; -const allProperties = {}; +const allProperties = new Set(); materials.forEach( ( material ) => { material.properties.forEach( ( property ) => { - allProperties[ property ] = true; + allProperties.add( property ); } ); @@ -222,7 +249,7 @@ const thead = addElem( 'thead', table ); } -Object.keys( allProperties ).sort().forEach( ( property ) => { +Array.from( allProperties ).sort().forEach( ( property ) => { const tr = addElem( 'tr', table ); addElem( 'td', tr, property ); diff --git a/src/renderers/common/nodes/Nodes.js b/src/renderers/common/nodes/Nodes.js index a061ad9d700584..07cab91c3f32a9 100644 --- a/src/renderers/common/nodes/Nodes.js +++ b/src/renderers/common/nodes/Nodes.js @@ -199,13 +199,49 @@ class Nodes extends DataMap { getEnvironmentNode( scene ) { - return scene.environmentNode || this.get( scene ).environmentNode || null; + let environmentNode = null; + + if ( scene.environmentNode && scene.environmentNode.isNode ) { + + environmentNode = scene.environmentNode; + + } else { + + const sceneData = this.get( scene ); + + if ( sceneData.environmentNode ) { + + environmentNode = sceneData.environmentNode; + + } + + } + + return environmentNode; } getBackgroundNode( scene ) { - return scene.backgroundNode || this.get( scene ).backgroundNode || null; + let backgroundNode = null; + + if ( scene.backgroundNode && scene.backgroundNode.isNode ) { + + backgroundNode = scene.backgroundNode; + + } else { + + const sceneData = this.get( scene ); + + if ( sceneData.backgroundNode ) { + + backgroundNode = sceneData.backgroundNode; + + } + + } + + return backgroundNode; }