File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -1619,18 +1619,19 @@ function shadergenerator(p5, fn) {
1619
1619
}
1620
1620
}
1621
1621
} )
1622
+ // Alias GLSL's mix function as lerp in p5.strands
1623
+ // Bridging p5.js lerp and GLSL mix for consistency in shader expressions
1624
+ const originalLerp = fn . lerp ;
1625
+ fn . lerp = function ( ...args ) {
1626
+ if ( GLOBAL_SHADER ?. isGenerating ) {
1627
+ return this . mix ( ...args ) ; // Use mix inside p5.strands
1628
+ } else {
1629
+ return originalLerp . apply ( this , args ) ; // Fallback to normal p5.js lerp
1630
+ }
1631
+ } ;
1622
1632
}
1623
-
1624
- // Alias GLSL's mix function as lerp in p5.strands
1625
- // Bridging p5.js lerp and GLSL mix for consistency in shader expressions
1626
- const originalLerp = fn . lerp ;
1627
- fn . lerp = function ( ...args ) {
1628
- if ( GLOBAL_SHADER ?. isGenerating ) {
1629
- return this . mix ( ...args ) ; // Use mix inside p5.strands
1630
- } else {
1631
- return originalLerp . apply ( this , args ) ; // Fallback to normal p5.js lerp
1632
- }
1633
- } ;
1633
+
1634
+
1634
1635
1635
1636
export default shadergenerator ;
1636
1637
You can’t perform that action at this time.
0 commit comments