Jump to content
  • Advertisement
Sign in to follow this  
AlwaysLearning

Help with alpha blending.

This topic is 3632 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!