Open Daemon456 opened 9 years ago
Have you tried to set setBackgroundColor
parameter? The default value is 0x000000ff
(= R:0,G:0,B:0,A:255)
. setBackgroundColor: 0
may work.
Thanks for the suggestion. I tried 0, and it is still black. I also tried the default: 0x000000FF, but that actually changed the background to blue.
hmm, so I recommend you to use developer console for checking WebGLRendererFactory.prototype.setBackgroundColor
function doing right thing or not.
in WebGLRendererFactory.prototype.setBackgroundColor
I set the background color array to this: this.backGroundColor = [0, 0, 0, 0];
and in WebGLRendererFactory.prototype.setClearColor
I set clearColor to this:
gl.clearColor(0, 0, 0, 0);
The background is still black.
How about changing alpha:false
to alpha:true
in this line? https://github.com/gree/lwf/blob/740f76571edb19ccab87a308f403fd4acbc58bc5/coffee/js_debug/lwf.js#L10625
alpha: true,
Doesn't change anything.
I guess you are testing your content on LWFS. Currently various WebGL implementations seem to have some issues for transparent canvases:
http://stackoverflow.com/questions/11554654/webgl-blendfunc-bug-or-misunderstanding http://www.html5gamedevs.com/topic/9098-strange-webgl-results-on-ios8/
so that LWFS set the canvas's background to be black and opaque:
You should be able to get a transparent canvas by adjusting these code (and with alpha: true
), but it may cause troubles in blending.
Canvas output has a transparent background, webgl output has a black background. Ideally webgl output background would be transparent.