提交 c1f34284 编写于 作者: A alteredq

Removed maxLights parameter from WebGLRenderer.

It's now up to the application layer to deal with system specific shader limits.

Fixes #2477
上级 17c9e727
......@@ -15820,9 +15820,7 @@ THREE.WebGLRenderer = function ( parameters ) {
_preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false,
_clearColor = parameters.clearColor !== undefined ? new THREE.Color( parameters.clearColor ) : new THREE.Color( 0x000000 ),
_clearAlpha = parameters.clearAlpha !== undefined ? parameters.clearAlpha : 0,
_maxLights = parameters.maxLights !== undefined ? parameters.maxLights : 4;
_clearAlpha = parameters.clearAlpha !== undefined ? parameters.clearAlpha : 0;
// public properties
......@@ -22697,9 +22695,9 @@ THREE.WebGLRenderer = function ( parameters ) {
function allocateLights ( lights ) {
var l, ll, light, dirLights, pointLights, spotLights, hemiLights, maxDirLights, maxPointLights, maxSpotLights, maxHemiLights;
var l, ll, light, dirLights, pointLights, spotLights, hemiLights;
dirLights = pointLights = spotLights = hemiLights = maxDirLights = maxPointLights = maxSpotLights = maxHemiLights = 0;
dirLights = pointLights = spotLights = hemiLights = 0;
for ( l = 0, ll = lights.length; l < ll; l ++ ) {
......@@ -22714,26 +22712,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
if ( ( pointLights + spotLights + dirLights + hemiLights) <= _maxLights ) {
maxDirLights = dirLights;
maxPointLights = pointLights;
maxSpotLights = spotLights;
maxHemiLights = hemiLights;
} else {
maxDirLights = Math.ceil( _maxLights * dirLights / ( pointLights + dirLights ) );
maxPointLights = _maxLights - maxDirLights;
// these are not really correct
maxSpotLights = maxPointLights;
maxHemiLights = maxDirLights;
}
return { 'directional' : maxDirLights, 'point' : maxPointLights, 'spot': maxSpotLights, 'hemi': maxHemiLights };
return { 'directional' : dirLights, 'point' : pointLights, 'spot': spotLights, 'hemi': hemiLights };
};
......
因为 它太大了无法显示 source diff 。你可以改为 查看blob
......@@ -171,7 +171,7 @@
// renderer
renderer = new THREE.WebGLRenderer( { antialias: true, maxLights: 8, alpha: true } );
renderer = new THREE.WebGLRenderer( { antialias: true, alpha: true } );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setClearColor( scene.fog.color, 1 );
......
......@@ -221,7 +221,7 @@
// RENDERER
renderer = new THREE.WebGLRenderer( { maxLights: 10, antialias: false, clearColor: 0x030303, clearAlpha: 1 } );
renderer = new THREE.WebGLRenderer( { antialias: false, clearColor: 0x030303, clearAlpha: 1 } );
renderer.setSize( window.innerWidth, window.innerHeight );
renderer.setClearColor( scene.fog.color, 1 );
......
......@@ -199,7 +199,7 @@
//
renderer = new THREE.WebGLRenderer( { maxLights: 8 } );
renderer = new THREE.WebGLRenderer();
renderer.setSize( window.innerWidth, window.innerHeight );
container.appendChild( renderer.domElement );
......
......@@ -22,9 +22,7 @@ THREE.WebGLRenderer = function ( parameters ) {
_preserveDrawingBuffer = parameters.preserveDrawingBuffer !== undefined ? parameters.preserveDrawingBuffer : false,
_clearColor = parameters.clearColor !== undefined ? new THREE.Color( parameters.clearColor ) : new THREE.Color( 0x000000 ),
_clearAlpha = parameters.clearAlpha !== undefined ? parameters.clearAlpha : 0,
_maxLights = parameters.maxLights !== undefined ? parameters.maxLights : 4;
_clearAlpha = parameters.clearAlpha !== undefined ? parameters.clearAlpha : 0;
// public properties
......@@ -6899,9 +6897,9 @@ THREE.WebGLRenderer = function ( parameters ) {
function allocateLights ( lights ) {
var l, ll, light, dirLights, pointLights, spotLights, hemiLights, maxDirLights, maxPointLights, maxSpotLights, maxHemiLights;
var l, ll, light, dirLights, pointLights, spotLights, hemiLights;
dirLights = pointLights = spotLights = hemiLights = maxDirLights = maxPointLights = maxSpotLights = maxHemiLights = 0;
dirLights = pointLights = spotLights = hemiLights = 0;
for ( l = 0, ll = lights.length; l < ll; l ++ ) {
......@@ -6916,26 +6914,7 @@ THREE.WebGLRenderer = function ( parameters ) {
}
if ( ( pointLights + spotLights + dirLights + hemiLights) <= _maxLights ) {
maxDirLights = dirLights;
maxPointLights = pointLights;
maxSpotLights = spotLights;
maxHemiLights = hemiLights;
} else {
maxDirLights = Math.ceil( _maxLights * dirLights / ( pointLights + dirLights ) );
maxPointLights = _maxLights - maxDirLights;
// these are not really correct
maxSpotLights = maxPointLights;
maxHemiLights = maxDirLights;
}
return { 'directional' : maxDirLights, 'point' : maxPointLights, 'spot': maxSpotLights, 'hemi': maxHemiLights };
return { 'directional' : dirLights, 'point' : pointLights, 'spot': spotLights, 'hemi': hemiLights };
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册