Any significant performance cost to using BlendState.Premultiplied?

Posted by Donutz on Game Development See other posts from Game Development or by Donutz
Published on 2012-07-10T15:29:25Z Indexed on 2012/07/10 21:25 UTC
Read the original article Hit count: 288

Filed under:
|

Normally I guess you'd use BlendState.AlphaBlend because normally when you load your textures through the pipeline they're already premultiplied. However, if you're loading textures at runtime from PNGs or some such, you have to loop through the pixels and premultiply them, which can take a long time if you've got a lot of textures to load.

So it looks (haven't tried it) like using BlendState.Premultiplied instead of BlendState.AlphaBlend should handle non-premultiplied textures and produce the same visual result, without all the startup costs. I have to wonder if there's a non-obvious cost to doing this, like a huge drop in performance or something. Anyone know?

© Game Development or respective owner

Related posts about XNA

Related posts about textures