Game Development Community

Lighting custom object - to dark

by Thomas \"Man of Ice\" Lund · in Torque Game Engine · 01/19/2007 (3:23 am) · 1 replies

I have a weird issue, that I'm unsure what to do about. So I'm trying here.

I am in the progress of porting over my old ship code from TGE to Air Ace in TGEA. The ship code is totally custom made, and doesnt explicitly handle anything lighting related in the code. It inherits from ShapeBase.

My problem is, that when I add a ship as a "Ship" object it gets really dark ingame. When I add the same dts as a static shape, it gets lit properly.

A few screenies to show the problem:

airaceonline.arcadersplanet.com/screenshots/shiplight1.jpg
airaceonline.arcadersplanet.com/screenshots/shiplight2.jpg
The dark ship is being added with these settings:

%aiship = new Ship() {
  dataBlock = American_Battleship;
  AIControlled = true;
  team = %team;
  receiveSunLight = "1";
  receiveLMLighting = "1";
  useCustomAmbientLighting = "0";
  customAmbientLighting = "0 0 0 1";
};

Also the American_Battleship datablock has an exposure = 2; that doesnt make any difference.

Would anyone have any clue on how to fix this?

Do I need to explicitly code anything into the ship class to support the lighting system in TGEA MS 4.1, or am I doing anything wrong on the script side?

Any help is greatly appreciated!

#1
01/22/2007 (11:21 am)
I posted in your other thread.

For anyone with a similar problem that doesn't have access to that thread:

Quote:
ShapeBase objects (except StaticShape and ScopeAlwaysShape) only receive lighting from the terrain or interior directly below the object. If you're not using an interior or terrain the lighting with not get picked up and the object's lighting defaults to (0.5 0.5 0.5) - see the last few lines of SceneObject::getLightingAmbientColor for details.

For environments similar to airace and the battleship game you should customize the object lighting. I recommend setting up all ShapeBase objects to receive sunlight directly:

ShapeBase::ShapeBase()
{
...

   overrideOptions = false;
   receiveLMLighting = false;
   receiveSunLight = true;
}