'opengles and emscripten shader version unsupported
i am trying to target opengles #version 300 es through emscripten, but the compilation gives error unsupported shader version.
i am using emscripten version 2.0.6.
the emmake command i am using (taken reference from (here)),
$emcmake cmake ../ -DUSE_EMSCRIPTEN=1 -DCMAKE_FIND_ROOT_PATH=/ -DCMAKE_CXX_FLAGS="-sFULL_ES3 -sUSE_WEBGL2 -s MAX_WEBGL_VERSION=2 --preload-file vertex.vs --preload-file fragment.fs --preload-file test.jpg -O1 -std=c++17 --profiling -pthread -s FETCH=1 -s WASM=1 -s NO_EXIT_RUNTIME=1 -s INITIAL_MEMORY=1000MB -s USE_PTHREADS=1 -s PTHREAD_POOL_SIZE=20 -s \"EXTRA_EXPORTED_RUNTIME_METHODS=['ccall']\" -s DISABLE_EXCEPTION_CATCHING=0 --bind -s USE_SDL=2"
my vertex shader code:
#version 300 es
in vec3 position;
in vec4 color;
in vec3 normal;
in vec2 uv;
out vec4 v_color;
out vec3 v_normal;
out vec2 v_uv;
uniform mat4 model;
uniform mat4 view;
uniform mat4 projection;
void main()
{
v_color = color;
v_normal = normal;
v_uv = uv;
gl_Position = projection * view * transpose(model) * vec4(position.xyz, 1.0);
}
what could be the reason here?
Edit: i guess this explains it, not sure though
Solution 1:[1]
The problem is most likely not in the shader code itself. Are you requesting OpenGL ES 3.0 (WebGL 2) when creating the OpenGL ES context?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Andrea |
