PDA

View Full Version : Lighting performance



Ace_Man
12-06-2000, 09:38 PM
Is it common to take a substantial performance hit when using lighting..or am I doing something wrong...

I'm loading models in my program and calculating the normals for each triangle as I draw them..I'm using display lists to speed things up but it's an obvious performance difference with lihting enabled.

Any thoughts?

Ace_Man
12-06-2000, 09:43 PM
Oh yeah, and often with my models, the normals get calculated for the wrong side....some models are lit perfectly and some models have black triangles all over them (lit on the other side)...I wonder if there is a way to guard against this...or Export them from 3dtudio max differently...

I'd like to get my code general purpose enough to work with any model.

Vilu
12-07-2000, 01:35 AM
Without any real knowledge, I can pledge that dynamic lighting can halve performance.

tdavie
12-07-2000, 02:00 AM
Lighting does quite often give quite a performance hit, however you could improve your situation by using vertex and normal arrays, this way you can calculate the normals before hand, then create the display list and finally display the object. I find that this makes the whole thing speed up considerably.

Deiussum
12-07-2000, 05:07 AM
How are you exporting from Max? If you created your own MaxScript exporter, or a exporter using the Max SDK, you could just export the normals with it as well. I guess, if you're exporting using one of the other file formats, you might not have this option, though.

zed
12-07-2000, 12:22 PM
check out the nvidia performance faq (maybe applicable for other cards) it shows the performance drop related to the number of lights in a scene

Ace_Man
12-07-2000, 12:51 PM
I'm exporting in ASE format..I can export the normals with the file and read them. Would this be faster? I only calculate my normals once anyway in my code.

Deiussum
12-08-2000, 06:34 AM
I would think it would be a faster way to get the normals if you read them from the file. It probably wouldn't affect overall rendering performance, though. You can also be sure you're getting the right normals then.

[This message has been edited by Deiussum (edited 12-08-2000).]