Area Lighting is a combination of several different types of lights, as well as player-led item or spell lighting on top. This page should give an overview of some of this plus directions to more details if required.

Lighting - Enhanced Edition and Client Options

Before starting it is worth noting that this is all based off the Enhanced Edition with mostly default client settings.Generally the changes to lighting improve the reflections, occlusion and other concepts. The original mostly-baked-in lighting can still be reverted to, but the assumption is that clients will use the new (default) enhanced lighting.

The client also has control over some settings such as Lighting Cutoff Rnage Multiplier (default 2.0), Lighting Max Intensity (default 1.5), Lighting Intensity At Range (default 0.2) and some options around shadows and shader quality.


Lighting in NWN has become a bit more nuanced in NWN:EE. There is a better lighting engine as of 2020 and this improves the tile and dynamic lighting and how it interacts with things.

Concepts:

Topics:

Choosing an initial "Preset" in area properties

Day and Night Cycle Lighting

Sun and Moon

Skybox

Fog (Clip distance)

Dynamic Lights

Shadows (Opacity)

User Lighting Settings

The Sun and Moon

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

The sun is in fact an in game MDL that generates light called gidy_sun.mdl 

This mdl file is placed at coordinates x = 4000, y = 4500 and z = 7000. The radius of the light is 100,000 meaning it projects it fully over the area to generate shadows and light.

The mdl defines 2 light sources, it looks like one is for ambient light colouring of everything and one is to cast shadows.

If you remove the gidy_sun mdl by blanking it or removing the light definitions this will crash the game. You can "remove" the global sun by setting the radius to be low - eg; 1, instead of 100000.

Sun and Static Geometry Shadows

The sun is special since it is, apart from the player model, the only thing that can generate shadows on static geometry (tiles, and placeables set to static). We've tried applying this MDL to other things like placeables, visual transforming it into the sky etc, and sadly this doesn't do static geometry shadows. You can edit the MDL file to alter the amount of light and technically you can alter the position but you can't dynamically change the position (eg doing time of day shadows that shift).

You can attach the same effect (with an EffectVisualEffect transform of location) and see the sun shadows do work fine if rotated - since it follows the players facing sadly this also cannot be used to change the shadow geometry angle.

The way the sun and moon shadows work is dependant on the player having a light:

Weather

Subtopic on weather:

Missing Nwscript Things

You have more options in later versions of EE to change the sun/moon direction/location with SetAreaLightDirection. This can be used to do a proper day/night cycle and an example is included in the game to do this.

However these things are still hardcoded: