Tutorial - Ingame Light Editor


#1

ello Guys, Since a lot of people were asking how to implement new lights I have uploaded some of our internal tutorial/test maps on Dropbox.
I would recommend checking out tut_nextgen_lights_optimised.vmf since it contains a lot of examples in a single map. Then you can check one of those specialized example/test maps too.
Please note that these maps are not the most optimized version of maps and they were just created to test/demo specific bugs/features.

To help us configure new lights in a faster way we have implemented Ingame Light Editor. Here’s a quick tutorial/documentation from our internal forums -

In game Light Editor - a Convar based system for easily selecting new Light entities and edit their properties via convar. (Whenever alex get free from UI he will look into UI for editor and even saving to vmf if its easy)

Here’s the overall workflow -

  1. le_editor_selection_mode_enabled - Enable Light Editor selection mode. It will show you xyz axis and a box around light entity in your cross hair.
    [ATTACHMENT NOT FOUND]

  2. le_editor_selection_lock - Lock your selection.

  3. Opon locking its properties will be mapped to convars starting with le_light_ and le_gr_ . You can use these convars to modify different light properties and copy paste them to hammer later on.

[ATTACHMENT NOT FOUND][ATTACHMENT NOT FOUND]

  1. le_editor_selection_clear - Once you are done with a selected light and if you want to clear selection you can use this convar. Once selection is reset all the helper meshes (box/sphere) will also disappear.

List of Convars

(Each of these le_light_* convar should have helpful descriptions but still in case someone needs more info feel free to ask questions.)

Editor Convars

le_editor_selection_mode_enabled - Toggles New Light selection mode. When it is on, the bounding box, pivot and debugging text is displayed for whatever LIGHT the player is looking at.
le_editor_selection_lock - Locks the selected light and exits selection mode
le_editor_print_selected_light_details - print the details of selected light
le_editor_selection_clear - Clears Light Selection

Editor config Convars

le_config_selected_sphere_size - Size of sphere shown around selected Light
le_config_selection_box_size - Size of box that appears during selection mode

Light Properties Convars

le_light_Pos
le_light_Col
etc

le_gr_radius
le_gr_col_rays
etc


#2

Is it me, or are the images not working? Anyway very big thanks for the Tutorial.


#3

Is it intentional that the newLight_spot entity doesn’t have any Godray options, or did that just get left out of the FGD? Also, how big of a hit on performance do the shadow maps take? I’ve been considering modifying my copy of the FGD to make that “on” by default.


#4

Spot lights do not support godrays. There’s some fancy schmancy programming reason for this, but basically it destroys performance.

The shadow maps do impact performance, and there is a pretty hard limit on the number allowed in the map (I think it’s like…60, but each point light will take up 6). Do not have them on unless they add significantly to the scene.


#5

I can’t speak to your other questions, but there is a godray toggle on the lights, even if it’s not present in the FGD. I know this because I was using EntSpy to copy them from c2a2a into one of my previously-compiled maps. Although I can’t say whether or not the keyvalue functions, it’s definitely there.

There are two keyvalues in particular that seem to control godrays. The first is EnableGodRays, which is a boolean set to either 0 or 1. This one’s pretty self-explanatory. The second keyvalue is LightnGodRayMode which is also a boolean. I believe this keyvalue controls whether the light just emits godrays or if it actually emits light as well. So it’s probably best to keep that set to zero.

EDIT: Ninja’d.


#6

Godrays aren’t supported for spot lights. This may change in future.

There’s a limit of 48 shadowmaps per map per LOD. (total 144 shadowmaps per map)

There’s a perf cost for these shadowmaps Dynamic > Stationary > static.

Keeping shadows on by default in FGD might not be a good idea depending on map and surroundings of lights etc.


#7

How exactly is the ‘static’ light option supposed to function? It seems to just prevent the light in question from illuminating anything in the map.


#8

Just wanted to pass this along, the phone number listed on BMRF.US has been reassigned to a different company. I called this morning and a lady answered, she was baffled when I asked if this was BMRF. Then she asked what number, she said she just got this number for a funding company.


#9

Thanks for the heads up. Just curious… what company answered?


#10

Sorry for late reply.

So Static Light should illuminate anything object brush/prop static or dynamic but this light can’t move or change position or even change its angles.
If you turn on shadows for these lights then the shadows will be casted only for static geometry like brushes and/or static props. In other words only brushes and static props will block the light.

If you are facing a specific issue in a map or situation, you can post screenshot of both light settings in hammer and how it looks in game on insane or very high (Its a good habit to use insane or devonly batch files for gfx settings during development , if your PC can handle it). In case required I wont mind checking out vmf either if I can compile it in <= 5 mins.

I would love to answer any questions regarding any new engine upgrade (or get answers from other members as required) and help you guys out in any way possible. I know these features are new to source so they might take sometime for getting used to.
Sorry for later reply. I don’t really check the forums that often and I dont think email notifications are working on this website ( I will message our web team to confirm this & sort it out ).
In case you guys are waiting for important info and I dont reply in 1-2 days feel free to post it on steam forums or reaching out on steam chat.


#11

Is the “Image Based Ambient Lighting” functional? How can I set it to use ambient light from skybox texture?


#12

Compile the map with the switch -realskylight in VRAD.


#13

Thanks for reply, working fine now.

Got few questions about parameters:

-realskylightscale “x” Does this key have same effect as 4th value for “Ambient” key? (modifying amount of light)
-extrasky “x” I have tried various values for this parameter, but I can’t recognize any effect in lighting. What exactly does this parameter affect?


#14

-realskylightscale scales the amount of light from the skybox generated by the image based lighting by x times. 2 would double the brightness, for example.

-extrasky increases the number of light bounces calculated from the environment light. I believe the default is -32 when you’re using the -final switch in the compiler. So you need values of 64 or 128 to have a noticeable effect. Dramatically increases compile times.


#15

Thanks for explanation. I had quite large opened area in my test map, so that could be the reason I didn’t noticed -extrasky light bounces.