Welcome, Guest. Please login or register.

Author Topic: Lightmaps (IF YOU PLAN ON RUNNING VRAD [EVERYONE], READ THIS)  (Read 27449 times)

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
First off, a few Valve pages about Lightmaps:
http://developer.valvesoftware.com/wiki/Lightmap

And general lighting:
http://developer.valvesoftware.com/wiki/Intermediate_Lighting#Creating_a_true_light_source

Alright, so, what is a lightmap and why should you care?  If you clicked the first link, you'll see that the Source SDK docs define it as such:
Quote
A lightmap is all the lighting data of each face. This light data is then applied additively to each face to produce the final lit effect. Especially common in BSP based engines, it's the method used for most lighting effects within the source engine.

Determined during the vrad compile process lightmaps are only applied to brush faces as models are lit differently. The lightmap's scale refers to the number of texture pixels per light pixel (luxel). Smaller values means more luxels, thus a better quality but larger BSP size and compile times. The lightmap resolution can be viewed within Hammer by altering the viewmode in the top right to lightmap. It can also be viewed and edited from the Face Edit Dialog.

I'm going to go over how to change the lightmap resolution (also known as lightmap scale) here.  The first thing You'll need to do is change your 3D View in Hammer to "3D Lightmap Grid.  Do this like so:


Your 3D View should now look something like this:

 

Now that your 3D View is in Lighmap Grid Mode, you can start changing the the lightmap scales efficiently.  Using the face edit tool, select a face.  You'll then want to change the lightmap.  I'll go over exactly what you want to change it to later, but for now knowing how is good enough.  Change the number in the lightmap Scale field, which I've circled.


Change it to something large, and it will look something like this:


So, now that you know how to change it, you'll also need to know what to change it to.  It's really up to you.  Lower numbers will result in more detailed shadows, but will also take up more compile time and disk space.  The exact opposite is true for larger lightmap scales.

Personally, I like to keep the tops of ramps at a scale of 24 or 32, but put the bottoms or ramps, and any other part of the map that's not too visible, up to something very high like 512 or 1024 (note: I like to stick to powers of 2.  It's probably a good idea to do this in your maps too, but you don't have to.)  This can also be very useful to preview lighting for a level.  For example you can select all, and use the face edit tool to change everything's lightmap scale to a high value.  Doing this will make RAD run a lot faster.  You should, however make sure to change it back before your final compile, unless it looks fine like that.

So, that's about all I have to say about that.  I've been meaning to make this little tutorial for a while.  If you have any questions feel free to reply here.  Good Luck!
« Last Edit: May 31, 2012, 04:36:54 AM by Paper-Cut »

Offline Buck Nasty

  • Surf Patrol
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,374
    • View Profile
    • http://www.bucknastysurf.net
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #1 on: June 24, 2006, 02:12:09 PM »
oh snap! I've been wondering how ac compiles with rad so quick. thanks sintax!

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #2 on: June 24, 2006, 03:29:23 PM »
Yeah, just don't overdo it.  Remember that bigger scale = looks crappier.

Offline Assaulted_Combat

  • Full Member
  • ***
  • Posts: 279
    • View Profile
    • http://chaos-theory.info
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #3 on: June 25, 2006, 03:26:10 PM »
Yeah. I bugged sintax about rad shit a little while ago. I love sintax more than I love.. me. lmfao

Offline kaos4u

  • SolidSurf Elite
  • Full Member
  • ******
  • Posts: 291
    • View Profile
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #4 on: June 25, 2006, 08:04:22 PM »
Very nicely done. I haven't even thought about the Lightmap scale untill now.

Offline Buck Nasty

  • Surf Patrol
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,374
    • View Profile
    • http://www.bucknastysurf.net
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #5 on: June 30, 2006, 04:25:49 PM »
do you have to do this lightmap scale to every ramp?

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #6 on: June 30, 2006, 04:37:58 PM »
every ramp that you want to change the lightmap scale of, yes.  An easy way to do it is to select the ramps with the selection tool and then go into face edit mode and change the scale.  It will change the scale of every face on every brush selected.

Offline Buck Nasty

  • Surf Patrol
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,374
    • View Profile
    • http://www.bucknastysurf.net
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #7 on: June 30, 2006, 06:13:32 PM »
my map ends up being a little darker than i'd like, any way to lighten it up?

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #8 on: June 30, 2006, 06:19:47 PM »
just mess with the light_env.  For best results, it should match your skybox.

Offline Buck Nasty

  • Surf Patrol
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,374
    • View Profile
    • http://www.bucknastysurf.net
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #9 on: June 30, 2006, 06:36:48 PM »
what do you mean by that? well, what i do is just place the light env in the mid of the box and compile... should a mess with the properties?

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #10 on: June 30, 2006, 06:49:41 PM »
Easiest way is to just copy the ones Valve uses with their light_environment, which can all be found here

You might also want to add an env_sun for added effect.


For example, if you were using sky_borealis01,

Your Pitch/Yaw/Roll would be 0 47 0
Pitch would be -45
Brightness would be 254 227 167 80
Ambience would be 195 195 195 20


For the env_sun, Pitch/Yaw/Roll and Pitch should be the same I think, and make sure you set UseAngles to yes.  I think the color should also match the brightness and you may want to mess with the size too.

Offline Buck Nasty

  • Surf Patrol
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,374
    • View Profile
    • http://www.bucknastysurf.net
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #11 on: June 30, 2006, 07:23:58 PM »
you made my day sintax! \

Offline DIB

  • Full Member
  • ***
  • Posts: 362
  • woof!
    • View Profile
    • http://brokensurf.com/forums/
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #12 on: June 30, 2006, 09:15:09 PM »
Quote from: Buck
what do you mean by that? well, what i do is just place the light env in the mid of the box and compile... should a mess with the properties?

uh.... duh.... lol

Offline TheBrain

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #13 on: July 01, 2006, 03:27:34 PM »
Well I checked that out a while ago about the env_light settings but I dont see some like day_01_09...it seems to be all of the basic CS skyboxes and none others, what do we do if we're using one not in Valve's guideline for env_light settings?

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #14 on: July 01, 2006, 03:32:11 PM »
Eh, unless the skybox tells you what to use, you'd just have to guess really.

Offline DIB

  • Full Member
  • ***
  • Posts: 362
  • woof!
    • View Profile
    • http://brokensurf.com/forums/
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #15 on: July 01, 2006, 05:34:16 PM »
guessing is funner cause you can make it look uber sexy

Offline Assaulted_Combat

  • Full Member
  • ***
  • Posts: 279
    • View Profile
    • http://chaos-theory.info
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #16 on: July 01, 2006, 06:39:32 PM »
I just set the sun to up if i'm not using the official angles. I love the ambience that the official's are set to, so nice for some skyboxes.

Offline TheBrain

  • Jr. Member
  • **
  • Posts: 63
    • View Profile
Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #17 on: July 01, 2006, 11:22:39 PM »
I tried using some settings that were for a skybox that looked kinda like mine and my map like glowed purple lol it wasn't even the textures everything just had a purple glow, including my ct. That was fun.

Offline TargetPractice

  • Sr. Member
  • ****
  • Posts: 881
  • Eat my surf!
    • View Profile
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #18 on: January 23, 2007, 06:47:39 PM »
Could you perhaps repost the pictures? They arent showing up. Cheers.


Click HERE for free films and games with the LoveFilm offers!

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #19 on: January 23, 2007, 07:20:42 PM »
Done.

Offline UDelSteve

  • SolidSurf Elite
  • Sr. Member
  • ******
  • Posts: 669
    • View Profile
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #20 on: January 24, 2007, 04:12:28 AM »
Since this topic has been bumped, I'd like for all of you guys to read this, it's crucial for your map.  The default lightmap scale is 16, and if you plan on using vrad, you're completely screwed unless you change the lightmap scale.  You'll get something like a 50 meg map. *cough* digital[g] *cough*

Offline X-Shark

  • SolidSurf Elite
  • Sr. Member
  • ******
  • Posts: 441
    • View Profile
    • My Space, Not yours
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #21 on: January 24, 2007, 04:22:02 PM »
but digital [g]'s shadows looked hella sexy \  No he is right. . . only leave 16 lm for places that you will be up close and personal with. 
oooOOO_OOOooo Im a spider!

Offline TargetPractice

  • Sr. Member
  • ****
  • Posts: 881
  • Eat my surf!
    • View Profile
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #22 on: January 24, 2007, 04:23:51 PM »
I've made all the insides of surf (and faces that cant be seen) 1600 or 500, surf faces at 30, detailed areas such as a jail at 16, outside areas at 35. Lets hope my compile time will go further than 5 this time...


Click HERE for free films and games with the LoveFilm offers!

Offline hellraisedsurfer

  • Sr. Member
  • ****
  • Posts: 449
  • Playing as: DoctorEpic
    • View Profile
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #23 on: May 10, 2008, 12:57:45 PM »
anyways thx.. fine to under stand
It took a lot of complicated incest to produce the Buckaj 

Offline waffleburger

  • Full Member
  • ***
  • Posts: 278
    • View Profile
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #24 on: May 10, 2008, 01:19:40 PM »
anyways thx.. fine to under stand

please do not bump old threads

Offline Paper-Cut

  • Surf Patrol
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,203
  • Roll up
    • View Profile
    • TAG Servers
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #25 on: May 10, 2008, 01:59:15 PM »
please do not bump old threads

He was saying thanks for a tutorial. Don't tell him not to bump a tutorial. If we didn't want that, we would lock it.
I make my maps with Microsoft Paint.

Offline vinic

  • Newbie
  • *
  • Posts: 2
    • View Profile
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #26 on: August 26, 2008, 08:05:01 PM »
Just to make this perfectly clear, since some people seemed to have not read it in the first post: for those of you who want to just set all of your brushes to have the same lightmap scale, you don't have to hand-select all of them at a time, or go through them one by one. Under Edit there is an option for Select All. There isn't a hotkey for it. Tap that, then you can click the Texture tool (Shift-A), and then set it to what you want. Don't touch anything other than the lightmap, otherwise fun shit will happen.

Note: When you open up the Texture tool, the 2D windows will all look like it unselected everything, while the 3D window will continue to look like everything is selected. Everything is still selected.

Lightmap tomfoolery is a godsend. A properly optimized map combined with lightmap settings at 128 can result in a full compile that takes between 5 seconds and 5 minutes, in my experience. And five seconds of that is vbsp.exe. 0 for vvis.exe. The rest is vrad.exe.

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #27 on: August 29, 2008, 01:25:21 PM »
You can also set the default lightmap scale in the hammer config dialog:


Offline spoz

  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,813
  • WHAT ARE YOU LOOKING AT DICKNOSE?
    • View Profile
    • Line12
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #28 on: August 29, 2008, 01:29:42 PM »
thats something I ment to ask a while ago, void facing planes, does their LMV count or not? just incase they do I instinctivly set them to an excessive value (2048) but never worked out if they added to compile times
Quote
But if u really wanna see a screwed up map take a look at that greatriver awesome 1... freaked the shit out of me... its like a child molestation adventure.....

Offline SintaxError

  • Admin
  • Elder Statesman
    of the Surf
  • *****
  • Posts: 1,731
  • There's an error in your sintax.
    • View Profile
    • SolidSurf
Re: Lightmaps (IF YOU PLAN ON RUNNING VRAD, READ THIS)
« Reply #29 on: August 29, 2008, 01:49:16 PM »
I've never personally tested this, but I'm gonna have to go ahead and say that they don't count.