Skip to content

Commit 3344fc1

Browse files
committed
Added resetUniform method
1 parent 103b91a commit 3344fc1

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

src/renderer/webgl/WebGLShader.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -418,6 +418,31 @@ var WebGLShader = new Class({
418418
return this.uniforms.hasOwnProperty(name);
419419
},
420420

421+
/**
422+
* Resets the cached values of the given uniform.
423+
*
424+
* @method Phaser.Renderer.WebGL.WebGLShader#resetUniform
425+
* @since 3.50.0
426+
*
427+
* @param {string} name - The name of the uniform to reset.
428+
*
429+
* @return {this} This WebGLShader instance.
430+
*/
431+
resetUniform: function (name)
432+
{
433+
var uniform = this.uniforms[name];
434+
435+
if (uniform)
436+
{
437+
uniform.value1 = null;
438+
uniform.value2 = null;
439+
uniform.value3 = null;
440+
uniform.value4 = null;
441+
}
442+
443+
return this;
444+
},
445+
421446
/**
422447
* Sets the given uniform value/s based on the name and GL function.
423448
*

0 commit comments

Comments
 (0)