#183 open
lindsay.kay (at xeolabs)

Alpha transparency in texture maps

Reported by lindsay.kay (at xeolabs) | October 20th, 2010 @ 12:15 AM | in V0.7.9

Allow alpha transparency in texture maps

Resources

Comments and changes to this ticket

  • CryptoQuick

    CryptoQuick October 20th, 2010 @ 03:22 AM

    • Tag set to texture

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

  • Andreas Osowski

    Andreas Osowski October 20th, 2010 @ 03:01 PM

    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).

  • lindsay.kay (at xeolabs)

    lindsay.kay (at xeolabs) October 21st, 2010 @ 02:40 PM

    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!

  • Andreas Osowski

    Andreas Osowski October 22nd, 2010 @ 09:29 AM

    "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.

  • lindsay.kay (at xeolabs)

    lindsay.kay (at xeolabs) October 23rd, 2010 @ 02:10 AM

    • Milestone changed from V0.7.8 to V0.7.9

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.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.

Shared Ticket Bins

Attachments

Tags

Pages