x3dom/x3dom — pull request #172 by stepasite (2013-04-24 08:51:24+00:00)
Title: Background rendering changes

Hi,

Texture cube for background node is rendered when there is at least one background url/texture specified (there had to be all 6 urls specified before). Texture cube sides without texture remain transparent.

First standard background is rendered (sky and ground colors), then texture cube is rendered over it.

It allows interesting effects when there are some background textures missing and/or some textures have alpha channel specified.

I have tested rendering of textures for many scenes and all seemed to be OK.

Utils.createTextureCube() probably requires some optimization because of hardcoded texture width and height when creating transparent image. This function was also tested only with relation to backgrounds, another its usages haven't been tested.

Hope it is useful and does not contain any bugs.