|
@@ -756,7 +756,7 @@ export class Effect implements IDisposable {
|
|
|
/** @hidden */
|
|
|
public _cacheFloat2(uniformName: string, x: number, y: number): boolean {
|
|
|
var cache = this._valueCache[uniformName];
|
|
|
- if (!cache) {
|
|
|
+ if (!cache || cache.length !== 2) {
|
|
|
cache = [x, y];
|
|
|
this._valueCache[uniformName] = cache;
|
|
|
return true;
|
|
@@ -778,7 +778,7 @@ export class Effect implements IDisposable {
|
|
|
/** @hidden */
|
|
|
public _cacheFloat3(uniformName: string, x: number, y: number, z: number): boolean {
|
|
|
var cache = this._valueCache[uniformName];
|
|
|
- if (!cache) {
|
|
|
+ if (!cache || cache.length !== 3) {
|
|
|
cache = [x, y, z];
|
|
|
this._valueCache[uniformName] = cache;
|
|
|
return true;
|
|
@@ -804,7 +804,7 @@ export class Effect implements IDisposable {
|
|
|
/** @hidden */
|
|
|
public _cacheFloat4(uniformName: string, x: number, y: number, z: number, w: number): boolean {
|
|
|
var cache = this._valueCache[uniformName];
|
|
|
- if (!cache) {
|
|
|
+ if (!cache || cache.length !== 4) {
|
|
|
cache = [x, y, z, w];
|
|
|
this._valueCache[uniformName] = cache;
|
|
|
return true;
|
|
@@ -1214,7 +1214,6 @@ export class Effect implements IDisposable {
|
|
|
* @returns this effect.
|
|
|
*/
|
|
|
public setColor3(uniformName: string, color3: IColor3Like): Effect {
|
|
|
-
|
|
|
if (this._cacheFloat3(uniformName, color3.r, color3.g, color3.b)) {
|
|
|
this._engine.setFloat3(this._uniforms[uniformName], color3.r, color3.g, color3.b);
|
|
|
}
|