All that lighting is a lot of performance being chewed up by something
that could be handled by texture baking.  I'm doing a project where I
go from a dimly lit room to a brightly lit room and I do it simply by
baking textures for both states in an external 3d modeling program
(3ds max) and then just swapping the textures at the appropriate time
in code.  Also, I could be wrong, but I thought only
DirectionalLight3D worked with phong materials.  If texture baking is
unfamiliar to you, as it was to me a month ago, I HIGHLY suggest doing
a little googling and adding it to your repetoire.  Its really the
best way to add "realistic" lighting to an away3d scene without
tanking performance.

You could try frustum clipping to resolve your disappearing floor
problem, if I am understanding it correctly.

Everything I've mentioned here can be seen in action in this example:
http://www.infiniteturtles.co.uk/blog/away3d-23-released.  Relevant
excerpts below:

// adding frustum clipping is this easy
clipping = new FrustumClipping({minZ:10});
view = new View3D({scene:scene, camera:camera, clipping:clipping});



On Apr 1, 11:16 pm, cwpeter <[email protected]> wrote:
> Guys, I am working on my first Away3D project & I'm trying to light up
> the inside of a room that is 2000x8000x8000 pixels. How can I make the
> room bright? First, I don't see why I would need 8 lights to light the
> room up, but I tried adding this many hoping it would help.
>
> I have 2 PointLight3Ds per side of the room, which are all white, and
> I have tweaked with this code over and over and over to try and make
> it brighter in the room, but it always very dark. The walls are all
> PhongBitmapMaterial which is a jpg of a wallpaper type texture.
>
> Also, how can I make sure the floor of the room is always visible?
> When I tilt the HoverCamera3D up past about 0 degrees tilt, the floor
> disappears.
>
> Here is a snippet of the code for the lights to get an idea of what I
> have done:
>
> private function initLights():void
> {
>     // PointLight Front 1 & 2
>     _lightFront = new PointLight3D();
>     _lightFront.color = 0xFFFFFF;
>     _lightFront.ambient = 0.2;
>     _lightFront.diffuse = 0.75;
>     _lightFront.specular = 0.1;
>
>     _lightFront2 = new PointLight3D();
>     _lightFront2.color = 0xFFFFFF;
>     _lightFront2.ambient = 0.2;
>     _lightFront2.diffuse = 0.75;
>     _lightFront2.specular = 0.1;
>
>     // PointLight Back 1 & 2
>     _lightBack = new PointLight3D();
>     _lightBack.color = 0xFFFFFF;
>     //_lightBack.ambient = 0.2;
>     //_lightBack.diffuse = 0.75;
>     //_lightBack.specular = 0.1;
>
>     _lightBack2 = new PointLight3D();
>     _lightBack2.color = 0xFFFFFF;
>     //_lightBack2.ambient = 0.2;
>     //_lightBack2.diffuse = 0.75;
>     //_lightBack2.specular = 0.1;
>
>     // PointLight Left 1 & 2
>     _lightLeft = new PointLight3D();
>     _lightLeft.color = 0xFFFFFF;
>     //_lightLeft.ambient = 0.2;
>     //_lightLeft.diffuse = 0.75;
>     //_lightLeft.specular = 0.1;
>
>     _lightLeft2 = new PointLight3D();
>     _lightLeft2.color = 0xFFFFFF;
>     //_lightLeft2.ambient = 0.2;
>     //_lightLeft2.diffuse = 0.75;
>     //_lightLeft2.specular = 0.1;
>
>     // PointLight Right 1 & 2
>     _lightRight = new PointLight3D();
>     _lightRight.color = 0xFFFFFF;
>     //_lightRight.ambient = 0.2;
>     //_lightRight.diffuse = 0.75;
>     //_lightRight.specular = 0.1;
>
>     _lightRight2 = new PointLight3D();
>     _lightRight2.color = 0xFFFFFF;
>     //_lightRight2.ambient = 0.2;
>     //_lightRight2.diffuse = 0.75;
>     //_lightRight2.specular = 0.1;
>
>     positionLights();
>
>     _scene.addChild(_lightFront);
>     _scene.addChild(_lightFront2);
>     _scene.addChild(_lightBack);
>     _scene.addChild(_lightBack2);
>     _scene.addChild(_lightLeft);
>     _scene.addChild(_lightLeft2);
>     _scene.addChild(_lightRight);
>     _scene.addChild(_lightRight2);
>
> }
>
> private function positionLights():void
> {
>     _lightFront.x = -(_roomWidth / 8);
>     _lightFront.y = _roomHeight * 0.8;
>     _lightFront.z = _roomWidth / 4;
>     _lightFront.radius = _roomWidth / 100;
>     _lightFront.lookAt(new Number3D(0, 0, _roomWidth / 2));
>
>     _lightFront2.x = _roomWidth / 8;
>     _lightFront2.y = _roomHeight * 0.8;
>     _lightFront2.z = _roomWidth / 4;
>     _lightFront2.radius = _roomWidth / 100;
>     _lightFront2.lookAt(new Number3D(0, 0, _roomWidth / 4));
>
>     _lightBack.x = -(_roomWidth / 8);
>     _lightBack.y = _roomHeight * 0.9;
>     _lightBack.z = -(_roomWidth / 4);
>     _lightBack.radius = _roomWidth / 10;
>     _lightBack.lookAt(new Number3D(0, 0, -(_roomWidth / 2)));
>
>     _lightBack2.x = _roomWidth / 8;
>     _lightBack2.y = _roomHeight * 0.9;
>     _lightBack2.z = -(_roomWidth / 4);
>     _lightBack2.radius = _roomWidth / 10;
>     _lightBack2.lookAt(new Number3D(0, 0, -(_roomWidth / 2)));
>
>     _lightLeft.x = -(_roomWidth / 4);
>     _lightLeft.y = _roomHeight * 0.9;
>     _lightLeft.z = -(_roomWidth / 8);
>     _lightLeft.radius = _roomWidth / 10;
>     _lightLeft.lookAt(new Number3D(-(_roomWidth / 2), 0, 0));
>
>     _lightLeft2.x = -(_roomWidth / 4);
>     _lightLeft2.y = _roomHeight * 0.9;
>     _lightLeft2.z = _roomWidth / 8;
>     _lightLeft2.radius = _roomWidth / 10;
>     _lightLeft2.lookAt(new Number3D(-(_roomWidth / 2), 0, 0));
>
>     _lightRight.x = _roomWidth / 4;
>     _lightRight.y = _roomHeight * 0.9;
>     _lightRight.z = -(_roomWidth / 8);
>     _lightRight.radius = _roomWidth / 10;
>     _lightRight.lookAt(new Number3D(_roomWidth / 2, 0, 0));
>
>     _lightRight2.x = _roomWidth / 4;
>     _lightRight2.y = _roomHeight * 0.9;
>     _lightRight2.z = _roomWidth / 8;
>     _lightRight2.radius = _roomWidth / 10;
>     _lightRight2.lookAt(new Number3D(_roomWidth / 2, 0, 0));
>
>
>
> }


-- 
To unsubscribe, reply using "remove me" as the subject.

Reply via email to