Search code examples
texturestransparencyx3dx3dom

Semi-transparent pixels rendered as fully transparent


X3DOM (WebGL framework) renders some semi-transparent pixels on a texture as fully transparent:

http://54.213.93.173/fx/simple/

This creates a visible border. The color should just smoothly blend with the background, as it does in the texture:

http://54.213.93.173/fx/simple/transp.png

This problem does not occur if I do the same thing in an X3D file and render it with an X3D viewer, such as Instant Reality:

http://54.213.93.173/fx/simple/simple.x3d

Also, I think X3DOM does not render anything with a transparency above 0.9. If this is related, is there a way to increase this threshold?

Is this a problem with the way browsers implement WebGL?


Solution

  • One way to fix it is with:

    <Appearance alphaClipThreshold="0.0">
        ...
    </Appearance>
    

    This works with the latest dev version of X3DOM.