Using GLSL 3 ES with three.js function

Has anyone successfully used the GLSL 3 ES shaders with the three.js library? From what I know, it is impossible for the latest version (r68) of beacuse, you can’t even set a directive (which is required and should be the first in the shader code):

#version 300 es 

beacause the prefix that is added to each shader using three.js.

Does anyone know any solution to this problem? Would changing the three.js code suffice to add a directive at the beginning of the threejs shaders prefix?

+5
source share
1 answer

Three.js uses WebGL , which is available in web browsers, rather than GLES, which is an OpenGL option for mobile devices. While it is true that WebGL itself is closely related to GLES2, it is different. And currently only WebGL 1.0 exists. The future version may be more related to GLES3, but the WebGL implementation will not support ES 3 shaders at this time.

+6
source

Source: https://habr.com/ru/post/1200971/


All Articles