FAQ Database Discussion Community


Untangling When and What Values are Clamped in OpenGL Blending on Different Render Targets

opengl,blending
TL;DR: What values are clamped and under what circumstances (enabled flags and renderbuffer types (esp. RGBA_F32)), when blending is enabled? The fragment shader output? The blending factors? The result of the blend equation? Others? The mechanisms I have found for clamping: Shader output (via glClampColor): This appears to control glReadPixels,...

OpenGL unwanted transparency with deferred shading

opengl,shader,transparency,blending
I'm trying to implement deferred shading using the OpenGL, I render positions and normals to the textures. When I use only 1 light source without blending everything works well, but after I turn on blending, so the other light sources could contribute, I get a transparency. Does anyone had the...

Overlaying a transparent color over a Texture with GLSL

glsl,lwjgl,slick2d,vertex-shader,blending
I have an image that I am loading using the Slick library, and the image renders fine without my shader active. When I use my shader to overlay a transparent color over the image the entire image is replaced by the transparent color. without the shader With the shader Vertex...

Creating a fog effect that varies with alpha

colors,lua,blending,love2d
I'm trying to implement "fog-of-war" in a mapping tool I'm developing. For each grid cell, if a cell is "fogged", the color is set to grey multiplied by the cell's current color. Otherwise, the cell color is set to whatever color the cell normally should be. Below is my draw...

CSS3 - Blending Mode between different HTML Elements

html,css,html5,css3,blending
I have an good idea what the answer is going to be, but I just want to make absolutely sure. I have two elements, div.glass and div.sound, both contain a background-image. Is it possible to set the blending mode to each div so that they interact with each other? For...

Apply a css -webkit-filter grayscale before using a background-blend-mode keeping the color

html,css3,grayscale,blending,background-blend-mode
I'm trying to achieve a monochrome colored image on mouse hover, where the colors of the image are transformed to grayscale and the gray shades afterwards replaced with the shade of color i'm blending with. It could look like this To simulate this in photoshop you can grayscale a image...

Delphi: GR32 blending alpha channel is depend on Clear() color

delphi,blending,graphics32
I used a picture with alpha channel and some section of image is not fully opaque. When I draw it on a TImgView32 object that sections get a little color from Clear() color. Lets show it by a sample picture: This is the original picture that you normally see in...

In OpenCV can you have a weight per pixel with addWeighted?

python,opencv,blending
I'm trying to blend two images in OpenCV using cv2.addweighted() but I would like to specify a different alpha weight for each pixel instead of one weight for all the pixels. Is it possible to do this in OpenCV or do I have to write my own, slow function.