From d6f6a5a486069e78bd5f083c61750c23c6eda09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 10 Apr 2026 18:00:08 +0200 Subject: [PATCH 1/4] [3D light] Add a page to compare each type of light --- docs/gdevelop5/objects/3d-light/index.md | 35 ++++++++++++++++++++++++ docs/gdevelop5/objects/3d-model/index.md | 2 ++ 2 files changed, 37 insertions(+) create mode 100644 docs/gdevelop5/objects/3d-light/index.md diff --git a/docs/gdevelop5/objects/3d-light/index.md b/docs/gdevelop5/objects/3d-light/index.md new file mode 100644 index 00000000000..56ee4f3fa34 --- /dev/null +++ b/docs/gdevelop5/objects/3d-light/index.md @@ -0,0 +1,35 @@ +--- +title: 3D light +--- +# 3D light + +## Choose the right light + +Light objects illuminate some part of the scene whereas light effects illuminate the whole scene. + +### Light objects + +Light objects can be moved. They emit light from their center. They can cast shadows for 3D objects. + +- [Spot light](/gdevelop5/extensions/light3d/#3d-spot-light) lights up a cone like a flashlight. +- [Point light](/gdevelop5/extensions/light3d/#3d-point-light) lights up in all directions like a fire. + +### Light layer effects + +Light effects don't have a position in the scene, but you can change the direction of the light with 2 angles. Light effects can be set up through [layers effects](/gdevelop5/interface/scene-editor/layer-effects). + +- [Directional light](/gdevelop5/all-features/scene3d/reference/#effect-directional-light) is a very far light source like the sun. It can cast shadows for 3D objects. When it's used alone, the part of the object in the darkness is pitch black. This is why it's often used along with a hemisphere light. +- [Ambient light](/gdevelop5/all-features/scene3d/reference/#effect-ambient-light) illuminates objects from every direction. It doesn't give any shade to the objects which tend to look flat. This is why the hemisphere light is usually preferred. +- [Hemisphere light](/gdevelop5/all-features/scene3d/reference/#effect-hemisphere-light) illuminates objects from every direction with a gradient of 2 colors. It is often used along with a directional light. + +## Avoid shadow artefacts + +When [3D model objects](/gdevelop5/objects/3d-model/) are both casting and receiving shadows, you might see some darkened patterns on them. The **Shadow bias** property of lights can be used to avoid this "shadow acne". Choose a value small enough like 0.001 to avoid creating distance between shadows and objects but not too small to avoid shadow glitches on low/medium quality. + +## Display more light objects + +Light objects can be heavy on the GPU especially when they cast shadows. In order to allow game creators to add many lights in the scene, the engine automatically hide lights the furthest away from the camera. By default, the limits are: +- 20 visible light objects +- 4 light objects casting shadows + +These limits can be changed with **Max lights count** and **Max lights with shadow count** actions. Be aware that setting too high values can make games crash because of WebGL own limit. diff --git a/docs/gdevelop5/objects/3d-model/index.md b/docs/gdevelop5/objects/3d-model/index.md index 96fc9be19d8..4a1fff8a058 100644 --- a/docs/gdevelop5/objects/3d-model/index.md +++ b/docs/gdevelop5/objects/3d-model/index.md @@ -67,6 +67,8 @@ Shadows are computed around the camera with a range suitable for most games. You Shadow casting and shadow receiving can be controlled independently. For example, you might want a flying object to cast shadows on the ground but not receive shadows from other objects. +When models are both casting and receiving shadows, you might see some darkened patterns on them. This can be fixed thanks to the **Shadow bias** property of [lights](/gdevelop5/objects/3d-light/#avoid-shadow-artefacts). + ## Origin and center points The 3D model object has two important configuration points that affect how it's positioned and rotated: From 6118a221bdb0a47fd4ea15ef0b5190d0407bbdae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 10 Apr 2026 18:03:17 +0200 Subject: [PATCH 2/4] Typo --- docs/gdevelop5/objects/3d-light/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/gdevelop5/objects/3d-light/index.md b/docs/gdevelop5/objects/3d-light/index.md index 56ee4f3fa34..454e72b0c1e 100644 --- a/docs/gdevelop5/objects/3d-light/index.md +++ b/docs/gdevelop5/objects/3d-light/index.md @@ -1,7 +1,7 @@ --- -title: 3D light +title: 3D Light --- -# 3D light +# 3D Light ## Choose the right light From 9ecb26361d5a3ef5d9d35effbcd02e8ae07f7750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 10 Apr 2026 18:05:20 +0200 Subject: [PATCH 3/4] Fix list --- docs/gdevelop5/objects/3d-light/index.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/gdevelop5/objects/3d-light/index.md b/docs/gdevelop5/objects/3d-light/index.md index 454e72b0c1e..ca3867aadbf 100644 --- a/docs/gdevelop5/objects/3d-light/index.md +++ b/docs/gdevelop5/objects/3d-light/index.md @@ -29,6 +29,7 @@ When [3D model objects](/gdevelop5/objects/3d-model/) are both casting and recei ## Display more light objects Light objects can be heavy on the GPU especially when they cast shadows. In order to allow game creators to add many lights in the scene, the engine automatically hide lights the furthest away from the camera. By default, the limits are: + - 20 visible light objects - 4 light objects casting shadows From e44cee7f9b2b7c29d474d6d76453d137efbf66c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Davy=20H=C3=A9lard?= Date: Fri, 10 Apr 2026 18:07:31 +0200 Subject: [PATCH 4/4] Fix value format --- docs/gdevelop5/objects/3d-light/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/gdevelop5/objects/3d-light/index.md b/docs/gdevelop5/objects/3d-light/index.md index ca3867aadbf..e12a294e07f 100644 --- a/docs/gdevelop5/objects/3d-light/index.md +++ b/docs/gdevelop5/objects/3d-light/index.md @@ -24,7 +24,7 @@ Light effects don't have a position in the scene, but you can change the directi ## Avoid shadow artefacts -When [3D model objects](/gdevelop5/objects/3d-model/) are both casting and receiving shadows, you might see some darkened patterns on them. The **Shadow bias** property of lights can be used to avoid this "shadow acne". Choose a value small enough like 0.001 to avoid creating distance between shadows and objects but not too small to avoid shadow glitches on low/medium quality. +When [3D model objects](/gdevelop5/objects/3d-model/) are both casting and receiving shadows, you might see some darkened patterns on them. The **Shadow bias** property of lights can be used to avoid this "shadow acne". Choose a value small enough like `0.001` to avoid creating distance between shadows and objects but not too small to avoid shadow glitches on low/medium quality. ## Display more light objects