newLight_Dir
Jump to navigation
Jump to search

Note:You maybe seen env_godrays_controller in Hammer or fgd. This is deprecated Crepuscular Rays from the Crossfire Update (22 december 2015 year). With newLight_Dir implementation, this entity is removed with crepuscular rays.
Warning:You can have only one newLight_Dir per map. Exceeding the limit will result in the instant crash with the engine error message. You are able to kill this entity and spawn new with point_template.
Warning:You can have only 40 point lights with godrays enabled simultaneously, otherwise the game will crash with this error message.
Note:Godrays are draw and process even with closed areaportals.
Note:Godrays doesn't look smooth if used big value here. The same for Exposure.
Note:You can't use black colors for ColorOuter, ColorInner and ColorRays.

newLight_Dir
is a point entity available in Black Mesa. It places a godrays and disk/circle as sun effect in the skybox where it does not parallax, giving the impression that it is nearly infinitely far away. The entity does not contribute any actual lighting (the lighting code is disabled); it is merely a visual representation of the Sun.


Represented by class CNewLightDir
.
Todo: Update issues, rework page.
Keyvalues
- Name (targetname) <string>
- The name that other entities refer to this entity by, via Inputs/Outputs or other keyvalues (e.g.
parentname
ortarget
).
Also displayed in Hammer's 2D views and Entity Report.See also: Generic Keyvalues, Inputs and Outputs available to all entities
- LightEnvEnabled (LightEnvEnabled) <choices>
- Determines is the entity uses light_environment's direction or its own (just like env_sun).
- 0: Enabled - use light_environment's direction.
- 1: Disabled - use its own direction.
- PushbackDist (PushbackDist) <float>
- Pushback distance is distance from godrays to player in skybox. Decreasing the value will cause parallax effect.
UseToneMapDisk (m_bUseToneMapDisk) <choices>- Deprecated.
Sets tonemap state for disk, enabled or disabled. Doesn't work.
- 0: Enabled
- 1: Disabled
- EnableGodRays (EnableGodRays) <choices>
- Sets godrays state on spawn, enabled or disabled.
- 0: Disabled
- 1: Enabled


- Density (Density) <float>
- Density controls the length of rays/volumetric shadows. 1.0 should work in 99% cases. Good values are 0.5-1.5.
Examples Expand
- Weight (Weight) <float>
- Weight controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values are 0.1-10.
Examples Expand
Decay (Decay) <float>- Deprecated.
Decay controls luminance fall off per sample. Value here doesn't work. - Exposure (Exposure) <float>
- Exposure controls the intensity of rays during blending pass with main scene. 2.0 is a good start. Good values are 1.0-10.0.
Examples Expand
- DistFactor (DistFactor) <float>
- DistFactor controls the falloff of rays/length. 1.0 is a good starting value increase or decrease in the increments of 0.1. 0.0 will make the rays dissappear only disk will be rendererd.
Examples Expand

- ColorInner (ColorInner) <color255 + int>
- The RGB color and brightness of the inner circle. Colors and brightness must be between 0 and 255.
Bug:This color value doesn't work properly with newLight_Point if you are using Normal godrays type. This entity takes only red value. Works fine with Fancy type.
Examples Expand
- ColorRays (ColorRays) <color255 + int>
- The RGB color and brightness of the rays. Colors and brightness must be between 0 and 255.
Examples Expand
- ColorOuter (ColorOuter) <color255 + int>
- The RGB color and brightness of the outer circle. Colors and brightness must be between 0 and 255.
Bug:This color value doesn't work properly with newLight_Point if you are using Normal godrays type. This entity takes only red value. Works fine with Fancy type.
Examples Expand

- DiskRadius (DiskRadius) <float>
- Radius of disk/circle of sun/point light in texturespace. 1.0 will be full screen, 0.5 is half screen, etc. 0 means don't render.
Examples Expand
- DiskInnerSizePercent (DiskInnerSizePercent) <float>
- Disk inner circle radius is DiskRadius * DiskInnerSizePercent. 0 means don't render.
Examples Expand
Inputs
- TurnOnGodRays
- Turn the godrays on.
- TurnOffGodRays
- Turn the godrays off.
Bugs/Limitations
See also
- newLight_Point - point deferred light entity.
- NewLights_Spawner - spawner of deferred point lights.
- env_lensflare - cinematic dynamic lens flare.
- newLight_Spot - spot deferred light entity.
- newLights_settings - entity that changes deferred light settings.
- godrays_settings - entity that changes godrays settings.
- env_cascade_light - deferred cascade sun light entity.
- New Lights Editor - in game deferred lights editor.
- Effect flags - effects flags, some of them are dynamic light effects.
- BlackMesa XenEngine: Part 4 – Lighting & Shadows - page from Chetan (lead programmer for Black Mesa) about new lights.
- BlackMesa XenEngine: Part2 – How a Frame is Rendered - page from Chetan (lead programmer for Black Mesa) about how a frame is rendered.
- BlackMesa XenEngine: Part1 – Heavily Modified Source Engine page from Chetan (lead programmer for Black Mesa) about
Xengine.