We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3eae276 commit c395deeCopy full SHA for c395dee
src/webgl/ShaderGenerator.js
@@ -1620,6 +1620,17 @@ function shadergenerator(p5, fn) {
1620
})
1621
}
1622
1623
+// Alias GLSL's mix function as lerp in p5.strands
1624
+// Bridging p5.js lerp and GLSL mix for consistency in shader expressions
1625
+const originalLerp = fn.lerp;
1626
+fn.lerp = function (...args) {
1627
+ if (GLOBAL_SHADER?.isGenerating) {
1628
+ return fn.mix(...args); // Use mix inside p5.strands
1629
+ } else {
1630
+ return originalLerp.apply(this, args); // Fallback to normal p5.js lerp
1631
+ }
1632
+};
1633
+
1634
export default shadergenerator;
1635
1636
if (typeof p5 !== 'undefined') {
0 commit comments