Quick Links: Download Gideros Studio | Gideros Documentation | Gideros Development Center | Gideros community chat | DONATE
Documentation on Sprite:setBlendMode — Gideros Forum

Documentation on Sprite:setBlendMode

NascodeNascode Guru
edited June 2012 in General questions
Hello,

I am experimenting with Sprite:setBlendMode and would like to know what combination of glblendfunc used for Sprite.ALPHA, Sprite.NO_ALPHA, Sprite.ADD, Sprite.MULTIPLY, and Sprite.SCREEN. I cant find the info on the reference.
have fun with our games~
http://www.nightspade.com

Comments

  • evsevs Member
    Hello,

    This may help

    http://en.wikipedia.org/wiki/Blend_modes


    cheers

    evs

    Likes: SinisterSoft

    +1 -1 (+1 / -0 )Share on Facebook
  • atilimatilim Maintainer
    edited June 2012
    And here is the glBlendFunc combinations used in gideros:
    Sprite.ALPHA -> glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA)
    Sprite.NO_ALPHA -> glBlendFunc(GL_ONE, GL_ZERO)
    Sprite.ADD -> glBlendFunc(GL_ONE, GL_ONE)
    Sprite.MULTIPLY -> glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA)
    Sprite.SCREEN -> glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR)
    The reason why Sprite.ALPHA is not implemented as glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA) is because textures and all other transparency calculations are handled as premultiplied alpha.
Sign In or Register to comment.