Game Development Community

Big rendering hit w/ lots of sgUniversalStaticLights

by Orion Elenzil · in Torque Game Engine · 05/22/2006 (6:27 pm) · 3 replies

Hi all -

we've got about 140 sgUniversalStaticLights in our mission,
which we only just now realized have been about halving our framerate.

bummer !

as i understood things,
once the mission is lit that's it for overhead.

is this not the case ?

is there maybe some option of an sgUniversalStaticLight which maybe we're using that might account for the hit ?

we've got about 15 or so different datablocks,
here's one of them.

my plan of attack is to make all 140 lights use one datablock,
and then experiment with the settings in there.

tia,
orion

datablock sgUniversalStaticLightData(citycardlight) {
   className = "sgUniversalStaticLightData";
   LightOn = "1";
   Radius = "18";
   Brightness = "1";
   Colour = "1.000000 1.000000 1.000000 1.000000";
   FlareOn = "0";
   FlareTP = "1";
   FlareColour = "1.000000 1.000000 1.000000 1.000000";
   ConstantSizeOn = "0";
   ConstantSize = "3";
   NearSize = "3";
   FarSize = "0.5";
   NearDistance = "10";
   FarDistance = "30";
   FadeTime = "0.1";
   BlendMode = "0";
   AnimColour = "0";
   AnimBrightness = "0";
   AnimRadius = "0";
   AnimOffsets = "0";
   AnimRotation = "0";
   LinkFlare = "1";
   LinkFlareSize = "0";
   MinColour = "0.000000 0.000000 0.000000 1.000000";
   MaxColour = "1.000000 1.000000 1.000000 1.000000";
   MinBrightness = "0";
   MaxBrightness = "1";
   MinRadius = "0.1";
   MaxRadius = "18";
   StartOffset = "-5 0 0";
   EndOffset = "5 0 0";
   MinRotation = "0";
   MaxRotation = "359";
   SingleColourKeys = "1";
   RedKeys = "AZA";
   GreenKeys = "AZA";
   BlueKeys = "AZA";
   BrightnessKeys = "AZA";
   RadiusKeys = "AZA";
   OffsetKeys = "AZA";
   RotationKeys = "AZA";
   ColourTime = "5";
   BrightnessTime = "5";
   RadiusTime = "5";
   OffsetTime = "5";
   RotationTime = "5";
   LerpColour = "1";
   LerpBrightness = "1";
   LerpRadius = "1";
   LerpOffset = "1";
   LerpRotation = "1";
   StaticLight = "1";
   SpotLight = "0";
   SpotAngle = "1";
   AdvancedLightingModel = "1";
   EffectsDTSObjects = "1";
   CastsShadows = "0";
   DiffuseRestrictZone = "0";
   AmbientRestrictZone = "0";
   LocalAmbientAmount = "0.402299";
   SmoothSpotLight = "0";
   DoubleSidedAmbient = "1";
   LightingModelName = "SG - Original Stock (Lighting Pack)";
};

#1
05/23/2006 (1:24 am)
Hi Orion,

Off the top of my head the main options that affect rendering performance are (in order of impact):

-dynamic lights
-casts shadows (but only if there are DTS objects around it that cast dynamic shadows, it's actually the dynamic shadows that cause the slow down and not the static shadows)
-lens flares (these consume fill rate and if there are a lot of lights visible at once it adds up fast)
-affect DTS object (lights that directly affect DTS objects affect rendering performance)


If one of these is affecting your performance there may be ways to minimize the hit without disabling the option. For instance using zones will help the performance of all of these options, disabling dynamic shadows on some DTS objects could help, or reducing the flare size (depending on which option(s) are cause the hit to your scene).

Let me know what you find out and hopefully I can give you some advice on reducing the rendering overhead.
#2
05/23/2006 (3:00 pm)
Hey John - thanks for getting back.

turns out our main culprit was dynamic lights.
we were using them pretty liberally,
and now have all but a select fer back to static + affect DTS
and the FPS improvement is dramatic.

many thanks,
orion
#3
05/24/2006 (9:53 am)
Cool, I'm glad everything is back to normal. Btw: I saw some info on your project in another thread, it looks really good - awesome job!