Jump to content
  • Advertisement
Sign in to follow this  
David Clark

Premultiplied alpha channel - textures

This topic is 4450 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

Hey, I have a A8R8G8B8 texture which i load from a file and, using an orthagonal projection and a quad, i render it. However, to speed things up, I want to use a premultiplied alpha channel. How can I multiply my RGB values by the alpha value? Thanks :)

Share this post


Link to post
Share on other sites
Advertisement
One way is to do it in any art program, like photoshop. That's probably the most efficient if you're only using the texture premultiplied.

Doing it in software, you can alpha-blend it onto an empty render target, or render it without blending into a render target and do the alpha multiplication in texture stages or a pixel shader.

On the other hand, do you really need this optimisation? Premature optimisation is the bane of code writing. :)

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.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!