mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 05:58:30 +00:00
WebGLRenderer.isNewNormalMap
is a new method that returns a boolean if the given parameters are not currently used.
This commit is contained in:
parent
5db55a85d7
commit
85f63c4a19
1 changed files with 17 additions and 1 deletions
|
@ -778,7 +778,7 @@ var WebGLRenderer = new Class({
|
|||
|
||||
gl.bindTexture(gl.TEXTURE_2D, tempTexture);
|
||||
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 0, 0, 255, 255 ]));
|
||||
gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, 1, 1, 0, gl.RGBA, gl.UNSIGNED_BYTE, new Uint8Array([ 255, 255, 255, 255 ]));
|
||||
|
||||
tempTextures[index] = tempTexture;
|
||||
|
||||
|
@ -1416,6 +1416,22 @@ var WebGLRenderer = new Class({
|
|||
return textureSource.glIndex;
|
||||
},
|
||||
|
||||
/**
|
||||
* Checks to see if the given diffuse and normal map textures are already bound, or not.
|
||||
*
|
||||
* @method Phaser.Renderer.WebGL.WebGLRenderer#isNewNormalMap
|
||||
* @since 3.25.0
|
||||
*
|
||||
* @param {WebGLTexture} texture - The WebGL diffuse texture.
|
||||
* @param {WebGLTexture} normalMap - The WebGL normal map texture.
|
||||
*
|
||||
* @return {boolean} Returns `false` if this combination is already set, or `true` if it's a new combination.
|
||||
*/
|
||||
isNewNormalMap: function (texture, normalMap)
|
||||
{
|
||||
return (this.textureZero !== texture || this.normalTexture !== normalMap);
|
||||
},
|
||||
|
||||
/**
|
||||
* Binds a texture directly to texture unit zero then activates it.
|
||||
* If the texture is already at unit zero, it skips the bind.
|
||||
|
|
Loading…
Add table
Reference in a new issue