Most appropriate sub-area of p5.js?
p5.js version
2.2.2
Web browser and version
All
Operating system
All
Steps to reproduce this
Steps:
- Go to https://beta.p5js.org/reference/p5/buildfiltershader/
- Scroll to the fifth example, with the animated red-blue gradient
- Replace
mix with lerp
- The sketch stops working
mix and lerp should act like aliases in p5.strands. mix does already work, but lerp does not for some reason, although I thought we aliased it already? It may have gotten lost in a refactor at some point.
Snippet:
let myFilter;
function setup() {
createCanvas(50, 50, WEBGL);
myFilter = buildFilterShader(gradient);
describe('A moving, repeating gradient from red to blue');
}
function gradient() {
let time = uniformFloat();
filterColor.begin();
filterColor.set(lerp(
[1, 0, 0, 1], // Red
[0, 0, 1, 1], // Blue
sin(filterColor.texCoord.x*15 + time*0.004)/2+0.5
));
filterColor.end();
}
function draw() {
myFilter.setUniform('time', millis());
filter(myFilter);
}
Most appropriate sub-area of p5.js?
p5.js version
2.2.2
Web browser and version
All
Operating system
All
Steps to reproduce this
Steps:
mixwithlerpmixandlerpshould act like aliases in p5.strands.mixdoes already work, butlerpdoes not for some reason, although I thought we aliased it already? It may have gotten lost in a refactor at some point.Snippet: