State of the art Q3 lightmap building

Discussion for Level editing, modeling, programming, or any of the other technical aspects of Quake
Post Reply
cityy
Posts: 1020
Joined: Mon Aug 10, 2009 8:23 am

State of the art Q3 lightmap building

Post by cityy »

For a while now, nigrum has been developing a fork of GTKradiant, NetRadiant Custom: https://github.com/Garux/netradiant-custom
I'm sure many of you who still have an eye on Quake 3 map making have seen it already but I don't think it has been discussed on here. I'm toying around a bit with some mapping over the holidays and have been using this version of Radiant for the last couple days. It comes with some very convenient improvments such as wasd movement in the 3D-Viewport or better translation tools. I have also been making use of the zero effort external lightmaps feature which allows you to create external lightmaps just using a q3map2 switch. That in particular is quite a game changer for me.

Through dealing with this I have also discovered other q3map2 features such as -exposure which was introduced by the Urban Terror community already a long time ago (works similarily to -compensate). As a consequence I have asked myself what is a state of the art approach to Q3 map building in terms of light builds. Over the years there have been different approaches.

The most recent topic of discussion has probably been Lunaran's and KungFuSquirrel's You'll Shoot Your Eye Out using over 120 sunExt suns in their skybox shader to achieve a very sophisticated look of global Illumination. This is essentially, in my eyes, actively immitating scattered light through using a variety of "suns" and thus achieving a more "realistic" lighting that reminds of using HDRi lighting in modern day engines or rendering toolkits. The geometry of the level helps a little I guess, with the map being a space floater and light thus being able to enter from less steep angles into the lower parts of the map.
Another thing I have learned from this map is that the influence of level wide fog on the appearance of the lighting is immense. Of course the fog does not affect the lightmap but it does appear to highly affect the lower and upper ends of the lighting value range, greatly contributing to a less contrasty but yet not stale range of colors. I have done a quick comparison of fog and no fog in an entirely skybox lit map area:
01.jpg
02.jpg
In his Rustgrad level, Hipshot is following a very different approach as can be observed in the map source. He is relying on a single sun combined with a lot of individually placed lights and a high _minlight value in worldspawn to achieve the very distinct aesthetic of the map. The goal of it might have been similar to what You'll Shoot Your Eye out wanted to achieve: Eliminating those pitch black spots in the lightmap that do not provide any information. What I have (re-)learned here is that the color pallette of the textures you are using should be taken into consideration for the way you light the level. The way the lightmaps blend onto darker or brighter textures and how the game appears to handle overbright bits make different approaches necessary. At least that is my take on it.

A third approach I have tried this week is one I observe in modern day architecture visualization, especially interior. Since in reality the sunlight is much much more intense then any artificial light source, some methods of modern day archviz try to replicate that difference in intensity and use an high intensity on the sunlight or HDRi light image. With this approach however you run danger of loosing information at the upper end of the value spectrum (over exposure). Rendering engines like Blender's cycles solve this partially by using filmic color management profiles instead of sRGB (from what I understand). What I think you can do in q3map2 is make use of -compensate or -exposure switches to normalize the overbright parts of the lightmap. The advantage of this method (as I imagine it) is to get more out of q3map2's bounce lighting through the use of the higher intensity sun. However you still do not get as much out of it as you would expect from a global illumination as you find it in blender cycles or other renderers. The following example uses a single sunExt shader with an intensity of 2000 and a 600 intensity skylight along with _minlight 3 and a very faint level wide fog. No other light sources are used. Lightmaps are compiled with samplesize 8 and the light switches look like this:

Code: Select all

[q3map2] -light -extlmhacksize 1024 -brightness 2 -bounce 16 -dark -dirtdepth 32 -dirtscale 3 -dirty -exposure 350 -patchshadows -samples 3 -bouncescale 1.2 -scale 1.2 -shade -cpma "[MapFile]"
shot0016 (Mittel).jpg
shot0013 (Mittel).jpg
In the following days I want to experiment a little more with -bouncescale and possibly see what adding more sunExt suns could do for me with regards to affecting bits that are still a bit too dark. Another thing I wanted to try is toying with _mighlight in combination with _color to see if subtle color information could be added to global shadows. You'll shoot your eye out manages to achieve these very nice blue'ish shadows but I am not sure whether that is a result of the skybox shader or if they do that with fog and _minlight. What approaches have you been following for lighting? I'd be curious.
www.ferdinandlist.de/leveldesign
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: State of the art Q3 lightmap building

Post by obsidian »

I did a LOT of lighting experiments... mostly with global illumination. I forgot what I was trying to achieve with most of them, and I really wish that I had better documented them.
shot0003.jpg
Here I was trying to work with normal maps and high resolution lightmaps. I was working with intentional oversaturation and coloured shadows to give the effect of looking really hot.
shot0004.jpg
shot0005.jpg
These two were probably me trying to dial in per-surface lightmap resolutions. The idea was trying to use really large lightmap pages for important surfaces while keeping others at lower resolutions for performance.
shot0006.jpg
I don't remember what I was working with here. I think more oversaturation and contrast experiments. Pretty sure that dark texture rectangle walls had some normal map test going on at some point. I think I was trying to use overbright bits to create sun bleached surfaces.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Hipshot
Posts: 1538
Joined: Sun Jan 20, 2002 8:00 am

Re: State of the art Q3 lightmap building

Post by Hipshot »

What's good about lightmaps is that it's fake and can thus be improved if you have the proper tools/knowhow. It would be interesting to see good new ways of making these levels even better looking, not sure fog is the way to go. Fog looks like fog for me, but please prove me wrong.
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
EmeraldTiger
Posts: 391
Joined: Fri Sep 17, 2010 1:53 am

Re: State of the art Q3 lightmap building

Post by EmeraldTiger »

Hipshot wrote:What's good about lightmaps is that it's fake and can thus be improved if you have the proper tools/knowhow. It would be interesting to see good new ways of making these levels even better looking, not sure fog is the way to go. Fog looks like fog for me, but please prove me wrong.
I brought this up in the CPMA level design Discord, but I'll bring it up here too because I think it's worth discussing.

Lightmaps are just image files that are additively overlaid onto the level geometry, and can be exported and edited in an external program like Photoshop. So, in theory, you should be able to load the lightmap in Photoshop and make any adjustment you want to it, and then compile the map again with your modified lightmap. The use of fog for color grading, for example, might not be necessary if one loads up the lightmap and performs color balancing on it directly. And of course there's the multitude of other effects that can be applied in Photoshop, and the ability to fine-tune spots that might not look quite right since you have pixel-level control of the lightmap. It wouldn't completely replace light compile flags, since settings like -bounce and -dirty require the context from the actual level geometry to work, but color grading and contrast adjustment can probably be handled in Photoshop and with more control than what would otherwise be possible. (So basically a static post-processing effect)

If you convert the .bsp into a model file that can be loaded in Blender (or another modeling tool of choice) and then apply the lightmap as a texture then you could even preview it before actually compiling.
[color=#00FF00][b]EmeraldProductions[/b][/color]
http://emeraldproductions.weebly.com/index.html
LDAsh
Posts: 28
Joined: Sat Dec 17, 2016 1:25 pm

Re: State of the art Q3 lightmap building

Post by LDAsh »

Noesis can apparently do all of this:-
https://richwhitehouse.com/index.php?co ... ojects.php
User avatar
Eraser
Posts: 19168
Joined: Fri Dec 01, 2000 8:00 am

Re: State of the art Q3 lightmap building

Post by Eraser »

EmeraldTiger wrote:Lightmaps are just image files that are additively overlaid onto the level geometry, and can be exported and edited in an external program like Photoshop. So, in theory, you should be able to load the lightmap in Photoshop and make any adjustment you want to it, and then compile the map again with your modified lightmap
I remember people have used this before. q3map2 does have the lightmap export/import function for this.
User avatar
Hipshot
Posts: 1538
Joined: Sun Jan 20, 2002 8:00 am

Re: State of the art Q3 lightmap building

Post by Hipshot »

Yea, it does, the feature is not new. As I see it, it's a messy thing to do, even if you simplify it down to a simple import/export switch, cause you need to "re-edit" every time you recompile, so it's only good as a final compile or as a test.
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
obsidian
Posts: 10970
Joined: Mon Feb 04, 2002 8:00 am

Re: State of the art Q3 lightmap building

Post by obsidian »

Ideally, you could just write a better raytracer than what Q3Map2 has to offer (and preferably write it so that it enables GPU processing for faster compiles), but that would be quite a major undertaking.

The preprocessed megatextures in the submarine maps of Wolfenstein The New Colossus look amazing!

[lvlshot]https://cdna.artstation.com/p/assets/images/images/008/304/964/large/myles-lambert-sub-09.jpg?1511887004[/lvlshot]
[lvlshot]https://cdn.80.lv/api/upload/content/4a/5d28bad41070d.jpg[/lvlshot]
[lvlshot]https://cdn.80.lv/api/upload/content/81/images/5d28ba9949098/contain_1240x754.jpg[/lvlshot]

EmeraldTiger wrote:Lightmaps are just image files that are additively overlaid onto the level geometry.
Subtractively. Blendfunc filter, or gl_dst_color gl_zero, or gl_zero gl_src_color.
[size=85][url=http://gtkradiant.com]GtkRadiant[/url] | [url=http://q3map2.robotrenegade.com]Q3Map2[/url] | [url=http://q3map2.robotrenegade.com/docs/shader_manual/]Shader Manual[/url][/size]
User avatar
Hipshot
Posts: 1538
Joined: Sun Jan 20, 2002 8:00 am

Re: State of the art Q3 lightmap building

Post by Hipshot »

Well, I hope no one does improve q3map2 too much, since it's quiet fun to sit and optimize and test things to get a good result =) It's a big part of the dev process for me.
Q3Map2 2516 -> http://www.zfight.com/misc/files/q3/q3map_2.5.16_win32_x86.zip
Q3Map2 FS_20g -> http://www.zfight.com/misc/files/q3/q3map2_fs_20g.rar
GtkRadiant 140 -> http://www.zfight.com/misc/files/q3/GtkRadiantSetup-1.4.0-Q3RTCWET.exe
Post Reply