- scene ambient light
DirectionalLightPointLight- basic directional shadows
- scene skyboxes
LitandUnlitmaterial modes- reusable
Materialassets on built-in 3D renderers
Use these features to move 3D scenes beyond flat debug-looking geometry and toward a more complete lit authoring workflow inside Lenga.
What This Workflow Covers
The shared 3D lighting path supports:
- scene-level
Ambient Color - scene-level
Ambient Intensity DirectionalLightPointLight- directional-light shadows
Skyboxassets assigned at the scene level- a bundled default engine skybox when a scene does not assign its own
- material
Specular - material
Smoothness - the richer shared lit response on
CubeRenderer,SphereRenderer,PlaneRenderer,MeshRenderer, andModelRenderer - shared directional shadows across the built-in 3D renderer surface
That means you can:
- Create a material asset.
- Assign that material to a sphere, cube, plane, mesh, or model renderer.
- Add a
Directional Lightgame object to the scene. - Add one or more
Point Lightgame objects where you want local accents. - Enable shadows on the directional light when the scene needs stronger grounding.
- Tune ambient light at the scene level.
- Assign a scene skybox, or rely on the bundled default.
- See lit 3D geometry at runtime.
Authoring Ambient Light
Scene ambient is part of the scene settings.
Scene fields:
Ambient ColorAmbient Intensity
Use ambient light to keep shadow-facing surfaces readable. Keep it modest. The directional light should still do most of the shaping.
Adding A Directional Light
Use this authoring flow:
- Create a new light game object.
- Add a
DirectionalLightcomponent. - Rotate the game object to aim the light.
- Set
ColorandIntensity. - Enable and tune shadows if the scene needs them.
The light direction comes from the game object's transform. There is no separate direction vector field to maintain.
Directional shadows are owned by DirectionalLight. The supported shadow workflow includes:
- one shared shadow map
- directional-light shadows only
- no point-light shadows
- no cascades
That gives scenes much better grounding while keeping the shadow workflow simple and predictable.
Directional Shadows
Directional shadows are authored on the DirectionalLight component.
Directional shadow controls:
Cast ShadowsShadow StrengthShadow BiasShadow SizeShadow Distance
Recommended starting values:
Cast Shadows: onShadow Strength: around0.55to0.75Shadow Bias: around0.0015to0.0035Shadow Size: around14to24Shadow Distance: around20to36
Shadow Size controls the orthographic coverage of the shadow camera. Smaller
values give tighter, sharper shadows for compact scenes. Larger values cover
more space, but the same map resolution has to stretch farther.
Shadow Distance controls how far from the active game camera the directional
shadow solution tries to cover.
Adding A Point Light
Use a point light when you want local color and shape instead of whole-scene sunlight.
- Create a new game object.
- Add a
PointLightcomponent. - Move it to the area you want to accent.
- Tune
Color,Intensity, andRange.
Point lights are especially useful for:
- collectibles
- goal pads
- interior props
- cool/warm fill near the player
Recommended Starting Setup
For a clean stylized scene:
Ambient Intensity: around0.2to0.35DirectionalLight Intensity: around1.0to1.3PointLight Intensity: around0.8to1.6PointLight Range: around4to10- a slightly warm light color for sunlight
- a cooler ambient color for fill
That gives a readable scene without flattening everything back out.
Pairing Materials With Light
Lit materials are the normal choice for 3D gameplay surfaces.
The material asset inspector now also exposes:
SpecularSmoothness
Those let you decide whether a surface should read as soft and chalky or glossy and rounded under the shared lit shader.
Use them for:
- ground
- player ball
- pickups
- blockers
- simple props
Use Unlit materials when you intentionally want flat presentation, UI-like
3D accents, or debug visuals.
Scene Skyboxes
Skyboxes are now scene-level authoring, not a sample-only trick.
Skybox workflow:
- Create a
Skyboxasset from the asset browser if you want a custom sky, or use one of the bundled engine skyboxes. - Select the scene itself in the Inspector.
- Set the
Skyboxfield in the scene lighting/backdrop section. - If you are editing a custom skybox asset, choose a mode:
ProceduralPanoramaCubemap
If you leave the scene Skybox field empty, Lenga uses the bundled engine
default skybox automatically. That default is sourced from res/images/StandardCubeMap.png
during development and bundled into exported builds.
Lenga also ships with a small bundled cubemap catalog from Screaming Brain
Studios. Search for SBS Cloudy Sky in the scene Skybox picker to try those
out-of-the-box skies. They are credited in the editor under Help -> Credits...
and copied into exported builds with their license file.
PHP Example
use Lenga\Engine\Core\Behaviour;
use Lenga\Engine\Core\DirectionalLight;
use Lenga\Engine\Core\PointLight;
final class SunTweaker extends Behaviour
{
public function start(): void
{
$light = $this->gameObject->getComponent(DirectionalLight::class);
if (!$light instanceof DirectionalLight) {
return;
}
$light->intensity = 1.15;
$light->shadowsEnabled = true;
$light->shadowStrength = 0.65;
$light->shadowBias = 0.0025;
$light->setColor(255, 241, 214, 255);
}
}
final class PickupLightTweaker extends Behaviour
{
public function start(): void
{
$light = $this->gameObject->getComponent(PointLight::class);
if (!$light instanceof PointLight) {
return;
}
$light->intensity = 1.35;
$light->range = 6.0;
$light->setColor(255, 213, 122, 255);
}
}
The lighting workflow includes scene ambient light, DirectionalLight, PointLight, shadows, skyboxes, and material-aware editor previews.