Shader String P5js WebGL

Hello As far as i get it i have to rewrite the hole P5 loadShader, if i want to use a shader (with template literals most modern browsers) direct in my Scetch, i write small scetches an load files from external source is mostly a overkill. i looking for this kind of code:

    p5.fragFragmentShader["fragSource"]=`
    void main () {
    gl_FragColor=vec4(1.);
    }
    ` 

the problem here is that the _getShader uses window.loadString https://github.com/processing/p5.js/blob/master/src/webgl/p5.RendererGL.js#L132

My Question: How to pass a String direct in my p5 Scetch internal (singel js file). Do i miss something, a Javascript (hack) workaround? Just a missed feature?

Tagged:

Answers

Sign In or Register to comment.