Nuclide
Software Development Kit for id Tech
light_environment Class Reference
Inheritance diagram for light_environment:
NSEntity light

Public Member Functions

void light_environment (void)
 
virtual void Respawn (void)
 Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state. More...
 
virtual void SpawnKey (string, string)
 This method handles entity key/value pairs on map load. More...
 
virtual bool CanSpawn (bool)
 Returns if this entity can spawned from the map file. More...
 
void light_environment (void)
 

Detailed Description

QUAKED light_environment (0 1 0) (-8 -8 -8) (8 8 8) ?

OVERVIEW

Defines the overall ambient skylight in the map.

KEYS

  • "color" : Normalized RGB color value. Default is [1,1,1]
  • "color255" : RGB255 color value. e.g. '255 255 255' for white
  • "ambientcolor" : Shadow color. Normalized RGB color value. Default is [1,1,1]
  • "ambientcolor255" : Shadow color. RGB255 color value. e.g. '255 255 255' for white
  • "intensity" : Overall intensity of the sky light. '300' is probably okay for a day level.
  • "sunangle" : The yaw position of the sun, basically the horizontal direction.
  • "pitch" : The vertical position of the sun. '-90' means straight down, '-45' is diagonal etc.
  • "samples" : The amount of passes onto the lightmap, this is required for spread.
  • "sunspreadangle" : The offset of each sample pass in degrees, basically horizontal jitter.
  • "filterradius" : Blur amount for each pass. This will make cloud scenes work well.

NOTES

Only one is effective per map. Sun light generally is white, unless the atmosphere/horizon is coloring it. The ambientcolor should generally be set to that of the skybox for the most realistic depiction of the world. As mentioned before, the 'sunspreadangle' and 'filterradius' keys only work if 'samples' is set to something higher than 1, as those are parameters for said behaviour. There's no point in setting 'samples' to something higher than 1 if you aren't bothering to supply a valid 'sunspreadangle' and 'filterradius' key either.

For cloudly/overcast skies, I'd recommend setting the 'pitch' to '-45', then 'samples' to at least '4' and 'sunspreadangle to '360' with a 'filterradius' of at least '1'. This will ensure that the sunlight will be cast diagonally from 4 positions across the entire horizon - thus eliminating any harsh shadows.

TRIVIA

This entity was introduced in Half-Life (1998).

Constructor & Destructor Documentation

◆ light_environment() [1/2]

void light_environment::light_environment ( void  )

◆ light_environment() [2/2]

void light_environment::light_environment ( void  )

Member Function Documentation

◆ CanSpawn()

bool light_environment::CanSpawn ( bool  clientSide)
virtual

Returns if this entity can spawned from the map file.

Parameters
clientSideIf it's being spawned on the client-side.

Reimplemented from NSEntity.

◆ Respawn()

void light_environment::Respawn ( void  )
virtual

Server: Called when the entity first spawns or when game-logic requests the entity to return to its original spawn state.

Reimplemented from light.

◆ SpawnKey()

void light_environment::SpawnKey ( string  strKey,
string  strValue 
)
virtual

This method handles entity key/value pairs on map load.

You can easily convert the strValue parameter using the ReadFloat etc. methods that are part of NSIO.

Reimplemented from light.


The documentation for this class was generated from the following files: