pokepetter / ursina

A game engine powered by python and panda3d.
https://pokepetter.github.io/ursina/
MIT License
2.23k stars 326 forks source link

PandaPointLight limit ? #587

Closed ursinaguy closed 10 months ago

ursinaguy commented 1 year ago

I am using PandaPointLight() function to generate lights in a for loop for my randomly generated map then append every light to a list the length of the list is 25 but the scene seems to only have 7-8 lights I dont know whether this is a bug or there is a light limit . Your help is appreciated

pokepetter commented 10 months ago

There is a limit for sure, there usually is with forward rendering. It's often 4 or 8 in most game engines I've seen. A way around it is to use deferred rendering instead of forward, but ursina doesn't support that and it comes with it's own set of issues, including worse performance if you're not using many lights. The best option, if possible, would be to bake the lights. That way you could have as many static lights as you want, and even make have bounce light and look realistic. Downside of course is that you they'll have to be static and not move. You can bake lights in Blender.