Jump to content
  • Advertisement
Sign in to follow this  
polyfrag

Quake 3 BSP light volumes

This topic is 2522 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

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
Advertisement
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
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!