The Dreaded Black Box

30 June 2015 02:41
This drove me crazy, but I think I located the issue. Here is a typical “exports.init”, using “app.init”:

exports.init = function() {
canvas_container_id: "canvas3d",
callback: init_cb,
show_fps: true,
physics_enabled: false,
alpha: true

If the above function is used, the scene loads clean. If “alpha:” is false, then a black box appears in the upper left corner of the screen, during the scene loading. Why? Is this a bug?

This doesn't affect the main scene, once loaded, but looks bad when presenting a nice preloader. I may be able to just live with “alpha” kept as true, but I hope you may comment.
This “black box” issue also appears in earlier versions of B4W. It is strange that I haven't noticed it, before, but I am just now getting involved with pre-loaders.

The “Code Snippets” example shows this symptom with:
Custom Anchors
Dynamic Geometry

By the way, “Morphing” (in Code Snippets)doesn't work for me, in the 15.06RC.

My system:

Windows 7 Pro
I7 Cpu w/24Gb ram
Nvidia Titan Black GPU
Blend4web 15.06RC

30 June 2015 08:23
Browser - Firefox, I guess? I can reproduce this issue with this app on my MBP. The reason is still to be investigated…
The Founder | Twitter | Facebook | Linkedin
30 June 2015 09:25
Yes, Firefox. I encountered this issue with version 35, but it I upgraded to 38.0.5 and still have the issue. I also updated my Nvidia driver with no effect.
30 June 2015 11:39

You see, that black box is actually unscaled canvas being rendered during scene load. Yes alpha=true definitely fixes the issue, but if you already have some custom preloader it would be better to draw it above the canvas. To do that, assign "z-index" property to it's CSS style or use container.insert_to_container() method (pass "LAST" order to it).

Morphing app is already fixed, wait for our release today.
30 June 2015 17:01
I had no idea why this was happening! Firefox's native debugger provided no clue as to what this was. I found the same symptom in your demos and was able to locate the code that affected it.
I very much thank you and your team for the great support! Explaining this saves me many more hours of frustration, and provides a much better understanding of this amazing new tool.

I think I'd prefer to tweak my css, rather than write more code.
Please register or log in to leave a reply.