-
Notifications
You must be signed in to change notification settings - Fork 16
Lighting
- https://github.com/ValveSoftware/halflife/blob/master/utils/qrad/qrad.txt
- https://sites.google.com/site/svenmanor/tutorials/light
- Also:
The first part of the radiosity process is the accurate calculation of direct lighting. All entity lights and the bright (5000 or greater) surface patches exactly trace lines to the individual lightmap samples. If -bounce 0 is specified, thats it for the lighting. Otherwise, the lightmap values are summed up to give the initial amount of light to be bounced around the world in the radiosity pass. ISSUES WITH BMODELS Brush models emit and absorb light like other surfaces, but they do not block light, so after normalization, a little less light lands on the nearby surfaces, because it was absorbed both by the door and the surfaces beyond it. You probably won't notice anything unless you have a row of spotlights on normal walls, then an identical one on a bmodel. ISSUES WITH WATER Light does NOT cross through water surfaces if the vis has been calculated, because the areas are in different potentially visible sets, but if you run qrad without a vis, then light will be sent through as well. (QRAD DOCUMENTATION)
All textures that are on the "light emiting" list will cast light into the world, oriented down the surface normal. A value of 100-300 is reasonable for a large, dim surface, like slime, lava, or a dark sky. Lights that will illuminate large areas with a small surface area will have values of 5000 or greater. The total amount of light emited from a surface is proportional to the surface's area, so the size of the brush face has as much effect on the light sent into the world as the light value. Surface lighting falls off with the sqare of distance, so if you double the height of a room, you will need to have four times the light intensity on the ceiling to get the floor the same brightness. The walls would then be much brighter near the top than they were with the smaller room as well. (QRAD DOCUMENTATION)
rad file, see Textures
TextureName R G B V
TextureName R G B
TextureName V
-
"TextureName"
R G B V Color and brighness (R G B V=Scale)
https://github.com/ValveSoftware/halflife/blob/master/utils/qrad/lightmap.c#L901
They should function similar to quake 1 lights, with linear falloff instead of inverse quadratic. (QRAD DOCUMENTATION)
-
"_light"
Brightness R G B V Color and brighness (R G B V=Scale) -
"style"
Appearance 0 = normal 1 = flicker A 2 = slow strong pulse 3 = candle A 4 = fast strobe 5 = gentle pulse 6 = flicker B 7 = candle B 8 = candle C 9 = slow strobe 10 = fluorescent flicker 11 = slow pulse, no black -
"pattern"
Custom Appearance
- initially dark (
1
) By default the light source will be turned off and can be turned on by some kind of trigger.
The field "_cone" determines the spread of the spotlight. If not specified, a _cone of 15 will default. (QRAD DOCUMENTATION)
https://github.com/ValveSoftware/halflife/blob/master/utils/qrad/lightmap.c#L935
-
"target"
Target Entity name where the light will be directed to. If validly specified,"pitch"
,"angle"
,"angles"
and initially dark (1
) is ignored. -
"angles"
Pitch Yaw Roll (X Y Z) X Y Z -
"_cone"
Inner (bright) angle Angle See https://sites.google.com/site/svenmanor/tutorials/light Spotlight section -
"_cone2"
Outer (fadding) angle Angle See https://sites.google.com/site/svenmanor/tutorials/light Spotlight section -
"pitch"
Pitch Angle Takes priotity over Pitch inside"angles"
Legacy Pitch -
"angle"
Angle Angle Takes priotity over Angle inside"angles"
Legacy Yaw -
"_light"
Brightness R G B V Color and brighness (R G B V=Scale) -
"_sky"
Is Sky? 0 = no 1 = yes Works like light_environment but does not replace light_environment and can work together. -
"style"
Appearance 0 = normal 1 = flicker A 2 = slow strong pulse 3 = candle A 4 = fast strobe 5 = gentle pulse 6 = flicker B 7 = candle B 8 = candle C 9 = slow strobe 10 = fluorescent flicker 11 = slow pulse, no black -
"pattern"
Custom Appearance
- initially dark (
1
) By default the light source will be turned off and can be turned on by some kind of trigger.
Skys emit light like other surfaces, but have slightly different characteristics. They emit light from all angles, so it doesn't matter if you see a horizontal or vertical sky brush. Light also does not bounce off of a sky in the radiosity pass, if it flies out a sky texture it is just gone. (QRAD DOCUMENTATION)
- https://github.com/ValveSoftware/halflife/blob/master/utils/qrad/lightmap.c#L935
- Note: Some maps have multiple light_environment entities. If so, every light setting will be listed. В QRAD источники применяются к рядом стоящим SURF_DRAWSKY, в HLRAD light_environment (light_spot с _sky=1) единственный глобальный.
-
"target"
Target Entity name where the light will be directed to. If validly specified,"pitch"
,"angle"
,"angles"
is ignored. -
"angles"
Pitch Yaw Roll (X Y Z) X Y Z -
"pitch"
Pitch Angle Takes priotity over Pitch inside"angles"
Legacy Pitch -
"angle"
Angle Angle Takes priotity over Angle inside"angles"
Legacy Yaw -
"_light"
Brightness R G B V Color and brighness (R G B V=Scale)
TBD
-
"_minlight"
Minimal Light Level
Used to set maximum lightning level for entities. Imagine a computer screen in the darkness, machine diodes or just a lamp that produces a light and need to be full-lit. Use minimum light level key to do this. It's only supports two states: '0' (normal light) and more than '0' (full bright). Set it to '1' or any other value to make brush full-lit. Keep in mind that it does not produce light itself (in the first image I added light by myself).
For dynamic lighting (moving light) is set by effects
- Effects
"effects"
- http://zhlt.info/entity-changes.html
- https://sites.google.com/site/svenmanor/tutorials/advancedlight (a lot of useful information)
At least need to be implemented:
-
"TextureName"
R G B V Color and brighness (R G B V=Scale)
This entity can act as a replacement for a lights.rad file, in that it simply resides within the map as a point based entity. The usefulness of this is that each map can have its own unique ambient lighting applied to it, and those settings will travel with the map and not affect any other maps. Usage of the entity is much like that of the multimanager. To add an entry (take smart-edit off if you are using the Valve Hammer Editor/Worldcraft) and add key-value pairs in manually; the key should contain the name of the texture to apply lighting to, and the value a set of numbers representing the red green blue lumionsity(brightness) of the texture, just as you would in the lights.rad file. The presence of this entity will not override the lights.rad file - both the values specified in this entity and the lights.rad file will be used by HLRAD.