Sign in to follow this  
polyfrag

Quake 3 BSP light volumes

Recommended Posts

polyfrag    2502
Has anyone here used them before?

My map has 963171 (141 x 207 x 33) grid points (according to the the QuArK output console).

num_lightvols_x = 141
num_lightvols_y = 207
num_lightvols_z = 33



The grid cell coordinates of an entity at (x,y,z) are:

gridx = (x - models[0].mins[0]) / 64;
gridy = (y - models[0].mins[1]) / 64;
gridz = (z - models[0].mins[2]) / 128 + 0.5f;



I access the light volume at:

gridz * num_lightvols_y * num_lightvols_x + gridy * num_lightvols_x + gridx

But this doesn't give the correct lighting info.

Share this post


Link to post
Share on other sites
polyfrag    2502
It actually says

Grid size = { 112, 96, 160 }

in the QuArK output console, which I have to use instead of {64, 64, 128} to avoid "light grid mismatch" where

lump[lightVolumes].length != numGridPoints * sizeof(lightVolume)

So the grid cell size isn't always 64x64x128?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this