# Floodlit night effect

**URL:** <https://forum.babylonjs.com/t/floodlit-night-effect/57470>\
**Category:** Questions\
**Tags:** lighting, glowlayer\
**Created:** [March 28, 2025, 11:34am UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470 "2025-03-28T11:34:52Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tom\_Haddon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tom_haddon/32/2189_2.png) [@Tom\_Haddon](https://forum.babylonjs.com/u/Tom_Haddon)\
**Post date:** [March 28, 2025, 11:34am UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470/1 "2025-03-28T11:34:52Z")

</div>

Hi Folks,

I’m trying to create a floodlit night effect, and I think there are lots of _possible_ ways of doing it, but wanted some advice on the best approach.

So first of all, here’s a real-life picture of what I’m trying to achieve.

 ![losail-1050x788](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/b/8/b8eec726eea440547de874b9680ea4c2876970f8.jpeg)

Obviously creating all those lights individually would be problematic. I think one approach might be to somehow make the track itself (it’s a separate mesh from the ground) be the light source (but somehow still have it be dark, as it’s tarmac), or glow or something?

I’ve created a playground with the model I have for the ground and track (totally unfinished obviously): [Babylon.js Playground](https://playground.babylonjs.com/#849YCW). So far I’ve populated it with a few “lights” that are just emissive textures that glow a bit. Locally I’ve experimented with dark fog, but that doesn’t quite give me the effect I need (on its own) because:

1. I need the source of the fog to be the center of the model, but as far as I can tell it’s always from the active camera
2. I’d also need fog to somehow be inside the inner ring of the track, as shown in the picture above.

Thanks for any input.

---

<div class="post-metadata">

**Author:** ![Joe\_Kerr](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/joe_kerr/32/39017_2.png) [@Joe\_Kerr](https://forum.babylonjs.com/u/Joe_Kerr)\
**Post date:** [March 28, 2025, 12:04pm UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470/2 "2025-03-28T12:04:20Z")

</div>

I would say this is the perfect use case for @Heaust-ops deferred lighting:

- [Very, very much want to add deferred rendering, global illumination - #75 by Heaust-ops](https://forum.babylonjs.com/t/very-very-much-want-to-add-deferred-rendering-global-illumination/29611/75)
- or: [GitHub - Heaust-ops/babylon-deferred-lights: A deferred lighting solution for babylonjs](https://github.com/Heaust-ops/babylon-deferred-lights)

---

<div class="post-metadata">

**Author:** ![Heaust-ops](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/heaust-ops/32/45470_2.png) [@Heaust-ops](https://forum.babylonjs.com/u/Heaust-ops)\
**Post date:** [March 28, 2025, 12:08pm UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470/3 "2025-03-28T12:08:26Z")

</div>

here’s a starter setup w/ rect area lights as floodlights : )

> **[Babylon.js Playground](https://playground.babylonjs.com/#849YCW%231)**
>
> Babylon.js playground is a live editor for Babylon.js WebGL and WebGPU 3D scenes

will have to tweak orientations a bit : P

---

<div class="post-metadata">

**Author:** ![Heaust-ops](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/heaust-ops/32/45470_2.png) [@Heaust-ops](https://forum.babylonjs.com/u/Heaust-ops)\
**Post date:** [March 28, 2025, 12:17pm UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470/4 "2025-03-28T12:17:14Z")

</div>

> [@Tom\_Haddon](#):
>
> I think one approach might be to somehow make the track itself (it’s a separate mesh from the ground) be the light source (but somehow still have it be dark, as it’s tarmac), or glow or something?

but yeah I think you’re talking about baking the lighting. which yeah you could do.  
put the model inside blender, get the lighting right in cycles and bake it.  
it will appear like you’ve painted the lighting onto the textures.

you can find a buncha tutorials for this on youtube,  
here’s one [https://www.youtube.com/watch?v=SDqpnfTRtIU](https://www.youtube.com/watch?v=SDqpnfTRtIU)

---

<div class="post-metadata">

**Author:** ![Tom\_Haddon](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/tom_haddon/32/2189_2.png) [@Tom\_Haddon](https://forum.babylonjs.com/u/Tom_Haddon)\
**Post date:** [March 28, 2025, 12:27pm UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470/5 "2025-03-28T12:27:04Z")

</div>

Baking the lighting is definitely one option, and the deferred lighting looks interesting (but I suspect will be very hard to get the exact strength of lights I need without creating a washed out effect). I’ll read up and see what approach makes the most sense, thx.

---

<div class="post-metadata">

**Author:** ![PatrickRyan](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/patrickryan/32/3417_2.png) [@PatrickRyan](https://forum.babylonjs.com/u/PatrickRyan)\
**Post date:** [March 28, 2025, 4:54pm UTC](https://forum.babylonjs.com/t/floodlit-night-effect/57470/6 "2025-03-28T16:54:55Z")

</div>

@Tom_Haddon, I agree with @Heaust-ops in that the best option for lighting on a track would be light baking into a lightmap texture. This is a separate texture that you can control the intensity of directly. The reason that this is usually the preferred method for this type of scene is that the lighting will usually be static since the lights are not moving around the track and can save on a lot of calculation per frame. In addition to that, light baking usually allows for better quality lighting and shadows since they are created with ray traced renders resulting in a much higher quality in shadows and bounced light than would available in real time, especially without a powerful GPU.

This is an [older thread discussing light baking](https://forum.babylonjs.com/t/lightmaps-how-they-behave-in-sandbox-babylonjs/12357), but has some good information about creating and using them. Hope this helps with your information gathering as you decide on your approach.
