High resolution lightmaps


(Pentagram) #1

Does anyone know how I can force lightmaps to be the same resolution as my source textures. I tried q3map_lightmapsamplesize 1 in my shaders but they are still lower rez on some surfaces. (Altough they are pretty high res on others…) So if you make the repeat of the texture higher the lightmap pixel resolution goes up too, independent of the surface size in world units but linked to the texture space.
Disclaimer:
Yes I know this will probably produce several 100 megs of lightmap data, this is what I want as I want to use them for some unique texturing experiments.
If it’s not possible I will do my own version that can do it :D, suggestions on where to look in the source are welcome then…

Charles


(The5thHorsemen) #2

-export in the lighting stage
edit them
then -import them next time around.

what resolution are you using?

from what I have read 1024 x 1024 is about as high as it will go .

plus the cached texture will reach crital mass if you go overboard,
and the game will just shutdown no?


(ydnar) #3

Use these switches on the commandline:

-external -lightmapsize 512

(or 1024, if you feel like getting crazy)

Combine this with _lightmapscale 0.0625 on worldspawn, and you’ll get a BSP with all lightmaps in maps/<mapname>/lm_NNNN.tga rather than in the BSP lightmaps lump.

This is how we did the lightmaps for Enemy Territory.

y


(Pentagram) #4

Hmmz that still seems to produce lower resolution lightmaps in some cases.
It produces about 48 megs of lightmap data for my testmap but much more won’t be possible I’m afraid, as it eats 1.6 gigs of ram during the compile :smiley: (It’s only a few corridors, and you can only have 2 gigs per process I think…)
But I wrote a little program that basically gives every surface an unique lightmap based on the texture resolution. (Lightmaps can have different sizes tough) But now I got 2.5 gig of textures :D, a bit more than I expected.
Another thing I noticed is that the lightmap data of the dsurface_t struct seems unitialized (I mean lightmapX, lightmapY, lightmapWidth, lightmapHeight, lightmapOrigin and lightmapVecs) is there a parameter to force them to be witten to the file?

Charles


(ydnar) #5

That data is vestigal. Q3Map2 writes it, but the game never uses it.

Q3Map1 did the lightmap allocation in the BSP phase. Q3Map2 does it in the light phase, as the absolute last thing, so lightmaps can be vertex approximated, duplicates eliminated, etc.

y