Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

webgl2 (glsl 300 es) support #11

Open
nylki opened this issue Apr 11, 2018 · 7 comments
Open

webgl2 (glsl 300 es) support #11

nylki opened this issue Apr 11, 2018 · 7 comments

Comments

@nylki
Copy link

nylki commented Apr 11, 2018

At the moment only glsl version 100 appears to compile correctly. webgl2 uses glsl with version 300 es, which does not compile with glslx.

Here is a fragment shader example:

#version 300 es
precision highp float;
in vec2 v_st;
out vec4 color;
void main()
{
    color = vec4(1.0, 1.0, 0.0, 1.0);
}
@nylki nylki changed the title webg2 (glsl 300 es) support webgl2 (glsl 300 es) support Apr 11, 2018
@Jarred-Sumner
Copy link

With Safari enabling WebGL2 by default on new versions, this becomes more relevant.

How hard would it be to implement this and @evanw would you be open to a PR?

The number of syntax changes with version 300 es isn't huge.

Most changes are:

  • ivec4, ivec3, ivec2 which are always flat when passed from vertex shader -> fragment shader
  • flat and smooth keywords. smooth is default
  • varying -> in or out
  • gl_FragColor is now just the out variable in a fragment shader
  • sampler2DArray, sampler3DArray data types
  • texture2D -> texture and has several different type definitions
  • Many extensions are always available instead of conditionally available

Ideally, it would be possible to output both GLSL ES 300 shaders and GLSL ES 100 shaders, so long as WebGL2-only features aren't used (such as sampler2DArray)

@haberbyte
Copy link

Now that Safari with WebGL2 enabled by default has shipped, is there any interest to support this in glslx @evanw ?

@evanw
Copy link
Owner

evanw commented Nov 4, 2021

No I don't have any interest in this right now, sorry. I'm not using this library at the moment and I also have no need for WebGL2 features myself.

@haberbyte
Copy link

Thank you for taking the time to respond, I somehow thought Figma would use this library 😅

@evanw
Copy link
Owner

evanw commented Nov 4, 2021

Figma does use it, we just don’t use WebGL2 since Figma needs to work everywhere and we could do without it.

@daumann
Copy link

daumann commented Mar 29, 2024

Any update on this? Nowadays many bigger libraries have GLSL1 deprecated

@james-pre
Copy link

@evanw Any updates on this? I like this library and would contribute, but it uses a custom programming language I have no experience with.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants