|
@@ -2554,8 +2554,6 @@
|
|
const useVertexTangents = geometry.attributes.tangent !== undefined;
|
|
const useVertexTangents = geometry.attributes.tangent !== undefined;
|
|
const useVertexColors = geometry.attributes.color !== undefined;
|
|
const useVertexColors = geometry.attributes.color !== undefined;
|
|
const useFlatShading = geometry.attributes.normal === undefined;
|
|
const useFlatShading = geometry.attributes.normal === undefined;
|
|
- const useMorphTargets = Object.keys( geometry.morphAttributes ).length > 0;
|
|
|
|
- const useMorphNormals = useMorphTargets && geometry.morphAttributes.normal !== undefined;
|
|
|
|
|
|
|
|
if ( mesh.isPoints ) {
|
|
if ( mesh.isPoints ) {
|
|
|
|
|
|
@@ -2595,15 +2593,13 @@
|
|
} // Clone the material if it will be modified
|
|
} // Clone the material if it will be modified
|
|
|
|
|
|
|
|
|
|
- if ( useVertexTangents || useVertexColors || useFlatShading || useMorphTargets ) {
|
|
|
|
|
|
+ if ( useVertexTangents || useVertexColors || useFlatShading ) {
|
|
|
|
|
|
let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
|
|
let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
|
|
if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
|
|
if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
|
|
if ( useVertexTangents ) cacheKey += 'vertex-tangents:';
|
|
if ( useVertexTangents ) cacheKey += 'vertex-tangents:';
|
|
if ( useVertexColors ) cacheKey += 'vertex-colors:';
|
|
if ( useVertexColors ) cacheKey += 'vertex-colors:';
|
|
if ( useFlatShading ) cacheKey += 'flat-shading:';
|
|
if ( useFlatShading ) cacheKey += 'flat-shading:';
|
|
- if ( useMorphTargets ) cacheKey += 'morph-targets:';
|
|
|
|
- if ( useMorphNormals ) cacheKey += 'morph-normals:';
|
|
|
|
let cachedMaterial = this.cache.get( cacheKey );
|
|
let cachedMaterial = this.cache.get( cacheKey );
|
|
|
|
|
|
if ( ! cachedMaterial ) {
|
|
if ( ! cachedMaterial ) {
|
|
@@ -2611,8 +2607,6 @@
|
|
cachedMaterial = material.clone();
|
|
cachedMaterial = material.clone();
|
|
if ( useVertexColors ) cachedMaterial.vertexColors = true;
|
|
if ( useVertexColors ) cachedMaterial.vertexColors = true;
|
|
if ( useFlatShading ) cachedMaterial.flatShading = true;
|
|
if ( useFlatShading ) cachedMaterial.flatShading = true;
|
|
- if ( useMorphTargets ) cachedMaterial.morphTargets = true;
|
|
|
|
- if ( useMorphNormals ) cachedMaterial.morphNormals = true;
|
|
|
|
|
|
|
|
if ( useVertexTangents ) {
|
|
if ( useVertexTangents ) {
|
|
|
|
|