From a465e44f297842e5df2cf4bf95e3d8af409071b7 Mon Sep 17 00:00:00 2001 From: Perminder Singh Date: Wed, 29 Nov 2023 19:50:36 +0530 Subject: [PATCH] lights() support on framebuffer block --- src/webgl/p5.Geometry.js | 2 +- src/webgl/p5.RendererGL.js | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/webgl/p5.Geometry.js b/src/webgl/p5.Geometry.js index 17f2fffe82..76c8ed8ad4 100644 --- a/src/webgl/p5.Geometry.js +++ b/src/webgl/p5.Geometry.js @@ -103,7 +103,7 @@ p5.Geometry = class Geometry { * let points = []; * * function setup() { - * createCanvas(600, 600, WEBGL); + * createCanvas(100, 100, WEBGL); * points.push(new p5.Vector(-1, -1, 0), new p5.Vector(-1, 1, 0), * new p5.Vector(1, -1, 0), new p5.Vector(-1, -1, 0)); * buildShape01(); diff --git a/src/webgl/p5.RendererGL.js b/src/webgl/p5.RendererGL.js index 3c4aa212fc..c4c5f53062 100644 --- a/src/webgl/p5.RendererGL.js +++ b/src/webgl/p5.RendererGL.js @@ -1095,6 +1095,7 @@ p5.RendererGL = class RendererGL extends p5.Renderer { this.filterShader.setUniform('tex0', target); this._pInst.clear(); this._pInst.shader(this.filterShader); + this._pInst.noLights(); this._pInst.rect(-target.width / 2, -target.height / 2, target.width, target.height); }); @@ -1105,6 +1106,7 @@ p5.RendererGL = class RendererGL extends p5.Renderer { this.filterShader.setUniform('tex0', tmp); this._pInst.clear(); this._pInst.shader(this.filterShader); + this._pInst.noLights(); this._pInst.rect(-target.width / 2, -target.height / 2, target.width, target.height); }); @@ -1122,6 +1124,7 @@ p5.RendererGL = class RendererGL extends p5.Renderer { // filterParameter uniform only used for POSTERIZE, and THRESHOLD // but shouldn't hurt to always set this.filterShader.setUniform('filterParameter', filterParameter); + this._pInst.noLights(); this._pInst.rect(-target.width / 2, -target.height / 2, target.width, target.height); });