Sign in to follow this  
AlwaysLearning

Help with alpha blending.

Recommended Posts

Is there a way to blend colors out of order but they produce a color as if they were blended in order? Normally the process is Buffer<-PixelA<-PixelB<-PixelC I want to do: PixelA<-PixelB<-PixelC then have Buffer<-PixelA (PixelA is now the blend of A+B+C). Example usage: Sorted furthest to nearest objects in 3D space, there are areas that are composed of similar overlapping areas (which have varying degrees of alpha). It is unknown what exists on the buffer, however for an area, all the pixels will remain the same. I could save some time if I could blend the overlapped area and save it which will be the only thing to blend with the buffer for the area of the overlap.

Share this post


Link to post
Share on other sites
You could render the fixed pixels to a render target texture and then use that texture to render to the buffer. The texture could be kept so that you don't have to draw it on every frame.

If you are using DirectX you might want to check out the ID3DXRenderToSurface interface which is created by the D3DXCreateRenderToSurface( ) function. This interface lets you direct all render output to a supplied IDirect3DSurface9 which could be a render target texture.

Good luck.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this