Questions tagged [alphablending]

Alpha blending is a convex combination of a translucent foreground color with a background color allowing for transparency effects.

562 questions
0
votes
0 answers

OpenGL blend function that multiplies by srcAlpha AND dstAlpha (and its inverse)

Basically I want the following blend function: newFragColor = SrcColor * SrcAlpha * DstAlpha + DstColor * (1-(SrcAlpha * DstAlpha)) Can I achieve that somehow using glBlendFunc and glBlendEquation? The left side of the addition is easy - for that I…
matthias_buehlmann
  • 4,641
  • 6
  • 34
  • 76
0
votes
1 answer

Alphablending without buffered image

I'd like to draw a shape on a Graphics2D and colour a part of it different if it intersects a certain range. I managed to do this by drawing 2 shapes into a BufferedImage (the original shape and the area that will cause a change of colour) by using…
Max
  • 79
  • 4
0
votes
3 answers

Multitexturing is darkening the entire scene!

I've implemented a scene using 3 quads, A, B, and C. Quad C is behind quad B. Quad B sits on top of Quad A. All quads are using the same texture with the exception of Quad B. Quad B makes use of an alpha map and the base texture all the other Quads…
ct_
  • 1,189
  • 4
  • 20
  • 34
0
votes
1 answer

Odd transparency effect when merging two .png's with transparency in PHP-GD

Merging two images with transparent sections produces the following composite image: I'm wondering why the transparent section of the image I've overlayed onto the green background shows up as such? Anyone? $base =…
Casey Flynn
  • 13,654
  • 23
  • 103
  • 194
0
votes
0 answers

Using alpha blending for depth testing

I only have partially opaque/transparent but not translucent sprites in my scene. My approach would be to render the scene to an FBO with a simple fragment shader writing gl_FragCoord.z for opaque- or 1.0 for transparent regions to gl_FragColor.a,…
ichi
  • 1
  • 1
0
votes
1 answer

How to blend a quad, already with a texture on it

I made a quad with a nice texture on it. The texture has an alpha channel (RGBA). I replaced the quad with the texture (GL_REPLACE), so now I have a billboard with (semi)transparant pixels on it. So far, no problem. But now I want to blend the…
Kriem
  • 8,666
  • 16
  • 72
  • 120
0
votes
0 answers

correct blending between multiple volumes in opengl

I draw multiple 3d shapes in cube volumes with raycasting in fragment shader, like described here: https://github.com/bagobor/opengl33_dev_cookbook_2013/blob/master/Chapter7/GPURaycasting/shaders/raycaster.frag float prev_alpha = sample -…
0
votes
1 answer

Device AlphaBlend state in XNA 4.0

I'm having a problem getting the BlendState on the graphics device to work properly and display the alpha blending correctly. In some cases you can see the leaves through other leaves, in other cases you cannot. And the trunk is also always…
helloserve
  • 1,248
  • 12
  • 14
0
votes
1 answer

Is it possible to render text as being "cut out" from a layer in in qt5?

I'm new to ui design and was wondering how I could achieve an effect where some font-based text on top of a layer is drawn as being "cut-out" from said layer, if that's even possible. Basically akin to the example below Ideally something where the…
memeko
  • 163
  • 1
  • 7
0
votes
1 answer

Question About Alpha Blending in Direct3D9

I needed to make an object in my game transparent, but it wasn't working properly. So, after some research, I later found out how to properly do alpha blending in Direct3D9 and implemented some code to make the object finally transparent. However,…
jacob
  • 35
  • 7
0
votes
3 answers

OpenCV java alpha Blending

I am trying to port the following code (from C++ to Java) to make good alpha blending between my images, but It did not work: #include opencv2/opencv.hpp using namespace cv; using namespace std; int main(int argc, char** argv) { // Read the…
nvsl
  • 1
  • 2
0
votes
0 answers

How to use numpy.einsum to blend two frames?

Goal I want to use numpy.einsum to blend two frames together. The reason I really want to use einsum is because I would like to be able to understand how it works and how it can be applied. Problem I have two frames, a "red" frame and a "green"…
MuadDev
  • 392
  • 3
  • 12
0
votes
0 answers

UWP - apply a multiplied alpha blending between Visuals

I have a RelativePanel that contains two children: a FrameworkElement A with a ContainerVisual cvA that acts like a background a RelativePanel B with another ContainerVisual cvB that displays some rectangles on the foreground. To understand…
Cristiano Ghersi
  • 1,944
  • 1
  • 20
  • 46
0
votes
1 answer

Don't blend a polyline that has crossed lines with itself in webgl

I'm drawing two polylines (which are lines in the sample) in webgl with enabled blending. gl.uniform4f(colorUniformLocation, 0, 0, 0, 0.3); gl.enable(gl.BLEND); gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA); gl.bufferData(gl.ARRAY_BUFFER, new…
mt_serg
  • 7,487
  • 4
  • 29
  • 45
0
votes
1 answer

How can I adjust the transparency with DirectX 11?

I'm trying to make transparent object like a colored glass or water and I succeeded in making it. but I don't know how to adjust it's tranparency. Am I trying to do the impossible? The scene is rendered with simple calculation of color and lighting.…