PDA

View Full Version : blending



mikethebike
03-04-2012, 04:44 AM
Hi
If I make the black background transparent the white (aircraft instrument) symbols are blurred. Why?
I know, I could my new background 50% transparent and place it in front but the result is not that good.
Possible to only let white color be in front or something alike? I cannot change the white only my new background. (dll)
Thanks
Michael

Alfonse Reinheart
03-04-2012, 10:01 AM
You haven't given us nearly enough information to be able to answer this.

What do you mean when you say that the background is "transparent?" The background can't be transparent; the math just doesn't work that way. Things are transparent relative to an opaque background. The background color should be a solid color. Furthermore, how did you make it transparent? What did you do that would cause it to be transparent? Transparent relative to what? What color values are you writing/clearing to, and what blend mode are you using?

Next, how are you rendering the "aircraft instruments"? What blend mode are you using for that?

mikethebike
03-05-2012, 12:00 AM
Hi
I do a x-plane plugin so I don't know what was used but I normally use:
/// Tell Xplane what we are doing
XPLMSetGraphicsState(0/*Fog*/, 1/*TexUnits*/, 0/*Lighting*/, 0/*AlphaTesting*/, 1/*AlphaBlending*/, 1/*DepthTesting*/, 1/*DepthWriting*/);

glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
...

now I do drawMesh() and set it to 50% alpha value.
This I set before the instrument ok but colours don't look very good.
Instead of making it 50% transparent I only want the white instrument symbols to be seen.
Placing it behind and removing the black instrument background makes the white symbols blurred. WHY????
Hence I'm looking around for a solution to only see white from below my new background.
Many thanks
Michael