newLight_Dir

newLight_Dir
is a point entity available in Black Mesa. It is one of the many new lighting entities available. Black Mesa incorporates new post processor that allowed to implement Godrays and lensflares with some other effets. This entity draw in skybox post processing effect called GodRays, also include disk to imitate sun.



Represented by class
CNewLightDir
.
Keyvalues
- Name (targetname) <string>[ Edit ]
- 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 such rays to move in all directions (instead of "remaining statically at one point" in the sky), depending on the player's position.
|
- UseToneMapDisk (m_bUseToneMapDisk) <choices>
- 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
- Weight (Weight) <float>
- Weight controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values are 0.1-10.
Examples
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
- 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
- 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 Note:Rays is disabled on this picture (the colors are partially blending).
- ColorRays (ColorRays) <color255 + int>
- The RGB color and brightness of the rays. Colors and brightness must be between 0 and 255.
Examples
- 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 Note:Rays is disabled on this picture (the colors are partially blending).

- 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
- DiskInnerSizePercent (DiskInnerSizePercent) <float>
- Disk inner circle radius is DiskRadius * DiskInnerSizePercent. 0 means don't render.
Examples Note:Rays is disabled on this picture (for clarity).
Inputs
- TurnOnGodRays
- Turn the godrays on.
- TurnOffGodRays
- Turn the godrays off.
Bugs/Limitations
Engine limit
Level can't have more than one newLight_Dir, otherwise game will crash with this error message. However - you still can spawn new with point_template and kill old if you need to change Godrays position, change color, etc.
Incorrect work with $translucent
Godrays (also disk) all time fully rendering through textures with material shader parameter $translucent, because of this you will see unexpected results like in the picture. Disable Godrays when you need or use $alphatest if it'll give resualts similar to $translucent. You also can try use some other tricks to escape this problem.
Godrays incorrect work with point_viewcontrol
Godrays change position in sky when player move, this affects to what show point_viewcontrol when it's enabled. If you want to see in your background level Godrays - place player on needed position. If your point_viewcontrol moves - attach player to it.
Godrays render through 3D Skybox objects
Unlike env_sun Godrays (also disk) render through any object pasted in 3D Skybox environment. Keep in mind this before you will create 3D Skybox.
Clear example (the missiles is 3D Skybox objects).
In bs_c3m2b level from Black Mesa: Blue Shift.
Godrays incorrect work with cloak
Cloak is a material shader parameter for VertexLitGeneric
shader, female assassins use it to make them transparent when they need it. Godrays all time fully render through them.
Godrays draw through water
Deferred lighting don't fully draw through water, unlike Godrays.
Godrays can't be displayed in monitors and reflections
Godrays is post process effect that depends on player screen. That means that they can't water reflections or monitors can't show it.
Godrays incorrect work with $alphatestreference and $allowalphatocoverage
$alphatestreference is a material shader parameter that specifies the threshold alpha channel value at which the surface should be transparent instead of opaque, default "0.5". $allowalphatocoverage creates translucent steps based on alpha values. For examples used this texture with this alpha channel.
Godrays process invisable parts, you can't escape this problem, only minimize effect with $alphatestreference 0.1
or if paint alpha correct channel.
Godrays does not process surface models
If player underwater - godrays will not process surface models, only inwater models. Doesn't work with func_water_analog and func_water.
See also
- New Lights Editor
- godrays_settings
- newLight_Point
- newLight_Spot
- NewLights_settings
- env_cascade_light
- light_environment
- New Specular
- newxog_volume
- Advanced Lighting
- Effect flags (dynamic light effects)
- BlackMesa XenEngine: Part 4 – Lighting & Shadows (page from Black Mesa developer about new lights)
- BlackMesa XenEngine: Part2 – How a Frame is Rendered (page from Black Mesa developer about how a frame rendered, include Godrays.)
- BlackMesa XenEngine: Part1 – Heavily Modified Source Engine (page from Black Mesa developer about Black Mesa engine, better known as Xengine)