Archived

This topic is now archived and is closed to further replies.

e

lightmap speed problems

Recommended Posts

Here is my problem. I have a 3D engine. It takes in HL map files, does the usual speed up tricks (ie BSP, PVS, etc..), and then calculates lightmaps. I then render all of this using OpenGL so I can test the output to see if it is A-OK. All of my lightmaps are stored per polygon and thus, I must swap lightmaps every polygon. I do use multitexturing, so I only need to switch the lightmap texture, but that still slows down performance considerably. My question is this: How do they (they being makers of Quake, HL, etc...) make games with such high framerates when so much texture swapping must be done? Are there some "secret" openGL commands (glSuperSpeed()) that I should know about? Thanks. -e Edited by - e on 7/25/00 1:27:26 AM

Share this post


Link to post
Share on other sites
In Q3 for example polys share lightmaps which means you have one lightmap covering several polys.AND the lightmaps in Q3 are only 128*128*3 so the lightmaps fit into the gfx cards memory easily which means short binding times....And I dunno but do you use texture objects in your app?

Greets,XBTC!

Share this post


Link to post
Share on other sites
XBTC: Yeah, I do use texture bindings. I figured out one problem which was in my code. I forgot one line of code (leastSplits = numSplits) which was causing huge numbers of unnecessary BSP splits . In Q3, the polys which share the lightmaps aren't always adjacent are they? I think I will implement that method of storing many lightmaps in one big one. BTW, thanks for replying so quickly.

Hey XBTC: I have another question. Are all of the lightmaps in Quake 3 the same size (ie are they all 32x32 or 16x16 or something?).

-e

Edited by - e on July 25, 2000 3:30:01 AM

Share this post


Link to post
Share on other sites
In Quake 3 all lightmaps are 128x128 (with RGB, 8-bits for each channel). The lightmap size for individual polygons is based on the size of the polygon. If you have a big polygon, then you have a bigger lightmap for it. In Quake3 one lightmap pixel covers 4 square feet area in a level.

MK42

Share this post


Link to post
Share on other sites