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
. [todo tested in ?]
(Added sprite from GMod) |
No edit summary |
||
Line 10: | Line 10: | ||
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}}.}} | {{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}}.}} | ||
: {{fix|A fix for this bug can be found here: [[General_SDK_Snippets_%26_Fixes#Fix_env_sun_sprite_disappearing_in_sky_when_you_look_at_it]]}} | |||
{{code class|CSun|sun.cpp}} | {{code class|CSun|sun.cpp}} | ||
Revision as of 16:14, 16 May 2022
Template:Base point It places a glowing sun effect 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".


Fix:A fix for this bug can be found here: General_SDK_Snippets_&_Fixes#Fix_env_sun_sprite_disappearing_in_sky_when_you_look_at_it
Keyvalues
- UseAngles (use_angles) ([todo internal name (i)]) <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) ([todo internal name (i)]) <targetname>
- Name of an entity (probably sky_camera) 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
.
- Pitch (pitch) ([todo internal name (i)]) <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) ([todo internal name (i)]) <float> !FGD
- Override for Yaw in Pitch Yaw Roll, similar to Pitch.
- Sun Color (R G B) (rendercolor) ([todo internal name (i)]) <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) ([todo internal name (i)]) <color255>
- Color of the sun overlay.
- Overlay Size (overlaysize) ([todo internal name (i)]) <integer>
- A value of -1 means the overlay will act the old way.
- Overlay Material Name (overlaymaterial) ([todo internal name (i)]) <sprite>
- Material of the overlay glow.
- HDR color scale (HDRColorScale) ([todo internal name (i)]) <float>
- Color multiplier when in HDR mode.
- Glow Distance Scale (glowDistanceScale) ([todo internal name (i)]) <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.