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.
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. 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:
- 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
- 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.
I would say this is the perfect use case for @Heaust-ops deferred lighting:
1 Like
here’s a starter setup w/ rect area lights as floodlights : )
will have to tweak orientations a bit : P
2 Likes
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
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.
1 Like
@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, but has some good information about creating and using them. Hope this helps with your information gathering as you decide on your approach.
2 Likes