#103 new
lindsay.kay (at xeolabs)

Ambient light source

Reported by lindsay.kay (at xeolabs) | June 3rd, 2010 @ 09:46 AM

In V0.7.5, the ambient light colour is taken from the SceneJS.Renderer#clearColor. The rationale was that the canvas colour represents the infinite scene "background".

However, we might want to show a model on a white background, in a scene with non-white (or even non-existent) ambient lighting. Solution is to provide an "ambient" LightSource type:

SceneJS.Lights({
      sources: [
         {
             type: "ambient",
             color: { r: .5, g: .5, b: .5 }
         }
      ]
});

When no "ambient" light is defined, the ambient light will default to the canvas colour, as it currently does.

Comments and changes to this ticket

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

SceneJS provides easy access to WebGL through a simple and declarative JavaScript API. The SceneJS API is functional, which enables its scene definitions to be really compact and expressive, while hooking into other JavaScript code just that little bit more smoothly.

Shared Ticket Bins

Pages