Game Development Community

Bug:: Beta 1 :: The creation of over 30 light objects in one location

by JesseL · in Torque 3D Professional · 05/13/2009 (3:19 am) · 6 replies

I was playing around with different objects. I created a pointer that I could move around in game space with my player. I then created a list of items I could spawn. I created a ParticleEffectNode such as a torch. Ridged shaped object (Rolling Boulder). A light object with shadows and one without. I then proceeded to spam the enter key (which places a copy of the object in game under a different unique name auto generated) and found some interesting things.

Start with some simple system specs:
On a Intel i7 920 quad core with hyperthreading. (Love compile time /MP XD). with 6 gigs of ram. SSD harddrive 32 gigs and a Geforce GTX 260 video card.

I was only able to create about 125 ish Ridgid shape objects before the game bogged down (IT DID NOT CRASH) and ultimatly became non-responsive.

When I placed about 20 light objects then moved over to the right about 10 world units and placed another 20 light objects. They stayed red and looked fine at any angle. When I placed some light objects in between them however something strange happened. It was kind of like every time I hit the add light button the lights on both sides went dimmer. Then when I flew up in the air to take a different angle I could see them switch between which ones to display. Very weird.

About the author

I just realized that if I wanted to create a cat that caught on fire and ran up a telephone pole and then burst into a blue waterfall. That wouldn't be to hard!


#1
05/13/2009 (11:13 am)
There is a maximum number of light sources you can have in a scene, maybe you're trying to add more than your card can support?
#2
05/13/2009 (1:17 pm)
There isn't a limit to the amount of lights that you can add to a scene other than what will perform properly.

Any shadowed light is expensive... and even with LOD or lower quality shadow maps... its hard to have more than 3-4 of them near the camera at once.

Unshadowed lights are cheap and sould just give you an almost inperceptable hit in performance per light.

@JesseL - Some screenshots or video of that light issue would be very useful. I assume these were all point lights and unshadowed?
#3
05/13/2009 (1:22 pm)
@JesseL - You know... i think i know what that was... and its fixed for beta 2.

The lighting systems has 20 bins for lights that overlap in screen space. So if you have more than 20 sets of overlapping lights... things would break down. Thats probably what you ran into... the dimming was because it was ignoring some of the lights.

Luckily this binning is only really nessasary in the currently disabled LUV color mode. So the fix we applied to not bin in RGB color mode should solve your issue.
#4
05/13/2009 (2:15 pm)
The only reason I ran into this issue is because I was doing tests on what would crash the engine. Pretty much Bug hunting. trying random things to perhaps gain insight on how it works and how it doesn't. I created like over 5000 static shape objects about 1 world unit by 5 world units and 15 world units high. That was interesting! then I made 125 rigid shape objects and lagged out again XD.
#5
05/13/2009 (4:55 pm)
Well good to hear it didn't crash. :)
#6
05/13/2009 (5:05 pm)
Something to keep in mind about the number of RigidShapes compared to the number of static shapes, is that rigidshapes use about as much overhead as a vehicle would.

Haven't tried to abuse the lights yet, but I like your described testing method.