env_skypaint

From Valve Developer Community
Jump to: navigation, search
English (en)Translate (Translate)

env_skypaint is a point entity available in Garry's Mod Garry's Mod.

env_skypaint
Env skypaint.png
TypePoint entity
EngineSource Source
AvailabilityGarry's Mod Garry's Mod
 

It allows the creation of custom dynamic skyboxes (Both HDR and LDR). It can be overridden by the Sky Editor (edit_sky) entity spawned by the player in game.

gm_construct uses env_skypaint
gm_flatgrass also uses env_skypaint
Icon-Important.pngImportant:The name of the skybox must be painted in order for this entity to work
Note.pngNote:The colors aren't in the RGB "255 255 255" format. In order to convert them to this format, you'll need to get your color value (such as 200 and divide it like 255/200, resulting in 0.78 rounded for the red color field)

Sky creation

  1. Place env_skypaint somewhere in your map.
  2. Change sky name to painted.
  3. Compile and run map.
  4. Using the spawnmenu, spawn the Sky Editor entity somewhere in your map (in the Entities tab under "Editors").
  5. Go to entity's properties and edit the values as you wish.
  6. When your're done, copy the values to your env_skypaint.
  7. Compile the map again. DONE

env_skypaint example values

Map Sky Top Color Sky Bottom Color Sky Fade Bias Sun Size Sun Normal Sun Position Method Sun Color Dusk Scale Dusk Intensity Dusk Color Draw Stars Star Texture Star Scale Star Fade Star Speed HDR Scale
gm_construct 0.22 0.51 1 0.919 0.929 0.992 0.1 0 0 0 1 Automatic 0 0 0 0.5 2 1 1 1 Yes skybox/clouds 2 0.5 0.03 0.56
gm_flatgrass 0 0.6 1 0.9 0.95 1 0.5 0 0 0 1 Automatic 0 0 0 0 0 0 0 0 Yes skybox/clouds 2 0.5 0.02 0.60

Keyvalues

Name (targetname) <string>
Entity's name
Sky Top Color (topcolor) <color1>
The colour of the top of the sky
Sky Bottom Color (bottomcolor) <color1>
The colour of the bottom of the sky
Sky Fade Bias (fadebias) <float>
Controls the bias of the fade between top/bottom (1.0 is even)
Sun Size (sunsize) <float>
Controls the size of the sun glow
Warning.pngWarning:not to be confused with env_sun
Sun Normal (sunnormal) <vector>
The position of the sun, expressed as a normal from the center of the world
Sun Position Method (sunposmethod) <choices>
How should we determine the position of the sun?
  • 0: Custom - Use the Sun Normal to position the sun
  • 1: Automatic - Find a env_sun entity and use that (Uses env_sun values)
Sun Color (suncolor) <color1>
The color of the sun glow (this is additive)
Dusk Scale (duskscale) <float>
The size of the dusk effect (colouring of the horizon)
Dusk Intensity (duskintensity) <float>
How powerful the dusk effect is
Dusk Color (duskcolor) <color1>
The color of the dusk effect
Draw Stars (drawstars) <choices>
Draws a specified texture as an overlay
  • 0: No - Don't draw stars
  • 1: Yes - Draw the stars please
Note.pngNote:Black color in the texture will be rendered with alpha
Stars Texture (starstexture) <string>
The star texture
Stars Scale (starsscale) <float>
How big the star texture should be
Star Fade (starsfade) <float>
Fade the star texture towards the horizon
Stars Speed (starsspeed) <float>
How fast the star texture should scroll across the sky
HDR Scale (hdrscale) <float>
When rendering your skybox in HDR mode, output will be scaled by this amount

Inputs

Kill
Removes this entity from the world.
KillHierarchy
Removes this entity and its children from the world.
Note.pngNote:Entities already remove orphaned children upon being removed, but this input removes all children on the same frame, being marginally faster than Kill.
AddOutput <string>
Adds a keyvalue/output to this entity. It can be potentially very dangerous, use with care.
KV Format: <key> <value>
I/O Format: <output name> <targetname>:<inputname>:<parameter>:<delay>:<max times to fire, -1 means infinite>
FireUser1 to FireUser4
Causes this entity's OnUser output to be fired.

Outputs

OnUser1 to OnUser4
These outputs each fire in response to the firing of the like-numbered FireUser1 to FireUser4 Input; see User Inputs and Outputs.