Sign in to follow this  

Premultiplied alpha channel - textures

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

This topic is 4264 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.

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