All Questions
22
questions
0
votes
0
answers
98
views
Why does my image turn white before fading away when interpolating its alpha from 1 to 0?
I'm developing a program that utilizes WebGL and I have a function that draws images. The fragment shader looks like this:
varying vec2 v_texcoord;
uniform sampler2D u_texture;
uniform vec4 u_tint;
...
0
votes
0
answers
97
views
How to blend two WebGL canvases in real-time?
So, I read this answer, and while it seems to work, it dramatically lowers my FPS, and generally my program can only run for 10 seconds before WebGL just completely crashes.
Basically, I'm trying to ...
4
votes
0
answers
931
views
WebGL (2.0) canvas blending with HTML in linear color space
Problem Description
Hi! I'm creating a WebGL 2.0 vector shapes renderer and I'm facing a serious problem that I don't know how to resolve. My current rendering pipeline looks like this:
I'm drawing ...
4
votes
1
answer
688
views
Why are the transparent pixels not blending correctly in WebGL
Result of my code:
Basically, what the issue is, the transparent part of my image are not blending correctly with what is drawn before it. I know I can do a
if(alpha<=0){discard;}
in the ...
-1
votes
1
answer
299
views
Webgl Blending is blending to white
I have written a library for webgl, it has many tests and runs those tests perfectly fine including the one I have for blending.
I've set the test to do a standard blending of Src_Alpha, ...
1
vote
1
answer
982
views
Regl color and alpha blending of primitives
I am trying to figure out how to achieve color and alpha blending between primitives using Regl.
I know Regl command's have a blend property and I've tried replicating the following webgl settings ...
3
votes
1
answer
3k
views
glDrawElements: Source and destination textures of the draw are the same
I'm busy transferring some code from OpenGL to WebGL2 (to do duel depth peeling) but I'm getting a warning in my console that I cannot make sense of and the output is just black.
I've gone through ...
0
votes
2
answers
192
views
Alternative approach for gl.blendFunci function that is missing from WebGL spec
I'm busy converting some OpenGL to WebGL but unable to get a workaround for the OpenGL function gl.BlendFunci(...) inside WebGL.
My browser console simply reports:
gl.blendFunci is not a function
...
1
vote
1
answer
285
views
Multiple-passes SSAO border artifact
I am playing with multiple passes in WebGL to apply some visual enhancements to my renders.
I am ping-ponging two textures (taken from here: WebGL Image Processing Continued), and this is basically ...
2
votes
1
answer
2k
views
webgl 2d blending two transparent textures on top of each other
I am trying to blend two textures with an alpha channel over each other.
After looking through the net it appeared that there are no simple ways to solve this. I tried this trick in the fragment ...
0
votes
1
answer
628
views
WebGL: How can blend each draw with the previous framebuffer with custom blending modes?
I am implementing a brush engine using webgl. For each stamp i draw, i want to this stamp blend with the previous drawing in the framebuffer, with my own custom blending function to achive some cool ...
2
votes
1
answer
2k
views
WebGL alpha blending
I'm trying to layer one texture over another, but I'm having alpha blending issues around the edges. I've tried many blending combinations with no luck. Where am I going wrong?
Current state of ...
0
votes
1
answer
1k
views
WebGL - unexpected behaviour while not clearing gl.COLOR_BUFFER_BIT
I was trying to implement a sort of motionblur effect in my page and tought to simply specify a blend function for the main framebuffer
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA);
gl.enable(...
9
votes
3
answers
2k
views
Alpha gradients not smooth in WebGL when using premultiplied alpha
I've got a LibGDX game with cartoon clouds with a smooth gradient. There are other examples of gradients in the game that have a similar issue, but the clouds are the most obvious example. They look ...
1
vote
1
answer
1k
views
How to essentially "Chroma Key" in WebGL?
I am trying to figure out how to set the alpha of a textured square that I draw depending on the color. I am using a picture of a red Alabama A with a white background. I want to be able to toggle it ...