Skip to main content

All Questions

Tagged with
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; ...
Ryan Peschel's user avatar
  • 11.7k
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 ...
Ryan Peschel's user avatar
  • 11.7k
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 ...
Wojciech Danilo's user avatar
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 ...
Sebastian Frederick's user avatar
-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, ...
Diniden's user avatar
  • 1,085
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 ...
F Lekschas's user avatar
  • 12.7k
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 ...
FanManPro's user avatar
  • 1,117
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 ...
FanManPro's user avatar
  • 1,117
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 ...
deblocker's user avatar
  • 7,657
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 ...
Elias's user avatar
  • 305
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 ...
jng_xiao's user avatar
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 ...
user2994359's user avatar
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(...
user257824's user avatar
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 ...
Will Calderwood's user avatar
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 ...
EthanSchatz's user avatar

15 30 50 per page