@@ -36,8 +36,6 @@ function shadergenerator(p5, fn) {
36
36
}
37
37
const generator = new ShaderGenerator ( generatorFunction , this , options . srcLocations )
38
38
const generatedModifyArgument = generator . generate ( ) ;
39
- console . log ( "SRC STRING: " , generatorFunction ) ;
40
- console . log ( "NEW OPTIONS:" , generatedModifyArgument )
41
39
return oldModify . call ( this , generatedModifyArgument ) ;
42
40
}
43
41
else {
@@ -479,7 +477,6 @@ function shadergenerator(p5, fn) {
479
477
}
480
478
}
481
479
482
- // TODO: Correct the implementation for floats/ genType etc
483
480
class ModulusNode extends BinaryOperatorNode {
484
481
constructor ( a , b ) {
485
482
super ( a , b ) ;
@@ -616,7 +613,6 @@ function shadergenerator(p5, fn) {
616
613
617
614
Object . keys ( availableHooks ) . forEach ( ( hookName ) => {
618
615
const hookTypes = originalShader . hookTypes ( hookName ) ;
619
- console . log ( hookTypes ) ;
620
616
this [ hookTypes . name ] = function ( userCallback ) {
621
617
// Create the initial nodes which are passed to the user callback
622
618
// Also generate a string of the arguments for the code generation
@@ -779,14 +775,6 @@ function shadergenerator(p5, fn) {
779
775
// GLSL Built in functions
780
776
// Add a whole lot of these functions.
781
777
// https://docs.gl/el3/abs
782
- // In reality many of these have multiple overrides which will need to address later.
783
- // Also, their return types depend on the genType which will need to address urgently
784
- // genType clamp(genType x,
785
- // genType minVal,
786
- // genType maxVal);
787
- // genType clamp(genType x,
788
- // float minVal,
789
- // float maxVal);
790
778
const builtInGLSLFunctions = {
791
779
//////////// Trigonometry //////////
792
780
'acos' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
@@ -821,12 +809,12 @@ function shadergenerator(p5, fn) {
821
809
// 'isnan': {},
822
810
'log' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
823
811
'log2' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : false } ,
824
- 'max' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
825
- 'min' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
826
- 'mix' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : false } ,
812
+ 'max' : { args : [ 'genType' , 'genType' ] , returnType : 'genType' , isp5Function : true } ,
813
+ 'min' : { args : [ 'genType' , 'genType' ] , returnType : 'genType' , isp5Function : true } ,
814
+ 'mix' : { args : [ 'genType' , 'genType' , 'genType' ] , returnType : 'genType' , isp5Function : false } ,
827
815
// 'mod': {},
828
816
// 'modf': {},
829
- 'pow' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
817
+ 'pow' : { args : [ 'genType' , 'genType' ] , returnType : 'genType' , isp5Function : true } ,
830
818
'round' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
831
819
'roundEven' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : false } ,
832
820
// 'sign': {},
@@ -853,7 +841,6 @@ function shadergenerator(p5, fn) {
853
841
Object . entries ( builtInGLSLFunctions ) . forEach ( ( [ functionName , properties ] ) => {
854
842
if ( properties . isp5Function ) {
855
843
const originalFn = fn [ functionName ] ;
856
-
857
844
fn [ functionName ] = function ( ...args ) {
858
845
if ( GLOBAL_SHADER ?. isGenerating ) {
859
846
return new FunctionCallNode ( functionName , args , properties )
0 commit comments