Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

You can set a general set of visual (lighting) options in the Visual tab of the area properties. The list here is defined by the environment.2da file. All of the settings can be changed once a default is applied, with Reset To Black having everything be 0, or black, as lighting on tiles and for the area. Since many of these presets will alter the tile specific light colours at random (the Main Lights and Source Lights) if you want to do it all very specifically the Reset to Black might be a good option to use when creating an area.

To select a new area-wide setting choose one from the list and select Apply.

Note that the default selected on creating an area is controlled by the areag.ini file, so custom tilesets may not have anything other than default settings (generally black).

...

This section can change many of the general area lighting settings.

You might want to read up on the Phong model used in OpenGL for where some of these names come from: https://learnopengl.com/Lighting/Basic-Lighting

NOTE: The PC always generates some kind of "light" either darkvision or something similar even for non-Darkvision characters. This may look a little weird in some of the example screenshots with ambient lighting set to black.

SettingValuesExterior Clear DefaultsNotes and ExamplesExample 1

Example 2
Day/Night Cycle

Cycle Day and Night

Always Bright

Always Dark

Cycle

...

  • Ambient Color
  • Diffuse Color
  • Fog Amount
  • Fog Color
  • Shadows Enabled

...

Day and Night

The first option cycles between Sun and Moon settings depending on time of day. The other two force Sun or Moon - these differ slightly in how shadows are assigned, it assumes the sun is overwhelming any local light sources while the moon would be complementary / secondary to the local lights.

This cannot be edited with nwscript later although other values can be set so it basically isn't used (ie making both sun and moon settings identical).





Ambient ColorRGB50 / 50 / 100 (darker blue)

Ambient colour is the general light that the sun or moon produces and tints everything. The sun isn't perfect white so it is rare you'd use this. As the default is a blue colour this gives you an idea about what a scene outside would look like.

Can be get/set with GetAreaLightColor and SetAreaLightColor.

Ambient red (255/0/0) / Diffuse white:

Image Added

Ambient red (255/0/0) / Diffuse blue (0/255/0):

Image Added



Diffuse ColorRGB255 / 255 / 255 (white)

This is the colour of lighting that diffuses across a scene. It mixes with the ambient colour as seen in some example screenshots, but if extremes of white and black are used it can get a bit much - although all black for both is used when you want proper darkness (inside a dark cave for instance).

Can be get/set with GetAreaLightColor and SetAreaLightColor.

Ambient white / Diffuse black: 

Image Added

Ambient white / Diffuse white:

Image Added

Ambient black / Diffuse white:

Image Added

 Ambient black / Diffuse black: 

Image Added

Fog Amount

0 - 2000Basically how much more fog is there from the fog clip distance to the character. If you're using the default 45M distance, which includes a few meters of fog already, putting 50 will overlap the character. A more reasonable 10 might make it lightly foggy and 20 heavily foggy.



Fog ColorRGB104 / 126 / 145 (blue/grey)Can be set for Sun/Moon/both using SetFogColor.



ShadowsYes / NoYesWhether or not this light generates shadows, it overrides the "local" light ie a PC carrying a torch in daylight won't generate shadows from their torch as well.



Fog Clip Distance30 - 999945

Distance in meters until the fog clips, ie fog is at 100% and cannot be seen through and geometry stops being rendered.

By default creatures won't appear past 35M and non-static placeables past 45M anyway, so it stops you seeing further "empty" parts of the map geometry.

It can add ambience if kept to the standard amount, especially in interiors, but is extended by the Sky Box setting and fades into the bottom of the skybox in more wide open areas by another 90M on top of this setting.





Shadow Opacity0 - 10050This applies to both Sun and Moon, making the shadows darker or lighter. 50 is a good middle ground here for a normal sun since shadows in sunlight are not necessarily very dark negative areas where the sun directly can't reach, since light bounces around.



Sky BoxDropdown from skyboxes.2da(None)If added this extends the fog clip distance (90M), and can change depending on the time of day so the sun/moon settings make more sense.



For Weather see separate pages on those settings.

The Sun and Moon

The Sun and Moon are in fact the same thing really! They just have different settings during the day and night in the lighting properties window.

...

  • If daytime
    • If the sun shadows are enabled, use the sun only for static shadows
    • If sun shadows are disabled, use the PC's light source (eg; interiors, their torch would light up geometry)
  • If night time
    • If the player has a light (eg; a torch) use that to cast static shadows
    • Else if moon shadows are enabled, use the sun to cast static shadows

Tile Lighting

Image Added

Main Lights 1 / 2

These are defined as a light node on the model. They vary tileset to tileset, with there being 0, 1 or 2 available and the positions and strength of the light determined by the MDL.

The properties of these are:

  • Do not cast shadows
  • Strength (radius) set in the MDL
  • Color set by tile properties

For instance these are the two positions on this tile for main lights. The middle one (red) is a lot brighter than the secondary one (green), which is generally the style in Bioware tilesets. The second screenshot is the toolset, the final one is in game.

Image AddedImage AddedImage Added

Source Lights 1 / 2

There can be up to two source lights on a tile. These are very basic - they will load a the MDL file fx_flame01.mdl where the dummy position is set, coloured to what is set on the tile. See Model Special Nodes for more information on setup/naming.

In the same tile example, with no main lights, and two different colours you can see how it differs. Toolset left, in game enhanced right.

Image AddedImage Added

Animation Loops

These are sometimes used to toggle on and off other "lights" (as well as animations like spinning windmills etc.).

Visual Effect Lighting (Dynamic lights)

There are several sources of dynamic light emitters (visual effects) in the game.

Player Lighting

The player by default has one light attached to them at all times, determined by different progfx.2da entries that the game uses for darkvision, low light vision, blindness or "default light" if no others are present (giving even humans some light in very dark areas). This isn't very apparent unless you look for it, and the relevant MDL can be edited to remove or change the colour.

If the player casts a spell involving a light component (eg Light) or equips an item with light attached (eg a torch), the "highest priority" light then applies (determined by the radius of them). Ones that are at least 10M bright will also cast shadows.

Visual Effects

EffectVisualEffect can just create light on any object - a player/creature, a placeable or a door. It cannot create it on the ground but EffectAreaOfEffect could do this, although attaching a light effect to an invisible placeable might be easier (and more resource efficient).

Placeables

Placeables can have visual effects - see placeables.2da for full details, but fx_placeable.mdl is spawned if the placeable is given a Light colour number. The placeable must be "active" (usually a flame from a fire or light from a lamp or similar) and can be controlled by scripting with SetPlaceableIllumination allowing you to turn on or off it on use or some other case.

Since fx_placeable.mdl is a proper light node, it acts like visual effects with light nodes.

Weather

Subtopic on weather:

...

However these things are still hardcoded:

...

  • Shadows and what casts them (ie the sun/local torches), and how they look

todo:

Concepts:

  • Area general lighting (such as the "Sun")
  • Per-tile lighting colours 1/2
  • Per-tile "dynamic lights" such as torches. Note bug if changing dynamically:
  • Dynamic lights (such as torch placeables, fires)
  • Player lights
  • Fog colours

Topics:

Choosing an initial "Preset" in area properties

Day and Night Cycle Lighting

Sun and Moon

Skybox

Fog (Clip distance)

Dynamic Lights

Shadows (Opacity)

...