-
Notifications
You must be signed in to change notification settings - Fork 1
Unpack premultiplied alpha? #6
Copy link
Copy link
Open
Description
Consider enabling premultiplied alpha unpacking before loading the texture atlas into WebGL:
gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, true)This has many advantages:
https://home.comcast.net/~tom_forsyth/blog.wiki.html#%5B%5BPremultiplied%20alpha%5D%5D
http://blogs.msdn.com/b/shawnhar/archive/2009/11/06/premultiplied-alpha.aspx
http://kriscg.blogspot.co.uk/2009/11/premultiplied-alpha.html
http://stackoverflow.com/questions/11521035/blending-with-html-background-in-webgl
but the blending function in voxel-shader may also have to change:
gl.blendFunc(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA)
gl.blendFunc(gl.ONE, gl.ONE_MINUS_SRC_ALPHA)
gl.blendFuncSeparate(gl.SRC_ALPHA, gl.ONE_MINUS_SRC_ALPHA, gl.ONE, gl.ONE_MINUS_SRC_ALPHA)also see:
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels