Hello, I am creating a game with a built in level editor and am trying to add lamps while the game is running, but Blender doesn’t seem to normally support this, every time I add a new lamp object, either through and add object actuator or python .addObject(), it just moves the already created lamp to where the new one should be added. Does anyone know a way around this, or is this a limitation of that engine? Thanks for any help!
You’ve got it. Its the way blender deals with compiled shaders.
What you can do is to have a stack of them, and only allocate them to the ones closest to the viewer. In fact, i’ve been working on a system for this, which can be seen a couple threads back in thus forum.
Ok, thanks. That sucks that it’s so difficult to do. I will probably end up using your system, or taking some inspiration from it for my game.
Before you request it to someone like Moguri, do note that this is not going to be a trivial thing to solve in the source if you don’t want things slowing down with the shader recompiling whenever a lamp is created. It’s not requiring that last part that is quite tricky, and is not something that can be fixed in an hour.
I was not planning on requesting a fix for it, I assume that if it was easy to do someone would have done it already. Would be nice if it was changed sometime in the future, but my game can live without it for now.