Add textureUnit parameter to Utils.updateLightingUniforms.

This allows us to use lighting in any texture situation.
This commit is contained in:
Ben Richards 2024-08-22 12:38:05 +12:00
parent 1421058f4d
commit 66bbf8ea4a
3 changed files with 5 additions and 1 deletions

View file

@ -172,6 +172,7 @@ module.exports = {
* @param {Phaser.Renderer.WebGL.WebGLRenderer} renderer - The WebGLRenderer instance.
* @param {Phaser.Renderer.WebGL.DrawingContext} drawingContext - The DrawingContext instance.
* @param {Phaser.Renderer.WebGL.ShaderProgramManager} programManager - The ShaderProgramManager instance.
* @param {number} textureUnit - The texture unit to use for the normal map.
* @param {Phaser.Math.Vector2} vec - A Vector2 instance.
* @param {boolean} [selfShadow] - Whether to enable self-shadowing.
* @param {number} [selfShadowPenumbra] - The penumbra value for self-shadowing.
@ -182,6 +183,7 @@ module.exports = {
renderer,
drawingContext,
programManager,
textureUnit,
vec,
selfShadow,
selfShadowPenumbra,
@ -200,7 +202,7 @@ module.exports = {
{
programManager.setUniform(
'uNormSampler',
1
textureUnit
);
programManager.setUniform(

View file

@ -255,6 +255,7 @@ var BatchHandlerQuad = new Class({
this.manager.renderer,
drawingContext,
programManager,
1,
this._lightVector,
renderOptions.selfShadow,
renderOptions.selfShadowThreshold,

View file

@ -147,6 +147,7 @@ var BatchHandlerTriFlat = new Class({
this.manager.renderer,
drawingContext,
programManager,
1,
this._lightVector
);