xeolabs / xeogl

A WebGL-based 3D engine for technical visualization. Not actively maintained.
http://xeogl.org
Other
1.14k stars 264 forks source link

Allow clearColor different from ambient light color and allow canvas transparency #104

Closed aothms closed 6 years ago

aothms commented 8 years ago
Description of the problem

Feature request.

glClearColor is hardcoded now to ambient color. While this is meaningful default, ideally it would be possible for users to override a clear color and to have a transparent canvas.

Relevant code snippet:

             // Canvas is opaque - set clear color to the current ambient
             // color, which can be provided by an ambient light source

             gl.clearColor(ambientColor[0], ambientColor[1], ambientColor[2], 1.0);
bastienmenis commented 8 years ago

I second this request. Allowing to have a transparent canvas would be great.

xeolabs commented 8 years ago

Actually we have transparent canvas support, check out this example.

@aothms does that give us what we need? I guess in BIMSurfer we'll want to allow users to programmatically set the colour of a DIV behind the canvas?

xeolabs commented 8 years ago

PS. Transparent canvas is great for efficiency, since it reduces the number of pixels that are rendered. Might be cool to make it default in xeoEngine, while making xeoEngine automatically provide the background DIV, while exposing the color of that as a 'backgroundColor' property on the XEO.Canvas component.