Most appropriate sub-area of p5.js?
p5.js version
2.2.3-rc.0
Web browser and version
n/a
Operating system
n/a
Steps to reproduce this
Steps:
- Visit this sketch: https://editor.p5js.org/neill0/sketches/ZbQ9dFk7J
or run the following snippet (both try filterColor.set(coord.x < 0.5 ? red : green); )
- observe all-red canvas (should be half green)
- observe the transpiled GLSL in console has over-simplified the code
Snippet:
const red = [1, 0, 0, 1];
const green = [0, 1, 0, 1];
const coord = filterColor.texCoord;
filterColor.set(coord.x < 0.5 ? red : green);
gets compiled to...
vec4 getColor(FilterInputs inputs, sampler2D canvasContent) {
return vec4(1.0000, 0.0000, 0.0000, 1.0000);
}
Most appropriate sub-area of p5.js?
p5.js version
2.2.3-rc.0
Web browser and version
n/a
Operating system
n/a
Steps to reproduce this
Steps:
or run the following snippet (both try
filterColor.set(coord.x < 0.5 ? red : green);)Snippet:
gets compiled to...