Game Development Community

PVR textures with pre multiply alpha?

by Blake Drolson · in iTorque 2D · 01/09/2013 (1:58 pm) · 2 replies

Hi there,

So we are using texture packer to create our PVR images, and it works well, produces good looking results. One thing though is that it suggests that we use a PreMultiply Alpha when making the PVR's to avoid having black halo's. So we did this, but then it states that we should turn on PremultiplyAlpha in the objective-c when using it with coco2d. They say it will avoid black halo's around the sprites when rendered.

They say use this in code... [CCTexture2D PVRImagesHavePremultipliedAlpha:YES]; Thing is I dont see anything like this in the code. I asked around in IRC, and they thought I would have to set this premultiplyAlpha as a blend factor. I also dont see how to do this.

Is this anything we should be using, trying to figure out how to do? I am using the GLKit changes from paul Jan (iT2d 1.50 CE).

If anyone has feedback or suggestions or outright solutions, it would be most appreciated. Thanks.

#1
01/09/2013 (5:53 pm)
I did a quick search and found this blog entry:
http://www.renderpaz.com/2010/06/premultiplied-alpha-for-iphone-games.html
This would appear to match the IRC conversation about using blending settings.

To get blend mode(ONE, ONE_MINUS_SRC_ALPHA) in t2d/it2d:

In the t2dStaticSprite (or any other t2dSceneObject)
SrcBlendFactor = "ONE";
DstBlendFactor = "ONE_MINUS_SRC_ALPHA";

#2
01/09/2013 (9:35 pm)
Thanks Paul, gives me and the artist some options to play with to see what looks best. Appreciate the feedback.