Scene light

Software: Away3D 4.x

Avatar
Darcey, Moderator
Posted: 27 October 2011 09:31 PM   Total Posts: 209

Just wondering, when you change the view background colour shouldn’t this effect all the lights of the scene aswell?

EG. If you have a white lit scene, and a red directional light with a cube placed in it. Wouldnt the side facing away from the red light, be a grade of white and the side facing the red light be red combined with white?

Or is there another way to achieve this?

D

   

eclectrik, Newbie
Posted: 27 October 2011 10:16 PM   Total Posts: 19   [ # 1 ]

When you create a material for a surface, for example BitmapMaterial, you can add which lights affect it, and there`s also an `ambient` property which controls the amount of all-round ambient light as well as `ambientColor` which controls the colour of that..

Not sure if there`s a more generic way to achieve that!

   

Avatar
Darcey, Moderator
Posted: 27 October 2011 10:23 PM   Total Posts: 209   [ # 2 ]

Nope, I don’t think you get what I am on about… Here is an example of what I am trying to do:

http://www.aftc.co.uk/dev/flare3d/LightsFogAndSceneLighting/index.html

I don’t think there is a way to change the scene light from black, eg see the star 3d model in this example compared to the above example which is what I am trying to achieve:

http://www.aftc.co.uk/dev/away3d/LightsFogAndSceneLighting/index.html


It was achieved by using:
scene.clearColor.setTo( 1, 1, 1 ); // A3D4 is view.backgroundColor
scene.lights.ambientColor.setTo( 1, 1, 1 ); // A3D4 not sure is able to do this(yet)

D

   

Avatar
Darcey, Moderator
Posted: 27 October 2011 10:28 PM   Total Posts: 209   [ # 3 ]

I’ve updated the Away3D 4 example to look a bit better and all 3 objects to use fog now… But shows that scene light is black. Which I want to change to white.

   

eclectrik, Newbie
Posted: 27 October 2011 10:36 PM   Total Posts: 19   [ # 4 ]

I`m not sure i get you.  It`s darkens where there is an absence of light, which is not due to a `scene light` in my understanding.  Ambient light intensity and colour of your material i think is effectively what you`re after - maybe i don`t quite get what you`re saying though smile

 

   

Avatar
Darcey, Moderator
Posted: 27 October 2011 10:41 PM   Total Posts: 209   [ # 5 ]

1. If I add a cube with a material to the scene with no lights we wont see it.

2. If I add a cube with material to the scene with a directional light, we will see it. But black is the dark.

I want my objects to come out from white (bit more than a fog effect) so the closer they get to a light which is not white we will see that light showing that object up. Simply a reverse of white and black, this would allow for the possibility of a black light. Neither engine can do this to my knowledge. I think I may have to settle for a fog effect alone.

   

Avatar
Darcey, Moderator
Posted: 27 October 2011 10:47 PM   Total Posts: 209   [ # 6 ]

Here are 2 more examples better exampling the effect:

This is correct:
http://www.allforthecode.com/dev/flare3d/LightsFogAndSceneLighting2/index.html


This is as close as I can get to that effect with Away3D4:
http://www.allforthecode.com/dev/away3d/LightsFogAndSceneLighting2/index.html

D

   
   

X

Away3D Forum

Member Login

Username

Password

Remember_me



X