@@ -36,8 +36,6 @@ function shadergenerator(p5, fn) {
3636 }
3737 const generator = new ShaderGenerator ( generatorFunction , this , options . srcLocations )
3838 const generatedModifyArgument = generator . generate ( ) ;
39- console . log ( "SRC STRING: " , generatorFunction ) ;
40- console . log ( "NEW OPTIONS:" , generatedModifyArgument )
4139 return oldModify . call ( this , generatedModifyArgument ) ;
4240 }
4341 else {
@@ -479,7 +477,6 @@ function shadergenerator(p5, fn) {
479477 }
480478 }
481479
482- // TODO: Correct the implementation for floats/ genType etc
483480 class ModulusNode extends BinaryOperatorNode {
484481 constructor ( a , b ) {
485482 super ( a , b ) ;
@@ -616,7 +613,6 @@ function shadergenerator(p5, fn) {
616613
617614 Object . keys ( availableHooks ) . forEach ( ( hookName ) => {
618615 const hookTypes = originalShader . hookTypes ( hookName ) ;
619- console . log ( hookTypes ) ;
620616 this [ hookTypes . name ] = function ( userCallback ) {
621617 // Create the initial nodes which are passed to the user callback
622618 // Also generate a string of the arguments for the code generation
@@ -779,14 +775,6 @@ function shadergenerator(p5, fn) {
779775 // GLSL Built in functions
780776 // Add a whole lot of these functions.
781777 // 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);
790778 const builtInGLSLFunctions = {
791779 //////////// Trigonometry //////////
792780 'acos' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
@@ -821,12 +809,12 @@ function shadergenerator(p5, fn) {
821809 // 'isnan': {},
822810 'log' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
823811 '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 } ,
827815 // 'mod': {},
828816 // 'modf': {},
829- 'pow' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
817+ 'pow' : { args : [ 'genType' , 'genType' ] , returnType : 'genType' , isp5Function : true } ,
830818 'round' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : true } ,
831819 'roundEven' : { args : [ 'genType' ] , returnType : 'genType' , isp5Function : false } ,
832820 // 'sign': {},
@@ -853,7 +841,6 @@ function shadergenerator(p5, fn) {
853841 Object . entries ( builtInGLSLFunctions ) . forEach ( ( [ functionName , properties ] ) => {
854842 if ( properties . isp5Function ) {
855843 const originalFn = fn [ functionName ] ;
856-
857844 fn [ functionName ] = function ( ...args ) {
858845 if ( GLOBAL_SHADER ?. isGenerating ) {
859846 return new FunctionCallNode ( functionName , args , properties )
0 commit comments