Page 2 of 2

Posted: Wed Dec 06, 2006 3:23 pm
by Rookie One.pl
jv_map wrote:They're used for spherical lighting (rgbGen lightingSpherical) and to calculate shadows of players/AI.
*slaps his forehead*
Yeah, that's right! Still, I think that placing them in the entity lump is rather inefficient, they could make another BSP lump to contain the coords, colours and radiuses of the lights in binary. Some disk space (entities are plain ASCII strings) and entity count could be saved.

Posted: Tue Jan 30, 2007 3:43 pm
by Rookie One.pl
Hey, I was working on HDRR simulation for MW2 and had to take an in-depth look into how the lights are stored. And what I found out is that I was both right and wrong when I said that light entities are just a waste of space. ;)

Quake engines use Gouraud shading for entities based on a 3D light grid. This means that I was right when I said they could be removed from the entity lump.

On the other hand, however, they do not eat up entity slots, as the game library spawn function frees it immediately:

Code: Select all

void SP_light( gentity_t *self ) {
	G_FreeEntity( self );
}
Still, if I'm ever going to edit q3map2's code, I'll make it remove the light entities after the lighting stage. :P