Lightmap with higher resolution (hmap2 + standard quake)

Discuss programming topics for any language, any source base. If it is programming related but doesn't fit in one of the below categories, it goes here.
Post Reply
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Lightmap with higher resolution (hmap2 + standard quake)

Post by JasonX »

Quick question guys: how can i have lightmaps with a higher resolution using hmap2 and standard quake?
Lardarse
Posts: 266
Joined: Sat Nov 05, 2005 1:58 pm
Location: Bristol, UK

Post by Lardarse »

hmap2 -light -extra mapname

or

hmap2 -light -extra4x4 mapname
Roaming status: Testing and documentation
Spike
Posts: 2914
Joined: Fri Nov 05, 2004 3:12 am
Location: UK
Contact:

Post by Spike »

lightmap resolution is 1/16th of the regular texture resolution. Scale your textures, scale your lightmaps.
metlslime
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Post by metlslime »

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.
mh
Posts: 2292
Joined: Sat Jan 12, 2008 1:38 am

Post by mh »

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.
We had the power, we had the space, we had a sense of time and place
We knew the words, we knew the score, we knew what we were fighting for
JasonX
Posts: 422
Joined: Tue Apr 21, 2009 2:08 pm

Post by JasonX »

What about software rendering, does it have this limit?
frag.machine
Posts: 2126
Joined: Sat Nov 25, 2006 1:49 pm

Post by frag.machine »

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).
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC :) (LordHavoc)
metlslime
Posts: 316
Joined: Tue Feb 05, 2008 11:03 pm

Post by metlslime »

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.
leileilol
Posts: 2783
Joined: Fri Oct 15, 2004 3:23 am

Post by leileilol »

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?
i should not be here
Post Reply