提交 9fd6d379 编写于 作者: M Mr.doob

WebGLRenderStates: Moved count to WebGLLights.

上级 2e031523
......@@ -100,12 +100,16 @@ function UniformsCache() {
}
function WebGLLights( stateId ) {
var count = 0;
function WebGLLights() {
var cache = new UniformsCache();
var state = {
id: count ++,
hash: '',
ambient: [ 0, 0, 0 ],
......@@ -312,8 +316,7 @@ function WebGLLights( stateId ) {
state.point.length = pointLength;
state.hemi.length = hemiLength;
// TODO (sam-g-steel) why aren't we using join
state.hash = directionalLength + ',' + pointLength + ',' + spotLength + ',' + rectAreaLength + ',' + hemiLength + ',' + shadows.length + ',' + stateId;
state.hash = state.id + ',' + directionalLength + ',' + pointLength + ',' + spotLength + ',' + rectAreaLength + ',' + hemiLength + ',' + shadows.length;
}
......
......@@ -4,13 +4,9 @@
import { WebGLLights } from './WebGLLights.js';
var count = 0;
function WebGLRenderState() {
var id = count ++;
var lights = new WebGLLights( id );
var lights = new WebGLLights();
var lightsArray = [];
var shadowsArray = [];
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册