- Home /
Question by
regalix_digital · Jul 23, 2018 at 01:16 PM ·
webglissuetransparent shader
WebGl Transparent Background Issue
Hi I tried the following code for the background transparency:
var LibraryGLClear = {
glClear: function(mask)
{
if (mask == 0x00004000)
{
var v = GLctx.getParameter(GLctx.COLOR_WRITEMASK);
if (!v[0] && !v[1] && !v[2] && v[3])
// We are trying to clear alpha only -- skip.
return;
}
GLctx.clear(mask);
}
};
mergeInto(LibraryManager.library, LibraryGLClear);
And it works fine for the background, but as I have other shaders also which have the transparent materials (Legacy Shaders/Transparent/Specular) and due to the above script that is also not visible now.
Actually I am using this for the fade in animation.
Do you have any solution for this.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612171338im_/https://answers.unity.com/themes/thub/images/avi.jpg)