Env sun: Difference between revisions
Jump to navigation
Jump to search
Important:This is a preserved entity in 






.
If the game has round restart mechanics this entity may not behave as expected:
Bug:Centering the player's view perfectly on the sun will render it invisible, even if there is no crosshair. This has been fixed since
.
Fix:A fix for this bug can be found here (tested in:
,
,
)
Note:Deprecated in
Black Mesa in favor of env_lensflare with newLight_Dir.
Tip:As env_sun doesn't affect lighting, the map's light_environment should use the same angles as env_sun. If using multiple env_sun entities, use the average angles of all suns for the sunlight angle.
SirYodaJedi (talk | contribs) m (→Keyvalues) |
MyGamepedia (talk | contribs) No edit summary |
||
Line 8: | Line 8: | ||
When the sun is looked at directly, it will transition to the properties of an "overlay". | When the sun is looked at directly, it will transition to the properties of an "overlay". | ||
{{bug|Centering the player's view perfectly on the sun will render it invisible, even if there is no crosshair. This has been fixed since {{l4d}}.{{modernFix|A fix for this bug can be found [[General SDK Snippets & Fixes#Fix env sun sprite disappearing in sky when you look at it|here]]}} }} | {{bug|Centering the player's view perfectly on the sun will render it invisible, even if there is no crosshair. This has been fixed since {{l4d}}.{{modernFix|A fix for this bug can be found [[General SDK Snippets & Fixes#Fix env sun sprite disappearing in sky when you look at it|here]]}}|tested={{bms}},{{orangebox}},{{hl2dm}}}} | ||
{{Note|Deprecated in {{Bms|4}} in favor of {{ent|env_lensflare}} with {{ent|newLight_Dir}}.}} | {{Note|Deprecated in {{Bms|4}} in favor of {{ent|env_lensflare}} with {{ent|newLight_Dir}}.}} | ||
{{tip|As {{code|env_sun}} doesn't affect lighting, the map's {{ent|light_environment}} should use the same angles as env_sun. If using multiple {{code|env_sun}} entities, use the average angles of all suns for the sunlight angle.}} | {{tip|As {{code|env_sun}} doesn't affect lighting, the map's {{ent|light_environment}} should use the same angles as env_sun. If using multiple {{code|env_sun}} entities, use the average angles of all suns for the sunlight angle.}} |
Revision as of 11:21, 22 September 2024
![]() |
---|
CSun |
![]() |
env_sun
is a point entity available in all Source games. It places a glowing 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; it is merely a visual representation of the Sun. Use light_environment to provide actual sunlight for your map.









If the game has round restart mechanics this entity may not behave as expected:
|
When the sun is looked at directly, it will transition to the properties of an "overlay".









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
- UseAngles (use_angles) <boolean>
- The old way to orient
env_sun
is to use Viewer entity. The new way is by Pitch Yaw Roll. If you want to use the new way, set this property to YES.
- Viewer entity (target) <targetname>
- Name of an entity (ex: info_target) used to determine where the sun is in the skybox. The resulting sun sprite will be positioned based on a line starting from the Viewer entity towards the
env_sun
. Note:Killing the viewer entity after the env_sun has already been spawned will have no adversarial effects.
- Pitch (pitch) <float>
- This value sets the pitch position of the sun. It overrides the Pitch in Pitch Yaw Roll, even if left at 0, so it needs to be specified. This Pitch is reverse of the normal, so 90 is straight up, while -90 is straight down.
- Yaw (angle) <float> !FGD
- Override for Yaw in Pitch Yaw Roll, similar to Pitch.
Bug:Crashes the game if set. Observed with a value of 330 in
. [todo tested in ?]
- Sun Color (R G B) (rendercolor) <color255>
- Color of the sun. The effect is additive with the sky: a pure yellow sun with a bright blue sky will appear white in-game; change the color to account for this.
- Overlay Color (R G B) (overlaycolor) <color255>
- Color of the sun overlay.
- Size (size) <integer>
- Size of the sun.
- Overlay Size (overlaysize) <integer>
- A value of -1 means the overlay will act the old way[Clarify].
- Material Name (material) <sprite>
- Material of the inner glow.
- Overlay Material Name (overlaymaterial) <sprite>
- Material of the overlay glow.
- Glow Distance Scale (glowDistanceScale) <float> (in all games since
)
- Scales the distance used to test for sun glow occlusion. If the player can see any part of the skybox within this range, the overlay will render.
Inputs
- TurnOn
- Enable sun rendering.
- TurnOff
- Disable sun rendering.
- SetColor <color255 >
- Sets Sun Color.
See also
- light_environment
- env_cascade_light
- Advanced Lighting
- Effect flags (dynamic light effects)
- newLight_Dir
- env_lensflare
- newLight_Point