Versions Compared

Key

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

...

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:

  • 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

Weather

Subtopic on weather:

...

Currently you cannot control the Sun/Moon Ambient/Diffuse options. You can't change the sun location (thus the shadow angles). You cannot get static shadows to show from anything other than the player or the sun mdl.