Game Development Community

Useful methods for improving framerate in Torque 3d?

by Matthew Lyles Hornbostel · in General Discussion · 05/22/2011 (12:04 pm) · 7 replies

Okay, I have a large level, and the level and everything in it total over 75,000 polys.

I didn't think this would be a problem; many current games run 500,000+ polygon levels in realtime quite smoothly.

In this case, though, everything is painfully lag-ridden while doing anything in the world editor or in 'play' mode...

There are a few things I can think of, off the top of my head, that might improve this. One is using a separate collision mesh and not basing collisions on the level geometry, one is occlusion culling, if I can find that feature and make it work, another is turning off the dynamic lighting/shadows; the level doesn't need it as there's already lighting baked into the textures.

Any other suggestions for things I can do to speed up the scene? Any general advice for making a level run more smoothly and efficiently in Torque 3d?


#1
05/22/2011 (12:28 pm)
Say hello to Draw Calls, he is you're new "poly count," and soon to be sworn enemy.

Got a diffuse texture? Cool, here's a draw call. I see you've got a specular with that, have another! Oooh, normal maps! Have another! (And so on, for every single object in your scene.)

The more low-res collision meshes you can generate, the better. This will free up the CPU.

Next up, textures: Reuse as many as humanly possible, and keep them as small as you can. If you can have more than one model use the same texture, it will take up less draw calls, and improve your FPS substantially.

In 1.1 final, occlusion is in with a vengeance. Learn her ways and you will be rewarded with even more FPS goodness.

Good thing about T3D is that it's a deferred rendering engine, which means all of the lights get put on a single draw call, so no real worries about dynamic lights and shadows. Baking will only help with lighting that needs more complexity, that dynamic lights just can't accomplish. (Bouncing, bleeding, etc.)
#2
05/22/2011 (12:33 pm)
Well if you don't need the fancy dynamic shadows there's your biggest saving.

Reduce Drawcalls. Every texture you have on an object makes that object be drawn again by the engine. Quick explanation and diagram of changes I made to how I worked

Reduce Instances. Every instance of an object needs to drawn separately (Forest Editor helps with this in certain cases). If you have 5 models next to each other, maybe make them 1 model.

Disable PlayerObject shadows in Basic/Lowest Lighting - these things are projected decals, numbers of which eat performance.

Reduce the VisibleDistance.

Make terrain lower quality. A 1024 heightmap eats a lot more performance than a 256.

Zones and Portals for occlusion (good for interior).
-------------------

However "performance" is really dependant on what you're aiming to play it on. 500K polys and 700 drawcalls and a load of Ai/Players, I'd expect to get 40fps on my box (2.4dualcore, GTS250).

Also remember that there are "quality options" for a reason, and that's to lower and raise visual fluff on other systems. I'e got my stuff playing on a built in intel GPU at 30fps on lowest settings. You can make your own additions/custom settings too - disable grass, sun flare, etc.
#3
05/31/2011 (1:33 pm)
Thanks, these tips were very helpful.
#4
06/02/2011 (1:16 pm)
question Steve.

Reduce the VisibleDistance.


how does that work with fog? if i dont want a 'hard break" and i add a fog at 700 and set the visible distance at 800 (random examples) at which point does the models stop rendering?
#5
06/02/2011 (1:19 pm)
Models stop rendering at visibleDistance, you'll have to fine tune your fog (0.002 etc) to hide the "hard break" by eye.
#6
06/02/2011 (1:22 pm)
ah, so the models that are inside the fog are still being rendered? good to know.

thank you much.
#7
06/02/2011 (1:23 pm)
Yep, they just get "fuzzed up" from human eyes, not the camera view.