Godrays settings: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (Changed parameters of {{this is a}} to comply with the updated version. This action was performed by a bot.)
No edit summary
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Toc-right}}{{this is a|point entity|name=godrays_settings|game=Black Mesa}} This entity uses to dynamically change godrays settings for Black Mesa new light entities. For better understanding of this page - recommended at first familiarize yourself with new lights.
{{CDA|CGodRaysSettings|CBaseEntity|}}
{{back | Black Mesa Level Creation}}
{{Toc-right}}{{this is a|point entity|name=godrays_settings|game=Black Mesa}} This entity dynamically changes some godrays settings for {{ent|newLight_Point}} if triggered by the input. It should also affect {{ent|newLight_Dir}} entity, but due to the incorrectly specified class it does not work for this entity.
 
{{tip|You can change values dynamically via {{code|[[AddOutput]]}} input.}}


==Keyvalues==
==Keyvalues==
{{KV|Name|intn=targetname|target_source|The name that other entities refer to this entity by.}}
{{KV|TargetGodRays_Name|intn=TargetGodRays|string|Here you enter name of new light entity (with godrays support) for which you want to apply changes. Works with multiple lights if they have the same name.}}
{{KV|TargetGodRays_Name|intn=TargetGodRays|string|Target Light Entity name with godrays (Dir or Point - SpotLight godrays aren't supported)
{{KV|TransitionTime|intn=TransitionTime|integer|Transition time in seconds (0 for instant) to transition into new settings. Its a lerp operation A + (B-A) * TimeFactor.}}
}}
{{bug|Doesn't effects [[newLight_Dir]].}}
{{KV|TransitionTime|intn=TransitionTime|integer|TransitionTime in secs ( 0 for instant ) to transition into new settings. Its a lerp operation A + (B-A)*TimeFactor}}
{{KV|LightType|intn=LightType|Choices|  
{{KV|LightType|intn=LightType|Choices|  
Type of light source for which you want to apply settings. Entity will not apply settings for [[newLight_Dir]] if selected <code>Point Light</code> and will not apply settings for point lights if selected <code>Direction/Sun Light</code>.
Type of light source for which you want to apply settings. Entity will not apply settings for [[newLight_Dir]] if selected <code>Point Light</code> and will not apply settings for point lights if selected <code>Direction/Sun Light</code>. Don't change this to '''Direction/Sun Light''' due to the above mentioned reason.
*0: Direction/Sun Light
*0: Direction/Sun Light
*1: Spot Light}}
*1: Point Light}}
{{KV|EnableGodRays|intn=EnableGodRays|integer|EnableGodRays Enabled or Disabled
{{KV BmGodraysNormal}}
Determines if the light rays turns on or turns off. 1 - turns on, 0 - turns off.}}
{{KV|Density|intn=Density|float|Density Controls the length of rays/volumetric shadows. 1.0 should work in 99% cases. Good values to start from: 0.5 to 1.5.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=410px>
File:DEN1.gif|Density - 1.0
File:DEN2.gif|Density - 2.0
File:DEN3.gif|Density - 0.5
</gallery>
}}
{{KV|Weight|intn=Weight|float|Weight Controls the intensity of volumetric shadow. Blocking of rays by geometry. Good values to start from: 0.1 - 10.0.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=410px>
File:WEI10.gif|Weight - 1.0
File:WEI2.gif|Weight - 2.0
File:WEI3.gif|Weight - 5.0
</gallery>
}}
{{KV|Decay|intn=Decay|float|Decay NOT being used.}}
{{todo|Document what does it change.}}
{{KV|Exposure|intn=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.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cEXP1.jpg|Exposure - 1.00
File:cEXP2.jpg|Exposure - 10.0
File:cEXP3.jpg|Exposure - 0.10
</gallery>
}}
{{KV|DistFactor|intn=DistFactor|float|DistFactor Controls the falloff of rays / length. 1.0f 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.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=410px>
File:DIST1.gif|DistFactor - 1.00
File:DIST2.gif|DistFactor - 10.0
File:DIST3.gif|DistFactor - 50.0
</gallery>
}}
{{KV|DiskRadius|intn=DiskRadius|float|Radius of Disk/circle of sun in texturespace. 1.0 will be full screen 0.5 is half screen etc.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cDISKR1.jpg|DiskRadius - 0.02
File:cDISKR2.jpg|DiskRadius - 0.10
File:cDISKR3.jpg|DiskRadius - 1.00
</gallery>
}}
{{Note|With 0 - will not render.}}
{{KV|DiskInnerSizePercent|intn=DiskInnerSizePercent|float|Used only in Fancy Gaphics Mode. Disk inner circle radius [[=]] DiskRadius * DiskInnerSizePercent.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cDISKIR1.jpg|DiskInnerSizePercent - 0.75
File:cDISKIR2.jpg|DiskInnerSizePercent - 0.50
File:cDISKIR3.jpg|DiskInnerSizePercent - 0.99
</gallery>
}}
{{Note|With 0 - will not render.}}
{{KV|ColorInner|intn=ColorInner|color255| This is the color of the inner circle.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cCRAYS1.jpg|255 0 0 255
File:cCINN2.jpg|0 255 0 255
File:cCINN3.jpg|0 0 255 255
</gallery>
}}
{{Note|Unlike lighting - brightness of inner depends on fourth number which can be written here. Max value is 255, higher doesn't draw.}}
{{KV|ColorOuter|intn=ColorOuter|color255|Used only in Fancy Mode. This is the color of the outer circle.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cCRAYS1.jpg|0 255 0 255
File:cCOUT2.jpg|255 0 0 255
File:cCOUT3.jpg|0 0 255 255
</gallery>
}}
{{Note|Unlike lighting - brightness of outer depends on fourth number which can be written here. Max value is 255, higher doesn't draw.}}
{{KV|ColorRays|intn=ColorRays|color255| This is the color of the rays.}}
{{expand|title=Examples|
<br>
<gallery mode=packed heights=710px>
File:cCRAYS1.jpg|0 0 255 120
File:cCRAYS2.jpg|0 255 0 120
File:cCRAYS3.jpg| 255 0 0 120
</gallery>
}}
{{Note|Unlike lighting - brightness of rays depends on fourth number which can be written here. Max value is 255, higher doesn't draw.}}


==Inputs==
==Inputs==
{{IO|InputApplySettings|param=void|InputApplySettings Trigger to apply settings}}
{{I|InputApplySettings|param=void|Triggers the entity to apply the settings.}}
 
{{I BaseEntity}}
 
==Outputs==
{{O BaseEntity|}}


== See also ==
== See also ==
 
* {{ent|newLight_Dir}} - directional sun light with godrays only.
* {{ent|NewLights_settings}}
* {{ent|NewLights_Spawner}} - spawner of deferred point lights.
* {{ent|newLight_Point}}
* {{ent|env_lensflare}} - cinematic dynamic lens flare.
* {{ent|newLight_Spot}}
* {{ent|newLight_Spot}} - spot deferred light entity.
* {{ent|env_lensflare}}
* {{ent|newLight_Point}} - point deferred light entity.
* {{ent|newLight_Dir}}
* {{ent|newLights_settings}} - entity that changes deferred light settings.
* {{ent|env_cascade_light}}
* {{ent|env_cascade_light}} - deferred cascade sun light entity.
* [[Lighting]]
* [[New Lights Editor]] - in game deferred lights editor.
* [[Adding Light]]
* [[Effect flags]] - effects flags, some of them are dynamic light effects.
* [[Intermediate Lighting]]
* [https://chetanjags.wordpress.com/2023/07/18/blackmesa-xenengine-part-4-lighting-shadows/ BlackMesa XenEngine: Part 4 – Lighting & Shadows] - page from Chetan (lead programmer for Black Mesa) about new lights.
* [[Advanced Lighting]]
* [https://chetanjags.wordpress.com/2023/07/11/blackmesa-xenengine-part2-how-a-frame-is-rendered/ BlackMesa XenEngine: Part2 – How a Frame is Rendered] - page from Chetan (lead programmer for Black Mesa) about how a frame is rendered.
* [[Effect flags]] (dynamic light effects)
* [https://chetanjags.wordpress.com/2022/06/01/blackmesa-xenengine-part1-a-heavily-modified-source-engine/ BlackMesa XenEngine: Part1 – Heavily Modified Source Engine] page from Chetan (lead programmer for Black Mesa) about {{xe|4}}.
* [[Tool textures]] (for Block light)
* [https://chetanjags.wordpress.com/2023/07/18/blackmesa-xenengine-part-4-lighting-shadows/ BlackMesa XenEngine: Part 4 – Lighting & Shadows] (page from Black Mesa developer about new lights)
* [https://chetanjags.wordpress.com/2023/07/11/blackmesa-xenengine-part2-how-a-frame-is-rendered/ BlackMesa XenEngine: Part2 – How a Frame is Rendered] (page from Black Mesa developer about how a frame rendered)
* [https://chetanjags.wordpress.com/2022/06/01/blackmesa-xenengine-part1-a-heavily-modified-source-engine/ BlackMesa XenEngine: Part1 – Heavily Modified Source Engine] (page from Black Mesa developer about Black Mesa engine, better known as [[Xengine]])
{{todo|Clean up english. Add more issues if you'll find.}}

Latest revision as of 04:42, 27 May 2025

C++ Class hierarchy
CGodRaysSettings
CBaseEntity

godrays_settings is a point entity available in Black Mesa Black Mesa. This entity dynamically changes some godrays settings for newLight_Point if triggered by the input. It should also affect newLight_Dir entity, but due to the incorrectly specified class it does not work for this entity.

Tip.pngTip:You can change values dynamically via AddOutput input.

Keyvalues

TargetGodRays_Name (TargetGodRays) <string>
Here you enter name of new light entity (with godrays support) for which you want to apply changes. Works with multiple lights if they have the same name.
TransitionTime (TransitionTime) <integer>
Transition time in seconds (0 for instant) to transition into new settings. Its a lerp operation A + (B-A) * TimeFactor.
LightType (LightType) <choices>
Type of light source for which you want to apply settings. Entity will not apply settings for newLight_Dir if selected Point Light and will not apply settings for point lights if selected Direction/Sun Light. Don't change this to Direction/Sun Light due to the above mentioned reason.
  • 0: Direction/Sun Light
  • 1: Point Light


EnableGodRays (EnableGodRays) <choices>
Sets godrays state on spawn, enabled or disabled.
  • 0: Disabled
  • 1: Enabled
Warning.pngWarning:You can have only 40 point lights with godrays enabled simultaneously, otherwise the game will crash with this error message.
The error
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> Obsolete
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
Note.pngNote:Godrays doesn't look smooth if used big value here. The same for Exposure.
Example
ColorInner (ColorInner) <color255 + int>
The RGB color and brightness of the inner circle. Colors and brightness must be between 0 and 255.
Icon-Bug.pngBug: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.pngNote: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.
Icon-Bug.pngBug: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.pngNote:Rays is disabled on this picture (the colors are partially blending).
Note.pngNote:You can't use black colors for ColorOuter, ColorInner and ColorRays.
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.pngNote:Rays is disabled on this picture (for clarity).

Inputs

InputApplySettings <void>
Triggers the entity to apply the settings.

See also