Inside3D!
     

Lightmap with higher resolution (hmap2 + standard quake)

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Programming
View previous topic :: View next topic  
Author Message
JasonX



Joined: 21 Apr 2009
Posts: 89

PostPosted: Thu Mar 25, 2010 5:53 pm    Post subject: Lightmap with higher resolution (hmap2 + standard quake) Reply with quote

Quick question guys: how can i have lightmaps with a higher resolution using hmap2 and standard quake?
Back to top
View user's profile Send private message
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Thu Mar 25, 2010 6:26 pm    Post subject: Reply with quote

hmap2 -light -extra mapname

or

hmap2 -light -extra4x4 mapname
_________________
<ekiM> Son, you're writing data structures your CPU can't cache.
Back to top
View user's profile Send private message
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Thu Mar 25, 2010 9:03 pm    Post subject: Reply with quote

lightmap resolution is 1/16th of the regular texture resolution. Scale your textures, scale your lightmaps.
_________________
What's a signature?
Back to top
View user's profile Send private message Visit poster's website
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Thu Mar 25, 2010 9:03 pm    Post subject: Reply with quote

Lardarse wrote:
hmap2 -light -extra mapname

or

hmap2 -light -extra4x4 mapname


These just enable supersampling, they will not create a higher-resolution result.

In normal quake engines, the lightmaps are set at 1 sample per 16 texels. So to get more lightmap density on a wall, you can scale down the textures in your map editor.

So for example, replace your 64x64 texture with a higher-res 128x128 version (must be in the wad file itself, not using external textures), then in your map editor set the texture scale to 0.5 on all walls that use that texture, and you will get higher lightmap density.
Back to top
View user's profile Send private message
mh



Joined: 12 Jan 2008
Posts: 909

PostPosted: Fri Mar 26, 2010 10:14 am    Post subject: Reply with quote

2 things to be aware of before you do try this (this isn't for metl who already knows this...):

Firstly, lightmaps are loaded into a "blocklights" array before being sent to OpenGL. This is hard-coded to a size of 18*18, and is dependent on the max surface extents. If you boost the lightmap density you will need an engine modification to either reduce the max surface extents or increase the size of blocklights, otherwise you'll risk overflowing the array.

Secondly, you can expect dynamic light modification to be a serious performance hit.
_________________
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
JasonX



Joined: 21 Apr 2009
Posts: 89

PostPosted: Fri Mar 26, 2010 2:09 pm    Post subject: Reply with quote

What about software rendering, does it have this limit?
Back to top
View user's profile Send private message
frag.machine



Joined: 25 Nov 2006
Posts: 728

PostPosted: Fri Mar 26, 2010 7:19 pm    Post subject: Reply with quote

JasonX wrote:
What about software rendering, does it have this limit?


Actually, AFAIK this limit is due software render limitations (or, to be more exactly, with hardware constraints back in the software render only days).
_________________
frag.machine - Q2K4 Project
http://fragmachine.quakedev.com/
Back to top
View user's profile Send private message Visit poster's website
metlslime



Joined: 05 Feb 2008
Posts: 177

PostPosted: Fri Mar 26, 2010 7:21 pm    Post subject: Reply with quote

mh wrote:
2 things to be aware of before you do try this (this isn't for metl who already knows this...):

Firstly, lightmaps are loaded into a "blocklights" array before being sent to OpenGL. This is hard-coded to a size of 18*18, and is dependent on the max surface extents. If you boost the lightmap density you will need an engine modification to either reduce the max surface extents or increase the size of blocklights, otherwise you'll risk overflowing the array.


To be clear, these are not caveats related to using my suggestion above, they only apply if you intend to modify the engine to get what you want.
Back to top
View user's profile Send private message
leileilol



Joined: 15 Oct 2004
Posts: 1321

PostPosted: Fri Mar 26, 2010 8:26 pm    Post subject: Reply with quote

frag.machine wrote:
Actually, AFAIK this limit is due software render limitations


Or human limitations. How many people want to touch Abrash's crazy asm?
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> General Programming 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