Render to screen buffer vs. to texture problem

Started by
15 comments, last by serumas 7 years, 11 months ago
Full source along with shaders would help anyone solve your problem.
Advertisement

I just told you. Your target has an alpha component which means alpha writes are enabled. It will write the incoming fragments alpha, which is .3

Make your target texture RGB. It still blends properly. Still gives you the same color. Destination alpha will always be 1.0 when you don't have an alpha channel.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

Yes you are right it becomes 0.3. I need a transparent texture, so ARGB must be. I just want to merge sprites as in photoshop layers :)

so is it possible that alpha chanel for target texture not overwrites but adds newAlphaChanel = 1 + 0.3

You don't need a transparent texture. And no you can't just add them.

You can take any number of non-transparent textures, and blend them like photoshop does. Just call glColor4f(1,1,1, layerAlpha), before you draw it to the screen. This is what gives your layer/texture alpha instead of an actual alpha component in the texture.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

If you actually have an image that when layered together like photoshop has alpha, then you need to be a bit tricker.

If you really want to overwrite the alpha channel, you can use glColor4f(1,1,1, alpha), and glColorMask(false, false, false, true) which makes you write only alpha components to the screen. In this case you can just draw a black quad and set any alpha you want.

NBA2K, Madden, Maneater, Killing Floor, Sims http://www.pawlowskipinball.com/pinballeternal

:) its directx

but i know what you mean

so is it posible on dx to merge several sprites to texture and get texture like merged layer on photoshop - change alpha chanel calculation

This topic is closed to new replies.

Advertisement