alphablending

Is it possible to achieve MAX(As,Ad) openGL blending?

不羁的心 提交于 2019-12-03 03:17:49
问题 I am working on a game where I want to create shadows under a series of sprites on a grid. The shadows are larger than the sprites themselves and the sprites are animated (i.e. move and rotate). I cannot simply render them into the sprite png, or the shadows will overlap adjacent sprites. I also cannot simply put shadows on a lower layer by themselves, because when they overlap, they will create dark bands at their intersection. These sprites are animated, so it is not feasible to render

How to use pre-multiplied during image convolution to solve alpha bleed problem?

最后都变了- 提交于 2019-12-02 20:52:52
i'm trying to apply a box blur to an transparent image, and i'm getting a "dark halo" around the edges. Jerry Huxtable has a short mention of the problem , and a very good demonstration showing the problem happen: But i, for the life of me, cannot understand how " pre-multiplied alpha " can fix the problem. Now for a very simple example. i have a 3x3 image, containing one red and one green pixel: In reality the remaining pixels are transparent: Now we will apply a 3x3 Box Blur to the image. For simplicities sake, we'll only calculate the new value of the center pixel. The way a box blur works

Device AlphaBlend state in XNA 4.0

假如想象 提交于 2019-12-02 20:06:44
问题 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 obscured. I've tried so many different combinations of setting up the BlendState. At the moment it looks like this: GraphicsDevice.DepthStencilState = DepthStencilState.Default; GraphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise; /

Alpha Compositing Algorithm (Blend Modes)

感情迁移 提交于 2019-12-02 19:44:13
I'm trying to implement blend modes from the PDF specification, for my own pleasure, in SASS. PDF Specification: http://www.adobe.com/content/dam/Adobe/en/devnet/acrobat/pdfs/PDF32000_2008.pdf Page 322 is the alpha compositing section. The input values are in RGBA format, but now I'm trying to implement blending of the alpha component. How do I excatly go about doing it? From what I gather my values should be between 0.0 and 1.0, that's done. However from the specs it seems that you should blend for each color channel? Do I just average it out to get back to RGBA form for my alpha component?

alpha blending in webgl works not correctly

最后都变了- 提交于 2019-12-02 16:53:34
问题 code: gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.LESS); gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); Problem in that on a figure "superfluous" is drawn: how to correct it? P.S. alpha=0.9 回答1: What is your perspective zNear and zFar set to? Is it possible you're setting it too close and the back of your cube is being clipped? See sample below where it's set too close. That doesn't look like your issue but it's hard to tell. Also are you sorting your polygons? When

Is it possible to achieve MAX(As,Ad) openGL blending?

寵の児 提交于 2019-12-02 16:48:00
I am working on a game where I want to create shadows under a series of sprites on a grid. The shadows are larger than the sprites themselves and the sprites are animated (i.e. move and rotate). I cannot simply render them into the sprite png, or the shadows will overlap adjacent sprites. I also cannot simply put shadows on a lower layer by themselves, because when they overlap, they will create dark bands at their intersection. These sprites are animated, so it is not feasible to render these en masse. Basically, I want the sprites' shadows to blend together such that they max out at a set

Device AlphaBlend state in XNA 4.0

安稳与你 提交于 2019-12-02 12:30:47
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 obscured. I've tried so many different combinations of setting up the BlendState. At the moment it looks like this: GraphicsDevice.DepthStencilState = DepthStencilState.Default; GraphicsDevice.RasterizerState = RasterizerState.CullCounterClockwise; //GraphicsDevice.BlendState = BlendState.AlphaBlend; GraphicsDevice.BlendState = new BlendState() {

alpha blending in webgl works not correctly

僤鯓⒐⒋嵵緔 提交于 2019-12-02 10:25:38
code: gl.enable(gl.DEPTH_TEST); gl.depthFunc(gl.LESS); gl.enable(gl.BLEND); gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA); Problem in that on a figure "superfluous" is drawn: how to correct it? P.S. alpha=0.9 gman What is your perspective zNear and zFar set to? Is it possible you're setting it too close and the back of your cube is being clipped? See sample below where it's set too close. That doesn't look like your issue but it's hard to tell. Also are you sorting your polygons? When rendering transparent things you generally have to draw front to back. For a convex object like a sphere,

glPoint Alpha Blending issue

我怕爱的太早我们不能终老 提交于 2019-12-02 08:09:32
I am having issues alpha blending glPoints. The alpha blending works correctly when the glPoint is over the background but when a glPoint overlaps another glPoint the background color is visible rather then the underlying glPoint. // create texture GLuint tex; glGenTextures(1, &tex); glBindTexture(GL_TEXTURE_2D, tex); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_BYTE, spriteData); // Draw glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); glBlendFunc (GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);

Semi-transparent highlights using PySide and QTextEdit

不羁的心 提交于 2019-12-02 07:09:24
问题 I've created a QTextEdit object. The code below adds randomly colored highlights to the currently selected text. I need the highlights to be semi-transparent so I can see highlights layered upon each other. Using "setAlpha" does not appear to do anything. How can I set the alpha for the highlight or otherwise obtain semi-transparency? # Define cursor & span self.cursor = self.textdoc.textCursor() self.selstart = self.cursor.selectionStart() self.selend = self.cursor.selectionEnd() self