alphablending

How can I optimize drawing of multiple fullscreen transparent iPhone OpenGL ES layers?

Hi, I'm trying to optimize my iPhone OpenGL ES app. This is based on the GLSprite and GLPaint sample apps. I've factored out EAGLView into a base class, and I'm subclassing it in 3 different OpenGL views to make 3 transparent layers. The display parent for the 3 EAGLViews is a UIView, and that UIView is a child of the UIWindow. I'm...

Turn off Pygame alpha

I have a computer game I'm working on, and I'm wanting to give the user an option to turn off alpha compositing for speed purposes. Rather than doing checks everywhere, does Pygame have a global option to say "Don't use alpha" such that it would just ignore all my calls to set_alpha and the likes? ...

loading a simple semi transparent PNG in Windows Mobile using C#.

Hi, I am new to Windows Mobile programming. I want to load a PNG file which has an Alpha Channel. After 2 days of searching in Internet, I am still at square 1. Can someone help me? I got an example which uses uses a wrapper to access the AlphaBlend API. But when I set the AC_SRC_ALPHA flag in BlendingFunction, it does not draw anything...

Clearing the alpha channel of an NSImage

It can be done by mallocing a temporary bitmap with 32bits per pixel and then clearing the alpha component with a for loop and and finally turn it back into a NSImage again. I suspect is can be done in a simpler way using a clever combination of NSColor and NSCompositingOperation. Or perhaps the image needs to be composited with itsel...

Direct3D rendering 2D images with "multiply" blending mode and alpha

I'm trying to replicate the Photoshop filter multiply with Direct3D. I've been reading and googling about the different render states and I've got the effect almost working. The problem is that it's ignoring the alpha value of the textures. Here's an image that explains the sitution: http://www.kloonigames.com/petri/stackoverflow_doesn...

Opacity of a TWinControl?

How could one change the opacity of a TWinControl based control? And why didn't they add this capability to TControl/TWinControl level (why only TForm)? ...

Different alpha for subviews in the same container

I have a question similar to the http://stackoverflow.com/questions/1269637/can-you-override-a-parent-uiviews-alpha-value-on-one-of-its-subviews In some cases I want to show custom semi-transparent full-screen overlay view over current view. The trick is that I want it to have custom navigation bar at the top and some other contents (le...

Blend formula for GDI+

I have a color A that I'd like to transform into color C, by using color B. So I'd like to know the blending formula F in GDI+, where F = F(A, B) = C. A is the "bottom color" and B is an overlay color above A, which together with A yields C. Cheers, // Magnus ...

Blending problems (OpenGL)

Hi! A have a question, maybe someone can help me. I am trying to make a mirror effect using OpenGL. I draw a transparent plane, a "reflected" scene cut by stencil, and an original one. But I have a completely non-transparent "wall" instead of the mirror. I know it happens because of the first mirror plane rendering (to get a stencil buf...

Alpha Blending in SDL

I'm trying to find the most efficient way to alpha blend in SDL. I don't feel like going back and rewriting rendering code to use OpenGL instead (which I've read is much more efficient with alpha blending), so I'm trying to figure out how I can get the most juice out of SDL's alpha blending. I've read that I could benefit from using har...

OpenGL ES multi-texture alpha blending question

This maybe a noob question, however, I haven't been able to find a suitable answers: I have an object in OpenGL ES (in fact, an UV mapped export from Blender) and I'd like to apply two textures to it. To be precise, I have a earth-like sphere and I would like to add two textures (a day-side and a night-side) to it. I had thought throug...

transform single channel of BitmapData object

I have a BitmapData object with an alpha channel. I'd like to know the fastet way to offset that alpha channel in ActionScript3 (FlashPlayer10). By offsetting I mean shifting all pixels of that channel in one direction (wrapping around the image borders) while leaving the color channels as they were. Is there a good way to apply a such ...

How to get polygon antialiasing to work.

I'm using these function calls: glEnable(GL_BLEND) glEnable(GL_POLYGON_SMOOTH) glBlendFunc(GL_SRC_ALPHA_SATURATE, GL_ONE) It doesn't work and wont render. glEnable(GL_BLEND) glEnable(GL_POLYGON_SMOOTH) glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) It doesn't anti-alias. ...

Lines do not render on an offscreen frame buffer with a completely black texture

If I have a frame buffer which has a textured binded to it which is simply black with full alpha and I try to draw a line to it, even if the line has full alpha it wont render. I'm not stupid, so the lines definitely aren't black. If the texture is white instead the line suddenly render correctly as if the colour of the texture behind it...

Transparent FrameBuffer background in OpenGL

I want to use glClear and glClearColor to fill a frame buffer with a colour including alpha transparency. However the framebuffer always renders as opaque when binded to a texture which is rendered to the screen. I want everything which is rendered to the framebuffer to kept their transparency. I just want to change the background. See...

iPhone OpenGL ES alpha blends as white in simulator, gray on iPhone

My problem is incorrect alpha blending using OpenGL ES 1.1 on iPhone. Unlike many other peoples' issues with this, textures are not involved. I am drawing dozens of small white circles on a light blue background. Each circle is a drawn as a GL_POINT. I am animating a fade from alpha=1.0 to alpha=0.0. Everything works perfectly in the iP...

Does drawing over an hdc using gdi+ results in a premultiplied by alpha bitmap ?

I'm trying to draw some bitmap on a CImage object using GDI+ DrawImage. The resulting CImage bitmap seems to be premultiplied by alpha but I can't find any mention of that in the msdn documentation. What happens when I draw using DrawImage over an CImage HDC ? ...

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

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 la...

opengl - blending with previous contents of framebuffer

Hello, I am rendering to a texture through a framebuffer object, and when I draw transparent primitives, the primitives are blended properly with other primitives drawn in that single draw step, but they are not blended properly with the previous contents of the framebuffer. Is there a way to properly blend the contents of the texture w...

Handling alpha channel in WPF pixel shader effect

Is there something unusual about how the alpha component is handled in a pixel shader? I have a WPF application for which my artist is giving me grayscale images to use as backgrounds, and the application colorizes those images according to the current state. So I wrote a pixel shader (using the WPF Pixel Shader Effects Library infrast...