|
@@ -141,8 +141,6 @@ function setValue1f( gl, v ) {
|
|
|
|
|
|
this.cache[ 0 ] = v;
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue1i( gl, v ) {
|
|
@@ -153,8 +151,6 @@ function setValue1i( gl, v ) {
|
|
|
|
|
|
this.cache[ 0 ] = v;
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Single float vector (from flat array or THREE.VectorN)
|
|
@@ -181,8 +177,6 @@ function setValue2fv( gl, v ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue3fv( gl, v ) {
|
|
@@ -225,8 +219,6 @@ function setValue3fv( gl, v ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue4fv( gl, v ) {
|
|
@@ -261,8 +253,6 @@ function setValue4fv( gl, v ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Single matrix (from flat array or MatrixN)
|
|
@@ -283,8 +273,6 @@ function setValue2fm( gl, v ) {
|
|
|
this.cache[ 2 ] = data[ 2 ];
|
|
|
this.cache[ 3 ] = data[ 3 ];
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue3fm( gl, v ) {
|
|
@@ -313,8 +301,6 @@ function setValue3fm( gl, v ) {
|
|
|
this.cache[ 7 ] = data[ 7 ];
|
|
|
this.cache[ 8 ] = data[ 8 ];
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue4fm( gl, v ) {
|
|
@@ -357,8 +343,6 @@ function setValue4fm( gl, v ) {
|
|
|
this.cache[ 14 ] = data[ 14 ];
|
|
|
this.cache[ 15 ] = data[ 15 ];
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Single texture (2D / Cube)
|
|
@@ -371,8 +355,6 @@ function setValueT1( gl, v, renderer ) {
|
|
|
|
|
|
gl.uniform1i( this.addr, unit );
|
|
|
this.cache[ 0 ] = unit;
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
renderer.setTexture2D( v || emptyTexture, unit );
|
|
@@ -387,8 +369,6 @@ function setValueT6( gl, v, renderer ) {
|
|
|
|
|
|
gl.uniform1i( this.addr, unit );
|
|
|
this.cache[ 0 ] = unit;
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
renderer.setTextureCube( v || emptyCubeTexture, unit );
|
|
@@ -406,8 +386,6 @@ function setValue2iv( gl, v ) {
|
|
|
this.cache[ 0 ] = v[ 0 ];
|
|
|
this.cache[ 1 ] = v[ 1 ];
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue3iv( gl, v ) {
|
|
@@ -422,8 +400,6 @@ function setValue3iv( gl, v ) {
|
|
|
this.cache[ 1 ] = v[ 1 ];
|
|
|
this.cache[ 2 ] = v[ 2 ];
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValue4iv( gl, v ) {
|
|
@@ -440,8 +416,6 @@ function setValue4iv( gl, v ) {
|
|
|
this.cache[ 2 ] = v[ 2 ];
|
|
|
this.cache[ 3 ] = v[ 3 ];
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Helper to pick the right setter for the singular case
|
|
@@ -477,15 +451,11 @@ function setValue1fv( gl, v ) {
|
|
|
|
|
|
gl.uniform1fv( this.addr, v );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
function setValue1iv( gl, v ) {
|
|
|
|
|
|
gl.uniform1iv( this.addr, v );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Array of vectors (flat or from THREE classes)
|
|
@@ -494,24 +464,18 @@ function setValueV2a( gl, v ) {
|
|
|
|
|
|
gl.uniform2fv( this.addr, flatten( v, this.size, 2 ) );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValueV3a( gl, v ) {
|
|
|
|
|
|
gl.uniform3fv( this.addr, flatten( v, this.size, 3 ) );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValueV4a( gl, v ) {
|
|
|
|
|
|
gl.uniform4fv( this.addr, flatten( v, this.size, 4 ) );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Array of matrices (flat or from THREE clases)
|
|
@@ -520,24 +484,18 @@ function setValueM2a( gl, v ) {
|
|
|
|
|
|
gl.uniformMatrix2fv( this.addr, false, flatten( v, this.size, 4 ) );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValueM3a( gl, v ) {
|
|
|
|
|
|
gl.uniformMatrix3fv( this.addr, false, flatten( v, this.size, 9 ) );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValueM4a( gl, v ) {
|
|
|
|
|
|
gl.uniformMatrix4fv( this.addr, false, flatten( v, this.size, 16 ) );
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Array of textures (2D / Cube)
|
|
@@ -555,8 +513,6 @@ function setValueT1a( gl, v, renderer ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
function setValueT6a( gl, v, renderer ) {
|
|
@@ -572,8 +528,6 @@ function setValueT6a( gl, v, renderer ) {
|
|
|
|
|
|
}
|
|
|
|
|
|
- this.info.render.uniformUpdates ++;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
// Helper to pick the right setter for a pure (bottom-level) array
|
|
@@ -605,23 +559,21 @@ function getPureArraySetter( type ) {
|
|
|
|
|
|
// --- Uniform Classes ---
|
|
|
|
|
|
-function SingleUniform( id, activeInfo, addr, info ) {
|
|
|
+function SingleUniform( id, activeInfo, addr ) {
|
|
|
|
|
|
this.id = id;
|
|
|
this.addr = addr;
|
|
|
this.cache = [];
|
|
|
- this.info = info;
|
|
|
this.setValue = getSingularSetter( activeInfo.type );
|
|
|
|
|
|
// this.path = activeInfo.name; // DEBUG
|
|
|
|
|
|
}
|
|
|
|
|
|
-function PureArrayUniform( id, activeInfo, addr, info ) {
|
|
|
+function PureArrayUniform( id, activeInfo, addr ) {
|
|
|
|
|
|
this.id = id;
|
|
|
this.addr = addr;
|
|
|
- this.info = info;
|
|
|
this.size = activeInfo.size;
|
|
|
this.setValue = getPureArraySetter( activeInfo.type );
|
|
|
|
|
@@ -635,8 +587,6 @@ function StructuredUniform( id, renderer ) {
|
|
|
|
|
|
UniformContainer.call( this ); // mix-in
|
|
|
|
|
|
- this.renderer = renderer;
|
|
|
-
|
|
|
}
|
|
|
|
|
|
StructuredUniform.prototype.setValue = function ( gl, value ) {
|
|
@@ -701,8 +651,8 @@ function parseUniform( activeInfo, addr, container ) {
|
|
|
// bare name or "pure" bottom-level array "[0]" suffix
|
|
|
|
|
|
addUniform( container, subscript === undefined ?
|
|
|
- new SingleUniform( id, activeInfo, addr, container.renderer.info ) :
|
|
|
- new PureArrayUniform( id, activeInfo, addr, container.renderer.info ) );
|
|
|
+ new SingleUniform( id, activeInfo, addr ) :
|
|
|
+ new PureArrayUniform( id, activeInfo, addr ) );
|
|
|
|
|
|
break;
|
|
|
|
|
@@ -714,7 +664,7 @@ function parseUniform( activeInfo, addr, container ) {
|
|
|
|
|
|
if ( next === undefined ) {
|
|
|
|
|
|
- next = new StructuredUniform( id, container.renderer );
|
|
|
+ next = new StructuredUniform( id );
|
|
|
addUniform( container, next );
|
|
|
|
|
|
}
|