未验证 提交 8c218910 编写于 作者: M Michael Herzog 提交者: GitHub

Material: Remove skinning. (#21788)

上级 773a5c74
......@@ -109,9 +109,6 @@
The refraction ratio should not exceed 1. Default is *0.98*.
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Texture specularMap]</h3>
<p>Specular map used by the material. Default is null.</p>
......
......@@ -87,9 +87,6 @@
<h3>[property:Boolean morphTargets]</h3>
<p>Define whether the material uses morphTargets. Default is false.</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Boolean wireframe]</h3>
<p>Render geometry as wireframe. Default is false (i.e. render as smooth shaded).</p>
......
......@@ -108,9 +108,6 @@
The position of the point light in world space.
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h2>Methods</h2>
<p>See the base [page:Material] class for common methods.</p>
......
......@@ -138,9 +138,6 @@
The refraction ratio should not exceed 1. Default is *0.98*.
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Texture specularMap]</h3>
<p>Specular map used by the material. Default is null.</p>
......
......@@ -136,9 +136,6 @@
Default is a [page:Vector2] set to (1,1).
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h2>Methods</h2>
<p>See the base [page:Material] class for common methods.</p>
......
......@@ -113,9 +113,6 @@
Default is a [page:Vector2] set to (1,1).
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Boolean wireframe]</h3>
<p>
Render geometry as wireframe. Default is false (i.e. render as smooth shaded).
......
......@@ -203,10 +203,6 @@
<h3>[property:Float shininess]</h3>
<p>How shiny the [page:.specular] highlight is; a higher value gives a sharper highlight. Default is *30*.</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Color specular]</h3>
<p>
Specular color of the material. Default is a [page:Color] set to *0x111111* (very dark grey).<br /><br />
......
......@@ -242,9 +242,6 @@
<h3>[property:Texture roughnessMap]</h3>
<p>The green channel of this texture is used to alter the roughness of the material.</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Boolean vertexTangents]</h3>
<p>
Defines whether precomputed vertex tangents, which must be provided in a vec4 "tangent" attribute,
......
......@@ -163,9 +163,6 @@
Default is a [page:Vector2] set to (1,1).
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Boolean wireframe]</h3>
<p>Render geometry as wireframe. Default is *false* (i.e. render as flat polygons).</p>
......
......@@ -383,11 +383,6 @@ this.extensions = {
Define whether the material is rendered with flat shading. Default is false.
</p>
<h3>[property:Boolean skinning]</h3>
<p>
Define whether the material uses skinning; true to pass skinning attributes to the shader. Default is false.
</p>
<h3>[property:Object uniforms]</h3>
<p>
An object of the form:
......
......@@ -13,7 +13,6 @@
<p class="desc">
A mesh that has a [page:Skeleton] with [page:Bone bones] that can then be used to animate the vertices of the geometry.
The material must support skinning and have skinning enabled - see [page:MeshStandardMaterial.skinning].
</p>
<iframe id="scene" src="scenes/bones-browser.html"></iframe>
......@@ -157,7 +156,7 @@
<p>
Calculates the position of the vertex at the given index relative to the current bone transformations.
</p>
<h2>Source</h2>
<p>
......
......@@ -98,9 +98,6 @@
折射率不应超过1。默认值为*0.98*。
</p>
<h3>[property:Boolean skinning]</h3>
<p> 材质是否使用蒙皮。默认值为false。</p>
<h3>[property:Texture specularMap]</h3>
<p> 材质使用的高光贴图。默认值为null。</p>
......
......@@ -76,9 +76,6 @@
<h3>[property:Boolean morphTargets]</h3>
<p>材质是否使用morphTargets。默认值为false。</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h3>[property:Boolean wireframe]</h3>
<p> 将几何体渲染为线框。默认值为*false*(即渲染为平滑着色)。</p>
......
......@@ -97,9 +97,6 @@
The position of the point light in world space.
</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h2>方法(Methods)</h2>
<p>共有方法请参见其基类[page:Material]。</p>
......
......@@ -119,9 +119,6 @@
折射率不应超过1。默认值为*0.98*。
</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h3>[property:Texture specularMap]</h3>
<p>材质使用的高光贴图。默认值为null。</p>
......
......@@ -112,9 +112,6 @@
<p> 法线贴图对材质的影响程度。典型范围是0-1。默认值是[page:Vector2]设置为(1,1)。
</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h2>方法(Methods)</h2>
<p>共有方法请参见其基类[page:Material]。</p>
......
......@@ -91,9 +91,6 @@
<p> 法线贴图对材质的影响程度。典型范围是0-1。默认值是[page:Vector2]设置为(1,1)。
</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h3>[property:Boolean wireframe]</h3>
<p>
将几何体渲染为线框。默认值为*false*(即渲染为平滑着色)。
......
......@@ -163,10 +163,6 @@
<h3>[property:Float shininess]</h3>
<p> [page:.specular]高亮的程度,越高的值越闪亮。默认值为 *30*。</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h3>[property:Color specular]</h3>
<p> 材质的高光颜色。默认值为*0x111111*(深灰色)的颜色[page:Color]。<br /><br />
这定义了材质的光泽度和光泽的颜色。
......
......@@ -198,9 +198,6 @@
<h3>[property:Texture roughnessMap]</h3>
<p>该纹理的绿色通道用于改变材质的粗糙度。</p>
<h3>[property:Boolean skinning]</h3>
<p>材质是否使用蒙皮。默认值为false。</p>
<h3>[property:Boolean vertexTangents]</h3>
<p>
Defines whether precomputed vertex tangents, which must be provided in a vec4 "tangent" attribute,
......
......@@ -163,9 +163,6 @@
Default is a [page:Vector2] set to (1,1).
</p>
<h3>[property:Boolean skinning]</h3>
<p>Define whether the material uses skinning. Default is false.</p>
<h3>[property:Boolean wireframe]</h3>
<p>Render geometry as wireframe. Default is *false* (i.e. render as flat polygons).</p>
......
......@@ -337,11 +337,6 @@ this.extensions = {
<p> 定义材质是否使用平面着色进行渲染。默认值为false。
</p>
<h3>[property:Boolean skinning]</h3>
<p> 定义材质是否使用蒙皮; 如果将蒙皮属性传递给shader,则为true。默认值为false。
</p>
<h3>[property:Object uniforms]</h3>
<p> 如下形式的对象:
<code>
......
......@@ -13,7 +13,6 @@
<p class="desc">
具有[page:Skeleton](骨架)和[page:Bone bones](骨骼)的网格,可用于给几何体上的顶点添加动画。
其材质必须支持蒙皮,并且已经启用了蒙皮 —— 请阅读[page:MeshStandardMaterial.skinning]。
</p>
<iframe id="scene" src="scenes/bones-browser.html"></iframe>
......
......@@ -137,7 +137,6 @@ line.geometry.computeBoundingSphere();
<li>texture</li>
<li>fog</li>
<li>vertex colors</li>
<li>skinning</li>
<li>morphing</li>
<li>shadow map</li>
<li>alpha test</li>
......
......@@ -147,7 +147,6 @@ line.geometry.computeBoundingSphere();
<li>texture</li>
<li>fog</li>
<li>vertex colors</li>
<li>skinning</li>
<li>morphing</li>
<li>shadow map</li>
<li>alpha test</li>
......
......@@ -173,7 +173,6 @@ geometry.dynamic = true;
<li>texture</li>
<li>fog</li>
<li>vertex colors</li>
<li>skinning</li>
<li>morphing</li>
<li>shadow map</li>
<li>alpha test</li>
......@@ -260,4 +259,4 @@ camera.updateProjectionMatrix();
</div>
</body>
</html>
\ No newline at end of file
</html>
......@@ -143,7 +143,6 @@ line.geometry.computeBoundingSphere();
<li>texture</li>
<li>fog</li>
<li>vertex colors</li>
<li>skinning</li>
<li>morphing</li>
<li>shadow map</li>
<li>alpha test</li>
......
......@@ -132,7 +132,6 @@ line.geometry.attributes.position.needsUpdate = true; // 需要加在第一次
<li>texture</li>
<li>fog</li>
<li>vertex colors</li>
<li>skinning</li>
<li>morphing</li>
<li>shadow map</li>
<li>alpha test</li>
......
......@@ -163,7 +163,6 @@
function createMesh( geometry, bones ) {
const material = new MeshPhongMaterial( {
skinning: true,
color: 0x156289,
emissive: 0x072534,
side: DoubleSide,
......
......@@ -262,16 +262,6 @@ function SidebarMaterial( editor ) {
container.add( materialDepthPackingRow );
// skinning
var materialSkinningRow = new UIRow();
var materialSkinning = new UICheckbox( false ).onChange( update );
materialSkinningRow.add( new UIText( strings.getKey( 'sidebar/material/skinning' ) ).setWidth( '90px' ) );
materialSkinningRow.add( materialSkinning );
container.add( materialSkinningRow );
// map
var materialMapRow = new UIRow();
......@@ -751,12 +741,6 @@ function SidebarMaterial( editor ) {
}
if ( material.skinning !== undefined && material.skinning !== materialSkinning.getValue() ) {
editor.execute( new SetMaterialValueCommand( editor, currentObject, 'skinning', materialSkinning.getValue(), currentMaterialSlot ) );
}
if ( material.map !== undefined ) {
var mapEnabled = materialMapEnabled.getValue() === true;
......@@ -1256,7 +1240,6 @@ function SidebarMaterial( editor ) {
'vertexColors': materialVertexColorsRow,
'vertexTangents': materialVertexTangentsRow,
'depthPacking': materialDepthPackingRow,
'skinning': materialSkinningRow,
'map': materialMapRow,
'matcap': materialMatcapMapRow,
'alphaMap': materialAlphaMapRow,
......@@ -1438,12 +1421,6 @@ function SidebarMaterial( editor ) {
}
if ( material.skinning !== undefined ) {
materialSkinning.setValue( material.skinning );
}
if ( material.map !== undefined ) {
materialMapEnabled.setValue( material.map !== null );
......
......@@ -250,7 +250,6 @@ function Strings( config ) {
'sidebar/material/clearcoatroughness': 'Clearcoat Roughness',
'sidebar/material/vertexcolors': 'Vertex Colors',
'sidebar/material/vertextangents': 'Vertex Tangents',
'sidebar/material/skinning': 'Skinning',
'sidebar/material/matcap': 'Matcap',
'sidebar/material/map': 'Map',
'sidebar/material/alphamap': 'Alpha Map',
......@@ -585,7 +584,6 @@ function Strings( config ) {
'sidebar/material/clearcoatroughness': 'Rugosité du vernis',
'sidebar/material/vertexcolors': 'Couleurs aux Sommets',
'sidebar/material/vertextangents': 'Tangentes aux sommets',
'sidebar/material/skinning': 'Skinning',
'sidebar/material/matcap': 'Matcap',
'sidebar/material/map': 'Texture',
'sidebar/material/alphamap': 'Texture de transparence',
......@@ -920,7 +918,6 @@ function Strings( config ) {
'sidebar/material/clearcoatroughness': '透明图层粗糙度',
'sidebar/material/vertexcolors': '顶点颜色',
'sidebar/material/vertextangents': '顶点切线',
'sidebar/material/skinning': '皮肤',
'sidebar/material/matcap': '材质捕获',
'sidebar/material/map': '贴图',
'sidebar/material/alphamap': '透明贴图',
......
......@@ -2161,10 +2161,6 @@
"!type": "boolean",
"!doc": "This setting might not have any effect when used with certain renderers."
},
"skinning": {
"!type": "bool",
"!doc": "Define whether the material uses skinning. Default is false."
},
"morphTargets": {
"!type": "bool",
"!doc": "Define whether the material uses morphTargets. Default is false."
......@@ -2300,10 +2296,6 @@
"!type": "boolean",
"!doc": "This setting might not have any effect when used with certain renderers."
},
"skinning": {
"!type": "bool",
"!doc": "Define whether the material uses skinning. Default is *false*."
},
"morphTargets": {
"!type": "bool",
"!doc": "Define whether the material uses morphTargets. Default is *false*."
......@@ -2444,10 +2436,6 @@
"!type": "bool",
"!doc": "This setting might not have any effect when used with certain renderers."
},
"skinning": {
"!type": "bool",
"!doc": "Define whether the material uses skinning. Default is *false*."
},
"morphTargets": {
"!type": "bool",
"!doc": "Define whether the material uses morphTargets. Default is *false*."
......@@ -2551,10 +2539,6 @@
"!type": "bool",
"!doc": "Define how the vertices are colored, by defining how the *colors* attribute gets populated. Default is false."
},
"skinning": {
"!type": "bool",
"!doc": "Define whether the material uses skinning; true to pass skinning attributes to the shader. Default is false."
},
"morphTargets": {
"!type": "bool",
"!doc": "Defines whether the material uses morphTargets; true morphTarget attributes to this shader"
......
......@@ -243,7 +243,6 @@
if ( material.name === 'invisible' ) return;
const outlineParameters = originalMaterial.userData.outlineParameters;
material.skinning = originalMaterial.skinning;
material.morphTargets = originalMaterial.morphTargets;
material.morphNormals = originalMaterial.morphNormals;
material.fog = originalMaterial.fog;
......
......@@ -3439,18 +3439,7 @@
} // regard skinning
const skinning = geometry.data.attributes.skinIndex !== undefined;
if ( skinning ) {
for ( let i = 0, l = materials.length; i < l; i ++ ) {
materials[ i ].skinning = true;
}
} // choose between a single or multi materials (material array)
const skinning = geometry.data.attributes.skinIndex !== undefined; // choose between a single or multi materials (material array)
const material = materials.length === 1 ? materials[ 0 ] : materials; // now create a specific 3D object
......
......@@ -1157,11 +1157,6 @@
if ( geometry.FBX_Deformer ) {
materials.forEach( function ( material ) {
material.skinning = true;
} );
model = new THREE.SkinnedMesh( geometry, material );
model.normalizeSkinWeights();
......
......@@ -2418,7 +2418,6 @@
const useVertexTangents = geometry.attributes.tangent !== undefined;
const useVertexColors = geometry.attributes.color !== undefined;
const useFlatShading = geometry.attributes.normal === undefined;
const useSkinning = mesh.isSkinnedMesh === true;
const useMorphTargets = Object.keys( geometry.morphAttributes ).length > 0;
const useMorphNormals = useMorphTargets && geometry.morphAttributes.normal !== undefined;
......@@ -2460,11 +2459,10 @@
} // Clone the material if it will be modified
if ( useVertexTangents || useVertexColors || useFlatShading || useSkinning || useMorphTargets ) {
if ( useVertexTangents || useVertexColors || useFlatShading || useMorphTargets ) {
let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
if ( useSkinning ) cacheKey += 'skinning:';
if ( useVertexTangents ) cacheKey += 'vertex-tangents:';
if ( useVertexColors ) cacheKey += 'vertex-colors:';
if ( useFlatShading ) cacheKey += 'flat-shading:';
......@@ -2475,7 +2473,6 @@
if ( ! cachedMaterial ) {
cachedMaterial = material.clone();
if ( useSkinning ) cachedMaterial.skinning = true;
if ( useVertexColors ) cachedMaterial.vertexColors = true;
if ( useFlatShading ) cachedMaterial.flatShading = true;
if ( useMorphTargets ) cachedMaterial.morphTargets = true;
......
......@@ -956,7 +956,6 @@
params.emissive = new THREE.Color().fromArray( material.ambient );
params.transparent = params.opacity !== 1.0; //
params.skinning = geometry.bones.length > 0 ? true : false;
params.morphTargets = geometry.morphTargets.length > 0 ? true : false;
params.fog = true; // blend
......
......@@ -333,7 +333,6 @@ class OutlineEffect {
const outlineParameters = originalMaterial.userData.outlineParameters;
material.skinning = originalMaterial.skinning;
material.morphTargets = originalMaterial.morphTargets;
material.morphNormals = originalMaterial.morphNormals;
material.fog = originalMaterial.fog;
......
......@@ -3684,16 +3684,6 @@ class ColladaLoader extends Loader {
const skinning = ( geometry.data.attributes.skinIndex !== undefined );
if ( skinning ) {
for ( let i = 0, l = materials.length; i < l; i ++ ) {
materials[ i ].skinning = true;
}
}
// choose between a single or multi materials (material array)
const material = ( materials.length === 1 ) ? materials[ 0 ] : materials;
......
......@@ -1261,12 +1261,6 @@ class FBXTreeParser {
if ( geometry.FBX_Deformer ) {
materials.forEach( function ( material ) {
material.skinning = true;
} );
model = new SkinnedMesh( geometry, material );
model.normalizeSkinWeights();
......
......@@ -2682,7 +2682,6 @@ class GLTFParser {
const useVertexTangents = geometry.attributes.tangent !== undefined;
const useVertexColors = geometry.attributes.color !== undefined;
const useFlatShading = geometry.attributes.normal === undefined;
const useSkinning = mesh.isSkinnedMesh === true;
const useMorphTargets = Object.keys( geometry.morphAttributes ).length > 0;
const useMorphNormals = useMorphTargets && geometry.morphAttributes.normal !== undefined;
......@@ -2727,12 +2726,11 @@ class GLTFParser {
}
// Clone the material if it will be modified
if ( useVertexTangents || useVertexColors || useFlatShading || useSkinning || useMorphTargets ) {
if ( useVertexTangents || useVertexColors || useFlatShading || useMorphTargets ) {
let cacheKey = 'ClonedMaterial:' + material.uuid + ':';
if ( material.isGLTFSpecularGlossinessMaterial ) cacheKey += 'specular-glossiness:';
if ( useSkinning ) cacheKey += 'skinning:';
if ( useVertexTangents ) cacheKey += 'vertex-tangents:';
if ( useVertexColors ) cacheKey += 'vertex-colors:';
if ( useFlatShading ) cacheKey += 'flat-shading:';
......@@ -2745,7 +2743,6 @@ class GLTFParser {
cachedMaterial = material.clone();
if ( useSkinning ) cachedMaterial.skinning = true;
if ( useVertexColors ) cachedMaterial.vertexColors = true;
if ( useFlatShading ) cachedMaterial.flatShading = true;
if ( useMorphTargets ) cachedMaterial.morphTargets = true;
......
......@@ -1100,7 +1100,6 @@ class MaterialBuilder {
//
params.skinning = geometry.bones.length > 0 ? true : false;
params.morphTargets = geometry.morphTargets.length > 0 ? true : false;
params.fog = true;
......
......@@ -191,7 +191,6 @@ class NodeMaterial extends ShaderMaterial {
if ( this.premultipliedAlpha === true ) data.premultipliedAlpha = this.premultipliedAlpha;
if ( this.morphTargets === true ) data.morphTargets = true;
if ( this.skinning === true ) data.skinning = true;
if ( this.visible === false ) data.visible = false;
if ( JSON.stringify( this.userData ) !== '{}' ) data.userData = this.userData;
......
......@@ -62,7 +62,6 @@
THREE.Material.prototype.copy.call( material, object.material[ i ] );
material.color.copy( object.material[ i ].color );
material.map = object.material[ i ].map;
material.skinning = object.material[ i ].skinning;
material.morphTargets = object.material[ i ].morphTargets;
material.morphNormals = object.material[ i ].morphNormals;
object.material[ i ] = material;
......@@ -75,7 +74,6 @@
THREE.Material.prototype.copy.call( material, object.material );
material.color.copy( object.material.color );
material.map = object.material.map;
material.skinning = object.material.skinning;
material.morphTargets = object.material.morphTargets;
material.morphNormals = object.material.morphNormals;
object.material = material;
......
......@@ -118,7 +118,6 @@ class MaterialLoader extends Loader {
if ( json.polygonOffsetFactor !== undefined ) material.polygonOffsetFactor = json.polygonOffsetFactor;
if ( json.polygonOffsetUnits !== undefined ) material.polygonOffsetUnits = json.polygonOffsetUnits;
if ( json.skinning !== undefined ) material.skinning = json.skinning;
if ( json.morphTargets !== undefined ) material.morphTargets = json.morphTargets;
if ( json.morphNormals !== undefined ) material.morphNormals = json.morphNormals;
if ( json.dithering !== undefined ) material.dithering = json.dithering;
......
......@@ -314,7 +314,6 @@ Material.prototype = Object.assign( Object.create( EventDispatcher.prototype ),
if ( this.morphTargets === true ) data.morphTargets = true;
if ( this.morphNormals === true ) data.morphNormals = true;
if ( this.skinning === true ) data.skinning = true;
if ( this.flatShading === true ) data.flatShading = this.flatShading;
......
......@@ -29,7 +29,6 @@ import { Color } from '../math/Color.js';
* wireframe: <boolean>,
* wireframeLinewidth: <float>,
*
* skinning: <bool>,
* morphTargets: <bool>
* }
*/
......@@ -66,7 +65,6 @@ class MeshBasicMaterial extends Material {
this.wireframeLinecap = 'round';
this.wireframeLinejoin = 'round';
this.skinning = false;
this.morphTargets = false;
this.setValues( parameters );
......@@ -101,7 +99,6 @@ class MeshBasicMaterial extends Material {
this.wireframeLinecap = source.wireframeLinecap;
this.wireframeLinejoin = source.wireframeLinejoin;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
return this;
......
......@@ -29,7 +29,6 @@ class MeshDepthMaterial extends Material {
this.depthPacking = BasicDepthPacking;
this.skinning = false;
this.morphTargets = false;
this.map = null;
......@@ -55,7 +54,6 @@ class MeshDepthMaterial extends Material {
this.depthPacking = source.depthPacking;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.map = source.map;
......
......@@ -8,7 +8,6 @@ import { Vector3 } from '../math/Vector3.js';
* nearDistance: <float>,
* farDistance: <float>,
*
* skinning: <bool>,
* morphTargets: <bool>,
*
* map: new THREE.Texture( <Image> ),
......@@ -34,7 +33,6 @@ class MeshDistanceMaterial extends Material {
this.nearDistance = 1;
this.farDistance = 1000;
this.skinning = false;
this.morphTargets = false;
this.map = null;
......@@ -59,7 +57,6 @@ class MeshDistanceMaterial extends Material {
this.nearDistance = source.nearDistance;
this.farDistance = source.farDistance;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.map = source.map;
......
......@@ -31,7 +31,6 @@ import { Color } from '../math/Color.js';
* wireframe: <boolean>,
* wireframeLinewidth: <float>,
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>
* }
......@@ -73,7 +72,6 @@ class MeshLambertMaterial extends Material {
this.wireframeLinecap = 'round';
this.wireframeLinejoin = 'round';
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
......@@ -113,7 +111,6 @@ class MeshLambertMaterial extends Material {
this.wireframeLinecap = source.wireframeLinecap;
this.wireframeLinejoin = source.wireframeLinejoin;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -25,7 +25,6 @@ import { Color } from '../math/Color.js';
*
* alphaMap: new THREE.Texture( <Image> ),
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>
*
......@@ -62,7 +61,6 @@ class MeshMatcapMaterial extends Material {
this.alphaMap = null;
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
......@@ -98,7 +96,6 @@ class MeshMatcapMaterial extends Material {
this.alphaMap = source.alphaMap;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -20,7 +20,6 @@ import { Vector2 } from '../math/Vector2.js';
* wireframe: <boolean>,
* wireframeLinewidth: <float>
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>,
*
......@@ -52,7 +51,6 @@ class MeshNormalMaterial extends Material {
this.fog = false;
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
......@@ -80,7 +78,6 @@ class MeshNormalMaterial extends Material {
this.wireframe = source.wireframe;
this.wireframeLinewidth = source.wireframeLinewidth;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -45,7 +45,6 @@ import { Color } from '../math/Color.js';
* wireframe: <boolean>,
* wireframeLinewidth: <float>,
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>,
*
......@@ -102,7 +101,6 @@ class MeshPhongMaterial extends Material {
this.wireframeLinecap = 'round';
this.wireframeLinejoin = 'round';
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
......@@ -157,7 +155,6 @@ class MeshPhongMaterial extends Material {
this.wireframeLinecap = source.wireframeLinecap;
this.wireframeLinejoin = source.wireframeLinejoin;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -47,7 +47,6 @@ import { Color } from '../math/Color.js';
* wireframe: <boolean>,
* wireframeLinewidth: <float>,
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>,
*
......@@ -108,7 +107,6 @@ class MeshStandardMaterial extends Material {
this.wireframeLinecap = 'round';
this.wireframeLinejoin = 'round';
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
......@@ -169,7 +167,6 @@ class MeshStandardMaterial extends Material {
this.wireframeLinecap = source.wireframeLinecap;
this.wireframeLinejoin = source.wireframeLinejoin;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -36,7 +36,6 @@ import { Color } from '../math/Color.js';
* wireframe: <boolean>,
* wireframeLinewidth: <float>,
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>
* }
......@@ -85,7 +84,6 @@ class MeshToonMaterial extends Material {
this.wireframeLinecap = 'round';
this.wireframeLinejoin = 'round';
this.skinning = false;
this.morphTargets = false;
this.morphNormals = false;
......@@ -130,7 +128,6 @@ class MeshToonMaterial extends Material {
this.wireframeLinecap = source.wireframeLinecap;
this.wireframeLinejoin = source.wireframeLinejoin;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -17,7 +17,6 @@ import default_fragment from '../renderers/shaders/ShaderChunk/default_fragment.
*
* lights: <bool>,
*
* skinning: <bool>,
* morphTargets: <bool>,
* morphNormals: <bool>
* }
......@@ -46,7 +45,6 @@ class ShaderMaterial extends Material {
this.lights = false; // set to use scene lights
this.clipping = false; // set to use user-defined clipping planes
this.skinning = false; // set to use skinning attribute streams
this.morphTargets = false; // set to use morph targets
this.morphNormals = false; // set to use morph normals
......@@ -101,8 +99,6 @@ class ShaderMaterial extends Material {
this.lights = source.lights;
this.clipping = source.clipping;
this.skinning = source.skinning;
this.morphTargets = source.morphTargets;
this.morphNormals = source.morphNormals;
......
......@@ -366,7 +366,7 @@ function checkBufferGeometryIntersection( object, material, raycaster, ray, posi
}
if ( object.isSkinnedMesh && material.skinning ) {
if ( object.isSkinnedMesh ) {
object.boneTransform( a, _vA );
object.boneTransform( b, _vB );
......
......@@ -1430,6 +1430,7 @@ function WebGLRenderer( parameters ) {
materialProperties.outputEncoding = parameters.outputEncoding;
materialProperties.instancing = parameters.instancing;
materialProperties.skinning = parameters.skinning;
materialProperties.numClippingPlanes = parameters.numClippingPlanes;
materialProperties.numIntersection = parameters.numClipIntersection;
materialProperties.vertexAlphas = parameters.vertexAlphas;
......@@ -1490,6 +1491,14 @@ function WebGLRenderer( parameters ) {
needsProgramChange = true;
} else if ( object.isSkinnedMesh && materialProperties.skinning === false ) {
needsProgramChange = true;
} else if ( ! object.isSkinnedMesh && materialProperties.skinning === true ) {
needsProgramChange = true;
} else if ( materialProperties.envMap !== envMap ) {
needsProgramChange = true;
......@@ -1612,7 +1621,7 @@ function WebGLRenderer( parameters ) {
material.isMeshStandardMaterial ||
material.isShaderMaterial ||
material.isShadowMaterial ||
material.skinning ) {
object.isSkinnedMesh ) {
p_uniforms.setValue( _gl, 'viewMatrix', camera.matrixWorldInverse );
......@@ -1624,7 +1633,7 @@ function WebGLRenderer( parameters ) {
// auto-setting of texture unit for bone texture must go before other textures
// otherwise textures used for skinning can take over texture units reserved for other material textures
if ( material.skinning ) {
if ( object.isSkinnedMesh ) {
p_uniforms.setOptional( _gl, object, 'bindMatrix' );
p_uniforms.setOptional( _gl, object, 'bindMatrixInverse' );
......
......@@ -221,7 +221,7 @@ function WebGLPrograms( renderer, cubemaps, extensions, capabilities, bindingSta
sizeAttenuation: material.sizeAttenuation,
logarithmicDepthBuffer: logarithmicDepthBuffer,
skinning: material.skinning && maxBones > 0,
skinning: object.isSkinnedMesh === true && maxBones > 0,
maxBones: maxBones,
useVertexTexture: floatVertexTextures,
......
......@@ -228,9 +228,9 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
}
function getDepthMaterialVariant( useMorphing, useSkinning, useInstancing ) {
function getDepthMaterialVariant( useMorphing ) {
const index = useMorphing << 0 | useSkinning << 1 | useInstancing << 2;
const index = useMorphing << 0;
let material = _depthMaterials[ index ];
......@@ -240,8 +240,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
depthPacking: RGBADepthPacking,
morphTargets: useMorphing,
skinning: useSkinning
morphTargets: useMorphing
} );
......@@ -253,9 +252,9 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
}
function getDistanceMaterialVariant( useMorphing, useSkinning, useInstancing ) {
function getDistanceMaterialVariant( useMorphing ) {
const index = useMorphing << 0 | useSkinning << 1 | useInstancing << 2;
const index = useMorphing << 0;
let material = _distanceMaterials[ index ];
......@@ -263,8 +262,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
material = new MeshDistanceMaterial( {
morphTargets: useMorphing,
skinning: useSkinning
morphTargets: useMorphing
} );
......@@ -300,25 +298,7 @@ function WebGLShadowMap( _renderer, _objects, _capabilities ) {
}
let useSkinning = false;
if ( object.isSkinnedMesh === true ) {
if ( material.skinning === true ) {
useSkinning = true;
} else {
console.warn( 'THREE.WebGLShadowMap: THREE.SkinnedMesh with material.skinning set to false:', object );
}
}
const useInstancing = object.isInstancedMesh === true;
result = getMaterialVariant( useMorphing, useSkinning, useInstancing );
result = getMaterialVariant( useMorphing );
} else {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册