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

Safari ignores alpha channel of gl_FragColor #40

Open
alecmolloy opened this issue Dec 17, 2018 · 0 comments
Open

Safari ignores alpha channel of gl_FragColor #40

alecmolloy opened this issue Dec 17, 2018 · 0 comments

Comments

@alecmolloy
Copy link

Code: (same as default code, but with a 0.25 value for alpha channel)

// Author:
// Title:

#ifdef GL_ES
precision mediump float;
#endif

uniform vec2 u_resolution;
uniform vec2 u_mouse;
uniform float u_time;

void main() {
    vec2 st = gl_FragCoord.xy/u_resolution.xy;
    st.x *= u_resolution.x/u_resolution.y;

    vec3 color = vec3(0.);
    color = vec3(st.x,st.y,abs(sin(u_time)));

    gl_FragColor = vec4(color,0.25);
}

Browsers in screenshot below, left to right:

  1. Safari Technology Preview Release 71 (Safari 12.1, WebKit 14607.1.15)
  2. Safari Version 12.0 (14606.1.36.1.9)
  3. Chrome Canary Version 73.0.3642.0 (Official Build) canary (64-bit)

screenshot 2018-12-17 at 12 29 51

I cannot understand why this is happening, but it seems to be that alpha is output as 1.0 for gl_FragColor values greater than approximately 0.002197265508584, and as 0.0 for values below. (e.g. 0.0001 is interpreted as 0.0).

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

1 participant