- Home /
Manually Recalculating Lights?
Hey all.
I'm making a voxel engine. And I'd love to be able to use point lights in it, because I feel it would look a lot better than blocky voxel lighting (especially with Unity 5's graphics features coming up). I understand that Minecraft does smooth lighting with efficient voxel lighting, but I have not a clue how. (I mean, I've only been programming for about half a year, I'll get there eventually...)
So I'd love to use point lights. The problem is, they're far too expensive given the player could place a huge amount of them in the scene. The reason they're so expensive seems to be that they're constantly recalculating their lighting dynamically every frame for each mesh they influence.
Is there ANY possible way to manually recalculate the lighting such that they maintain the light they had from the last calculation until I decide to recalculate the lights? I've done a lot of research and haven't found any way to do this, but maybe someone knows a trick that I don't know of.
Also, what about light probes? I'm not entirely sure how those work. Would those work to solve a problem like this?
Thank you.
You can try adding a layer wich is not affected by lights and when you want render, you change the layer. http://docs.unity3d.com/ScriptReference/GameObject-layer.html
So if I switched the layer, let the rendering happen, then switched back, would the lighting from the calculations be maintained after changing back?
About the light probes, as far as i know they are not dynamic. Basically, you bake area brightness info in them. They retain information on what the brightness is around them and change the light on the meshes that enter their area of influence.
Ah, so introducing one into the scene at an arbitrary place wouldn't work then. Because in that case they wouldn't know the brightness around them until being placed, so it couldn't be 'baked' in... darn.