提交 04ffa8bf 编写于 作者: M Mr.doob

WebGLRenderer: store shadows/shadowsPointLight in _lights. See #7440.

上级 5f5fee28
......@@ -114,7 +114,10 @@ THREE.WebGLRenderer = function ( parameters ) {
directional: [],
point: [],
spot: [],
hemi: []
hemi: [],
shadows: 0,
shadowsPointLight: 0
},
......@@ -2587,6 +2590,9 @@ THREE.WebGLRenderer = function ( parameters ) {
spotLength = 0,
hemiLength = 0;
_lights.shadows = 0;
_lights.shadowsPointLight = 0;
for ( l = 0, ll = lights.length; l < ll; l ++ ) {
light = lights[ l ];
......@@ -2620,6 +2626,7 @@ THREE.WebGLRenderer = function ( parameters ) {
_lights.directional[ directionalLength ++ ] = uniforms;
if ( light.castShadow ) _lights.shadows ++;
} else if ( light instanceof THREE.PointLight ) {
......@@ -2643,6 +2650,13 @@ THREE.WebGLRenderer = function ( parameters ) {
_lights.point[ pointLength ++ ] = uniforms;
if ( light.castShadow ) {
_lights.shadows ++;
_lights.shadowsPointLight ++;
}
} else if ( light instanceof THREE.SpotLight ) {
if( ! light.__webglUniforms ) {
......@@ -2675,6 +2689,8 @@ THREE.WebGLRenderer = function ( parameters ) {
_lights.spot[ spotLength ++ ] = uniforms;
if ( light.castShadow ) _lights.shadows ++;
} else if ( light instanceof THREE.HemisphereLight ) {
if( ! light.__webglUniforms ) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册