Sign in to follow this  
Guest christian

alpha blending

Recommended Posts

Is it possible at all to alpha blend textures in C code? I know it works with xml gauges, but IMAGE_USE_ALPHA seems to only work for luminous maps. I tried using an alpha channel, but it didn't have any effect. It would sure be nice to have semi-transparency in C code also...Cheers, Christian

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

There has been a thread dealing with exactly this quite recently. You might find it on page 2 or 3 or just do a search.The bitmap has to be in the 4-4-4 format with alpha channel which can be achieved by using tools like ImageTool and DXTBmp.Only then then IMAGE_USE_ALPHA flag will work.The only downside seems to be the only four bit alpha channel (=> color bleeding).

Share this post


Link to post
Share on other sites

Thanks. I must be blind then, or the search function doesn't work very well, as I did a search on 'alpha' before posting, but nothing relevant popped up. I'll have a browse...Cheers, Christian

Share this post


Link to post
Share on other sites

The pseudo BMP alpha is a blast from the past, and is one confusing issue because of a novel, yet unorthodox encoding of BMP files.There is another thread somewhere, but the gist is this: GDI+ is what you want. You can use its compositing modes to render layered and complex objects. You can use a FS encoded BMP file as the background, including using the IMG_USE_TRANSPARENT etc, flags as normal, then use the composite effects and image manipulation of the bitmap class (lookup the win32 platform SDK). Once you get a graphics object, the sky is the limit...

Share this post


Link to post
Share on other sites

Thanks. I found both threads now and found them helpful.However, to put a different spin on things, I'm toying with the idea of scrapping the whole MS way anyway and implement a opengl renderer in the main callback. This should give me the flexiblity I want (I could go DX also, but I'm familiar with opengl, whereas I'm not fimiliar with dx). I'll finish what I'm currently doing, and then add a basic profiler and add a gl renderer and see how this will affect framerates. Not using the standard macros and callbacks should be a good thing, I suspect...Cheers, Christian

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