From 90683b0f42f30ffa04143e69b3738ac1ffb86236 Mon Sep 17 00:00:00 2001 From: Felix Palmer Date: Thu, 21 Mar 2024 16:56:02 +0100 Subject: [PATCH] Set blendConstant on RenderPass --- modules/core/src/lib/layer.ts | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/core/src/lib/layer.ts b/modules/core/src/lib/layer.ts index ed3d239f48e..824fc4141ca 100644 --- a/modules/core/src/lib/layer.ts +++ b/modules/core/src/lib/layer.ts @@ -1078,18 +1078,19 @@ export default abstract class Layer extends Component< for (const model of this.getModels()) { model.setParameters(parameters); } + if (parameters.blendColor) { + context.renderPass.setParameters({blendConstant: parameters.blendColor}); + } // Call subclass lifecycle method - context.device.withParametersWebGL(parameters, () => { - const opts = {renderPass, moduleParameters, uniforms, parameters, context}; + const opts = {renderPass, moduleParameters, uniforms, parameters, context}; - // extensions - for (const extension of this.props.extensions) { - extension.draw.call(this, opts, extension); - } + // extensions + for (const extension of this.props.extensions) { + extension.draw.call(this, opts, extension); + } - this.draw(opts); - }); + this.draw(opts); } finally { this.props = currentProps; }