Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

Alpha transparency in texture maps

#183

Allow alpha transparency in texture maps

Resources

Reported by lindsay.kay (at xeolabs) · October 20th, 2010 @ 12:15 AM

State: open
Milestone: V0.7.9

Activity

  1. CryptoQuick
    CryptoQuick
    • Tag set to texture

    If you can, please be sure to support varying levels of transparency. Thanks! :)

    October 20th, 2010 @ 03:22 AM

  2. Andreas Osowski
    Andreas Osowski

    Right, so, I did a quick dib at this and implemented alpha mapping I guess.
    See the screenshot (I guess the blackish lines around the transparent edges
    are "z-fighting"?)

    The only thing that still is missing somewhat is:
    When using alpha maps, opacity should be 1.
    However, the current approach (with opacity) does not permit this, so all occurrences (in shading/renderModule.js)
    of renderOpaqueNodes need to be replaced with renderTransparentNodes I guess.

    The best solution here would be calling renderTransparentNodes instead of renderOpaqueNodes when
    node.texState.hash != "__scenejs_no_tex" as we currently only create new textures as RGBA anyway.

    Or we could also argue that all non-transparent nodes have an opacity and alpha of 1 anyway so that therefore the renderOpaqueNodes isn't needed at all and we can use renderTransparentNodes everywhere which seems like the best solution to me tbh (I don't know whether that'd have some performance impact though).

    October 20th, 2010 @ 03:01 PM

  3. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)

    In the Sirikata fork of GLGE - a "discard" keyword in GLSL, used for alpha transparency by the looks of it:

    http://github.com/sirikata/GLGE/commit/67c1ae074419927eb629bdad1f44...

    Perhaps not quite applicable to this case, but worth mentioning!

    October 21st, 2010 @ 02:40 PM

  4. Andreas Osowski
    Andreas Osowski

    "The discard keyword can only be used in fragment shaders. It causes the termination of the shader for the current fragment without writing to the frame buffer, or depth."

    I guess this might indeed be a nice feature in case the user wants to set a lower limit to transparency(possible performance boost?). I think that that should be an option for the scene or so though.

    October 22nd, 2010 @ 09:29 AM

  5. lindsay.kay (at xeolabs)
    lindsay.kay (at xeolabs)
    • Milestone changed from V0.7.8 to V0.7.9

    October 23rd, 2010 @ 02:10 AM

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.