HDR Lighting

HDR Lighting

Re: HDR Lighting Posted by amanderino on Mon Nov 13th 2006 at 11:19am
amanderino
205 posts
Posted 2006-11-13 11:19am
205 posts 21 snarkmarks Registered: Nov 13th 2006 Location: United States
Hey everyone,

Before I start with my problem, I'm going to say that (obviously) this is my first post and I apologize before-hand if I don't fit in yet; I know that I'll end up doing plenty of things wrong. I've used the site a lot for help but never registered until today because I can't seem to find the answer anywhere.

My problem is that HDR lighting confuses me. A LOT. I was googling it trying to find a tutorial to start me out. The best thing I managed to find was at http://developer.valvesoftware.com/wiki/HDR_Lighting_Basics but I still don't understand what it's saying.

In case you're using a slower connection speed:

"
The simplest thing to get HDR working immediately is to recompile your existing map with the latest Vrad.

If you're using the compiler built-in to Hammer, compiling your map with HDR is very simple:
1. Open the .VMF file in the Hammer editor.
2. Choose Run Map from the File Menu.
3. Set BSP, VIS, and RAD options to Normal.
4. Under the RAD section, check the HDR check box.
5. Click OK to start the map compiling.
Note: You will notice in the compile log window that VRAD will run twice when HDR is enabled. This is correct. VRAD needs to build separate lighting for LDR and HDR modes.
"

But how does that work? I'm confused about the values and the values of the effects such as bloom. Do they just get set like normal lights and then you check the HDR box (in the RAD section) before compiling?

Sorry if I jumped around too much, I'm just completely confused by HDR and don't even know exactly what I'm looking for.

One more thing, how do enable HTML in my posts?

Thanks in advance,
Aaron
Re: HDR Lighting Posted by reaper47 on Mon Nov 13th 2006 at 2:52pm
reaper47
2827 posts
Posted 2006-11-13 2:52pm
reaper47
member
2827 posts 1921 snarkmarks Registered: Feb 16th 2005 Location: Austria
Hello and welcome to the boards, amanderino/Aaron (whatever it is you prefere to be called :smile: )

HDR simply increases the number of possible shades of brightness that you see on every brush in game. This is calculated by vrad.exe during the compiling.

When you build a map in Hammer you do so in a "working format" called VMF (Valve Map Format). Hammer can only read these (for example castle1.vmf). The game itself cannot read a VMF. The map needs to be optimized and finished before. This process is called compiling. Once compiling is finished it writes a so-called BSP file which is the finished map that can be played in game (for example castle1.bsp).

To compile a map click the "run map" button (in the upper tool menu the second from the right, an icon that looks like 3 little cogs). It will be done automatically. The window looks similar but not exactly (older, non-hDR version in the link) like this. Check "HDR" and click OK.

Compiling a map automatically runs three programs:
  • vbsp.exe for deleting unnecessary polygons, basic geometry and so on
  • vvis.exe for optimizing and making the map run less choppy
  • vrad.exe to calculate the complicate "radiosity" lighting. Once RAD is finished it copies the lighting as a kind of texture, an "overlay" of sort into the BSP file. It can then be seen in game.
Compiling is always in the way before you can play a game. It will produce errors and takes a while to get used to. It can takes several minutes. If the window with the text shows end-statistics and can be closed and moved easily without loads of programs running in the background and slowing down your PC anymore... it's likely that compiling is finished.

Make sure it copies the BSP map-file in the right directory and finds the VMF to actually start... It doesn't matter where the VMF is but the BSP should go into your Steam/steamapps/usernamr/modname/maps directory to get it to load.

Ignore the HDR details for now. Just fill out the non-HDR values in light entities. -1 -1 -1 means HDR uses the same - nothing HDR-specific to do for you so far. It just might look a bit too bright with HDR than without.

More:

Map Compiling Theory (very theoretical)
VRAD (again, very dry)

PS: Don't use HTML, use BBCode :wink:

Good luck!

PPS: Probably you already know most things about compiling. In that case: Yes, HDR can be used with plain normal light entities. It's mainly a compile thing and the extra values are only there for fine tuning. VRAD calculates both HDR and non-HDR lights. It runs twice. The first time with the normal values, the next time, where available, with the HDR extra-values and HDR-compatible code. If no specific brightness is set for HDR RAD uses your non-HDR values and in most cases they work as well.
Why snark works.
Re: HDR Lighting Posted by amanderino on Mon Nov 13th 2006 at 3:48pm
amanderino
205 posts
Posted 2006-11-13 3:48pm
205 posts 21 snarkmarks Registered: Nov 13th 2006 Location: United States
Thanks for the reply.

As I said in my first post: I probably didn't mention a lot of things. I knew what compiling did and I knew what the BSP was all about, too; I've been using Hammer for a few months now. My confusion was in the HDR values.

Another wiki link on HDR said the same as you did: -1 -1 -1 means HDR uses the same as the LDR. However, I see screenshots of games running HDR (Lost Coast and CS:S) and it seems like there is a lot of tweaking involved.

Anyways, what's and easy way to test HDR? Should I just build a small map with some entities and such (so it's not a box) and check the HDR box before compiling? Or should I locate a decompiler and look at Valve's maps for hours? Haha.

I'll mark the post correct once I figure all this out.
Thanks for being informative.
Re: HDR Lighting Posted by $loth on Mon Nov 13th 2006 at 3:56pm
$loth
2256 posts
Posted 2006-11-13 3:56pm
$loth
member
2256 posts 292 snarkmarks Registered: Feb 27th 2004 Occupation: Student Location: South England
Check out cs_militia for some values on HDR , it's now included with VHE.
Re: HDR Lighting Posted by reaper47 on Mon Nov 13th 2006 at 4:33pm
reaper47
2827 posts
Posted 2006-11-13 4:33pm
reaper47
member
2827 posts 1921 snarkmarks Registered: Feb 16th 2005 Location: Austria
Checking out a working map sounds like a sane idea (especially if it's officially available like $loth's idea).

Just for the satisfaction you could test one of your existing or test-maps with HDR checked in the compile dialog. It should work nicely.

Sorry I write a lot it forums when I don't want to get back to work yet :biggrin:
Why snark works.
Re: HDR Lighting Posted by $loth on Wed Nov 15th 2006 at 4:02pm
$loth
2256 posts
Posted 2006-11-15 4:02pm
$loth
member
2256 posts 292 snarkmarks Registered: Feb 27th 2004 Occupation: Student Location: South England
Also, I think I've read that you must have cubemaps, just incase you don't (it's the env_cubemap point entity).