提交 74b35224 编写于 作者: M Mr.doob

WebGLShadowMap: Reworked useMorphing check code.

上级 1a984f96
......@@ -312,15 +312,19 @@ THREE.WebGLShadowMap = function ( _renderer, _lights, _objects ) {
if ( ! customMaterial ) {
var useMorphing, morphTargets;
var useMorphing = false;
if ( material.morphTargets ) {
if ( geometry instanceof THREE.Geometry ) morphTargets = geometry.morphTargets;
if ( geometry instanceof THREE.BufferGeometry ) {
if ( geometry instanceof THREE.BufferGeometry && geometry.morphAttributes !== undefined ) morphTargets = geometry.morphAttributes.position;
useMorphing = geometry.morphAttributes && geometry.morphAttributes.position && geometry.morphAttributes.position.length > 0;
if ( morphTargets !== undefined && morphTargets.length > 0 ) useMorphing = true;
} else if ( geometry instanceof THREE.Geometry ) {
useMorphing = geometry.morphTargets && geometry.morphTargets.length > 0;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册