Lighting

From Red Eclipse Wiki
Jump to: navigation, search

Lighting is an entity that can be added to a map in the editing mode.

Creating a Light

Creating a spherical light entity: Open the Console with the tilde key (~) or forward slash (/)...

/newent light 300 180 180 180

...This will create a light entity with a radius of 300 and Red Green and Blue Values of 180, or gray.


Once an entity is created, its parameters can be changed by highlighting the Entity, then; pressing the Period Key to enter the desired setting through /entset, or... Holding the corresponding Number Key to the parameter you wish to change while scrolling the Mouse Scroll Wheel.

To move an entity, click the face corresponding to the axis you wish to move it on with the left mouse button and drag.


Once you have created a Light Entity you can create a lightmap texture for your map by using the calclight command

/calclight 

or press the F7 shortcut key.


If you find that calclight takes too long due to the detail in your map, raise the lightprecision to speed up calculating.

/lightprecision 256 [1-2048]


To hide the lightmap and continue editing your map turn on fullbright mode

/fullbright 1

or press the shotcut key "B"


To change the base ambient light color for your map (shadow color)use the /ambient command. The default ambient is dark grey

/ambient 25 25 25

Calculating Lightmaps

/fullbright # toggles the lightmap on/off Hotkey: B
/calclight calculates the lightmap (requires at least 1 light in the map) Hotkey: F7
/ambient RR GG BB sets the base lighting for the map. Higher values can prevent dark spots that are hard to see while playing at the expense of lighting contrast.

Default: 25 25 25 (dark grey)

Max: 255 255 255 (equivalent to fullbright)
/lightprecision # sets the resolution of the lightmap textures contained withing the .mpz map file. This setting greatly affects the size of the map. It is recommended that you raise this setting to keep the number of lightmap textures under 3. Default lightprecision is 32; most maps are between 64 and 256 in lightprecision.
/lightlod # sets the level of detail for the lightmap. A higher number creates sharper shadows, at the expense of map size. Decreasing lightprecision generally yields better results for the same map file size. Default is 0; max is 10.
/lightthreads # changes the number of CPU threads to distribute the lightmapping job over. Setting this to the number of cores in the CPU can greatly increase performance.

Sunlight

Sunlight entities create rays of light that come from a defined angle rather than from a point source. While it is possible to use a conventional light entity in order to simulate global lighting, the edges of the map will have distorted shadows.

To make a sunlight entity, use /newent sunlight [pitch] [red] [green] [blue] [offset] [flare] [flarescale], or select a sunlight entity from the lighting GUI. For example,

/newent sunlight 0 255 255 255 20 0 0

will create white sunlight from straight up with light appearing to radiate from a 20 degree cone.

The most confusing parameter , offset, is not provided for in the GUI, nor is it relevant for conventional lights. It controls the spread of the sunlight: higher values will make the sunlight appear to come from a larger area. Setting offset to -1 will make the sunlight appear to come from a point.

Lighting Tips

  • Lights should come with accompanying geometry or mapmodels, i.e. put light entities near physical lights.
  • Lighting should be used to make textures more vibrant: create some contrast (within reason)
  • Large lights will take less time and less disk space than using more small lights to cover the same area.
  • Try to use as high of a lightprecision as reasonable: this saves disk space and reduces rendering times.
  • To keep lightprecision high, change the blurr value to 1 or 2 to un-pixelize the shadow lines.
  • While dark areas may look good, the primary purpose of a map is to be played. Consider adding more lighting to make things visible.
  • Implied sunlight may work as a global lighting option, manually adding sunlights often provides a better match to the skybox.
  • Having high ambient lighting reduces the contrast of light entities. Use light entities liberally instead of raising the ambient.