Inside3D!
     

Higher resolution lightmaps

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Mapping
View previous topic :: View next topic  
Author Message
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Thu Sep 10, 2009 12:55 am    Post subject: Higher resolution lightmaps Reply with quote

In wanting to add this feature to an engine, I'm wondering which lightmap compilers support this outputting higher resolution lightmaps and which command line switches that should be used to control said feature.

Hopefully somebody can save me a few hours of scrounging around the net; thanks!
Back to top
View user's profile Send private message
MauveBib



Joined: 04 Nov 2004
Posts: 602

PostPosted: Thu Sep 10, 2009 12:15 pm    Post subject: Reply with quote

I'm pretty sure this would require a new BSP format.
_________________
Apathy Now!
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Sep 10, 2009 2:07 pm    Post subject: Reply with quote

lightmap resolution is tied to texture samples.
16 texture pixels to 1 lightmap pixel.

You can use higher resolution textures if you don't change bsp format.
you could probably do it transparently by multiplying everything a bit and using a bigger .lit file.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Thu Sep 10, 2009 2:23 pm    Post subject: Reply with quote

Storing in the BSP would require a new format because the lightmap s/t calculation is hardcoded as a >> 4 in the engine, so at the very least some kind of flag to say "hey! shift by 3 instead!" would be required. You'd also need to increase the size of the blocklights array, as the current 18 x 18 is strictly based on a max surface extents that assumes left-shift by 4. Finally, the lightmap offset for each surface would also need to be changed or multiplied to reflect the bigger format. Something has to signal to the engine that these need to be done.

I like the idea of doing it in the LIT file, possibly extending the version number header integer to take a combination of flags. This way the old lighting can still be retained in the BSP (retaining compatibility with any engines that don't support the larger size), and the LIT file itself can signal to the engine that things are different.

Be aware however that doubling the lightmap resolution in either direction would have a 4 x overhead on animated and dynamic light calculations and uploads.
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Downsider



Joined: 16 Sep 2008
Posts: 478

PostPosted: Thu Sep 10, 2009 10:29 pm    Post subject: Reply with quote

LIT file sounds like a plan.

Any compilers out there support dynamic resolution lightmaps that output a nice LIT file? Or maybe some workaround involving double-resolution textures for the compiling process?

I'm aware of the "4x overhead" deal, yup.

I'm really surprised that it seems like nobody's done this yet? :O! I would've been sure support like this was already added into tons of engines, but I guess I'm mistaken.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Sep 10, 2009 11:36 pm    Post subject: Reply with quote

Downsider wrote:
I'm really surprised that it seems like nobody's done this yet?

Why use lightmaps when you can use shadow volumes?... Okay, so that's not perfect logic, but you get the idea.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Fri Sep 11, 2009 8:48 am    Post subject: Reply with quote

Spike wrote:
Downsider wrote:
I'm really surprised that it seems like nobody's done this yet?

Why use lightmaps when you can use shadow volumes?... Okay, so that's not perfect logic, but you get the idea.

Hard edges, real-time overhead, necessary data to make them look good and work right doesn't exist in Quake maps, plenty of reasons not to use shadow volumes.

Personally I favour a vertex lighting solution for general world light - this can be done with the data as is in a Quake map and can be blisteringly fast and without a lot of the artefacts other solutions have (although with certain artefacts of it's own).
_________________
DirectQ Engine - New release 1.8.666a, 9th August 2010
MHQuake Blog (General)
Direct3D 8 Quake Engines
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> Mapping All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2004 phpBB Group