Emscripten can't compile shader

Hi, i been using emscripten trying to upload a shader. Already upload the shader example. I add my shader to the code and runs okay in OF then i try emscripten and everything looks fine until i run it on the web here is a screenshot of the java console not sure what it is someone has an idea ?

can you post the code of your example?
I think that you have to provide a version of your shader shader version compatible with webGL, meaning openGL ES version.

As @edapx says you need to use webgl syntax for the shaders but this problem seems something else, someone else reported it and it seems to be something related to some missing symbol in emscripten standard library. not sure what’s the problem though, it might be that some precompiled library is not compatible with current emscripten anymore, perhaps you could try using the nightly builds of OF which come with newer libraries?

I think is working. Not getting that error anymore.
But know i’m getting the black screen this is what i got in the terminal:

Already was able to run the shader using three.js using the same code but of course i prefer to use OF :

uniform float time;
uniform vec2 mouse;
uniform vec2 resolution;

#define OCTAVES 10

float vn(vec2 pos, float persistence, float scale)


float v = 0.0;
float p = 1.0;

for (int i=OCTAVES-1; i>=0; --i)
    v += (sin(pos.x)+cos(pos.y))*p;
    pos += sin(pos.yx+vec2(time+cos(time), 0.12345*time));
    p *= persistence;
    pos /= scale;
return v;


void main( void )

vec2 uv = ( gl_FragCoord.xy / resolution.xy );
uv -= .2
float scale = 5.0 +  0.0 * sin(time * .4);
float r = .1 + .3 * vn(uv*scale, 0.5-abs(cos(time*0.01)), 0.6);
float g = .1
+ .0 * vn(uv*(scale+1.0), .75-abs(sin(time*0.3)), .5);
float b = .1 + .5 * vn(uv*(scale-1.0), .9, .4

gl_FragColor = vec4( r,g,b, 1.0 );


To see if the shader fragment is running properly, try:

gl_FragColor = vec4(1,0,0,1);

If the screen becomes red, then the shader is works, you should shift your attention to variable:

uv=(gl_FragCoord.xy / resolution.xy);

there’s definetly an error in the output and doesn’t seem to be related to the shader but rather to the c++ code, perhaps you can try adding in config.make in PROJECT_CFLAGS and PROJECT_LDFLAGS what the error suggests like:


Okay, i think the answer to the question is solved using the nightly builds.
I realize that my vertex shader was outside the folder i drag it into the folder and know i’m getting shader errors but i’m confused why the shader is compiling with out the vertex shader in OF desktop ? This is the .vert i’m using

void main() {

gl_Position = vec4( position, 1.0 );

maybe is a syntax error.