+ Reply to Thread
Results 1 to 8 of 8

Thread: Premultplied alpha availability?

  1. #1
    Senior Member
    Join Date
    Jan 2005
    Location
    Argentina
    Posts
    602

    Default Premultplied alpha availability?

    I'm trying to know if premultiplied alpha is available in all the graphic cards affected by the downloadable casual game market.

    This is the blending equation:
    GL_ONE, GL_ONE_MINUS_SOURCE_ALPHA (openGL)
    or
    D3DRS_SRCBLEND <- D3DBLEND_ONE
    D3DRS_DESTBLEND <- D3DBLEND_INVSRCALPHA
    (Direct3D)

    I don't even know where to start.
    I have checked in databases and any card in the earth can handle both separated blendings: ONE for source, and ONE_MINUS_SourceAlpha for dest, but this won't guarantee that both will work at the same time. Or does it?

    I have seen reports that says that FX5500 is not capable of premultiplied alpha, which doesn't have sense at all.
    http://forums.nvidia.com/index.php?s...4&#entry439644
    Blend and Shade Capabilities :
    GradientFill Rectangle : No
    GradientFill Traingle : No
    Per Pixel AlphaBlend : Yes
    Premultiplied Alpha : No
    So I'm a bit confused ...
    Any help would be really appreciated.

  2. #2
    Senior Member
    Join Date
    Jul 2004
    Location
    Isle of Wight, UK
    Posts
    3,773

    Default

    This is as old as the hills. Even when DXTn was knew, they added DXT2 and DXT4 as placebos just for pma. The formats are identical to DXT3 and DXT5, but they were added to be useable as metadata for when the alpha had been premultiplied or not if you loaded them as .DDS files. (By checking the type)

    So it should work on anything. If some card or other can't do it, your graphics will be a bit darker, but I wouldn't sweat it personally. That link you have might even refer to DXT2/4 support as opposed to blend modes.
    Regards,
    Paul Johnson

    [Great BIG War Game: iOS | Android] [Great Little War Game: iOS | Android] [Fruit Blitz: iOS | Android] [Yachty Deluxe: iOS | Android]

  3. #3
    Senior Member
    Join Date
    Sep 2004
    Location
    San Jose, CA.
    Posts
    1,726

    Default

    Yeah, I think the PMA support listed above is referring to support for DXT2/4 modes, not the blending modes.

    The blending modes you are interested in are just general blending ops; they are not inherently tied to pre-multiplied alpha. As far as I can remember, they have been supported since OpenGL 1.0. Checking the OpenGL reference pages shows that a subset of the blend factors require OpenGL 1.4; GL_ONE and GL_ONE_MINUS_SOURCE_ALPHA are not included in that list.

    I'd personally be pretty shocked if you found a card that didn't support those modes. Even Playstation 2 supported it, and it had worst blend unit I've ever seen.

    And to answer your question, yes, if a card supports both separate ops, it should support both simultaneously.
    Peter Young | www.attitudegain.com | Linkedin | Twitter

    Projects:
    Meridian 59: Evolution
    ???
    ???

  4. #4
    Senior Member
    Join Date
    Jan 2005
    Location
    Argentina
    Posts
    602

    Default

    Thanks.

    Quote Originally Posted by vjvj View Post
    And to answer your question, yes, if a card supports both separate ops, it should support both simultaneously.
    this would be the answer.
    Where can I check that?

  5. #5
    Senior Member
    Join Date
    Sep 2004
    Location
    San Jose, CA.
    Posts
    1,726

    Default

    Quote Originally Posted by Pogacha View Post
    Thanks.


    this would be the answer.
    Where can I check that?
    Unfortunately, I think this is one of those cases where what you are asking for is so basic (and I don't mean that in a condescending way) that you're not going to find such data anywhere, since there is no real notion of separation.

    It's like trying to find a list of sprite rendering engines that support both X and Y positions for sprites. No such list exists because all sprite rendering engines support that feature.

    If you want to do at least some sanity checking, you'll have to pull up some old cards and just check the DX caps. Just make sure to check for the actual blend modes and ignore the notion of "pre-multiplied alpha" to prevent any confusion.

    You can also look for OpenGL docs that describe glBlendFunc. Again, blending isn't an extension (it's part of the core API), so you'll have to figure out which version introduced these blend modes. It's DEFINITELY 1.3 or earlier (based on the info in my previous post), but if I had to guess I would say support for these blend modes has been in GL since 1.0.
    Peter Young | www.attitudegain.com | Linkedin | Twitter

    Projects:
    Meridian 59: Evolution
    ???
    ???

  6. #6

    Default

    If you are truly paranoid, you can write a test function that blends two triangles with known values, then reads back the framebuffer to see if you get the expected result color. Then you can warn users that the game may not look right, or fall back to some other blending mode, or whatever.

    But if the blending modes are part of the GL 1.0 spec, you shouldn't need to worry. VJVJ is right.

  7. #7
    Senior Member
    Join Date
    Jan 2005
    Location
    Argentina
    Posts
    602

    Default

    Yes, paranoid!

    I checked which cards accepts those blending modes, and all the cards in the world accept them. I guess you are right it would be really improbable that a card won't accept it.

    Thanks

  8. #8
    Senior Member
    Join Date
    Jul 2004
    Location
    Durham, UK
    Posts
    4,873

    Default

    All hardware has supported that blending mode since 1.0.

    Cas

+ Reply to Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts