+1 vote

I'm working on a project that includes torches. I've made them out of a small particle system and an OmniLight (one per torch). I put a few in my scene. I can look directly at the OmniLight and I see it's effect on the terrain around it, but when I look down some, away from the light on the top of the torch, the light ceases to show on the ground like a switch was just flipped and it went off.

There's no code behind the torches. They're a simple scene saved to be instanced in my main scene.

Any idea why they would behave like this?

asked Sep 25, 2018 in Engine by tproper (104 points)

1 Answer

+2 votes
Best answer

It is the Godot light manager turning them off.

Old OpenGL could only do 4, modern OpenGL can do 8.
The interesting part is that every object has it's own support for 8 lights. Meaning the more objects is in a scene the less noticeable the problem is.

Every object will calculate it's lights based on the ones nearest to it and the camera.

For the floor a grid like structure can be used to allow more lights:
enter image description here

Also large lights add to each other, obscuring the problem.

answered Sep 26, 2018 by MysteryGM (1,428 points)
selected Sep 26, 2018 by tproper

Ok. It should be in your inbox now.

Note that the maximum number of lights per chunk/quad is 3 for easy debugging. Set it to 8 for your game. Also you can jump super high so that you can see the ground from bird's eye view and place torches from there. Hope I did good with the comments.

Ok! I’ll look at it soon!

How's it going?

Good. I've looked at what you've done. It may take a bit for me to fully understand. It seems to be working the way I'd like. I'll need to look more into it.

I'm currently working with navmeshes and seeing if it's possible to rebake a navmesh at runtime to update when you add torches and stuff so AI will avoid new obstacles. I'm beginning to think that updating at runtime is not possible, though...

Yeah I saw your question about that. Too bad I don't have an answer.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.