- Home /
Is Lightmapping possible, if object and light are moving equally (for example interior light of a car)?
Lightmapping is used for static objects like houses or lanterns :). If objects are moving one should not bake them into a lightmap. But is this right, if an object is moving and its light is moving equally (parent-child-relation). Imagine for example the interior lighting of a moving car.
Is it possible/ useful/ performance optimising to bake such lights? Or is it not possible to bake any lights that are moving?
Thank you for your help.
Here is an example image of a real car to explain what I mean.
Answer by vagos21 · Mar 25, 2013 at 06:05 PM
baking lights is like setting a texture to a mesh, and from your perspective since that light is completely static compared to the car, yes you can bake it. but what you can also do if you want some realistic lighting, is to bake your vertex colors in your mesh and use them in a shader to create some nice shades, if that's what you're after. i see your car is quite high-poly on interior, so i think vertex colors would work great on this case, would even look better than lightmapping, and you could still be doing realtime reflections on the shiny dashboard and so on :)
Thank you vagos21. The image above is just a random example image to show what I mean.
@topic: Your answer clarifies lightmapping and I do now know what it means and that I am able to use it. One additional question: What happens, if the light will be switched off? Will the shadows remain?
@ vertex colors: What kind of shader do you use in that case?
are you using Unity 3.5 or 4? for Unity 3.5 i used the Strumpy shader editor http://forum.unity3d.com/threads/56180-Strumpy-Shader-Editor-Now-Open-Source to easily create your own shaders in the blink of an eye with any textures and properties you like. Unfortunately i have unity4 now and the shaders are broken for this version so i can't make one for you... but i can help you if you want more details. Can you export your mesh from your 3D package containing baked vertex colors from Ambient occlusion?