- Home /
specify a prebaked lightmap for a mesh
Hi, Let us assume a mesh with mesh renderer attached to it.
In editor,We will bake the light multiple times. Each time, lightmap will be different as surrounding objects will be different(number,position, orientation, rotation, scale etc) each time. Then there will be a public array(of type lightmap?!) on a script attached to a gameobject(not necessarily this gameobject). There, we will assign our lightmaps to that array.
[Remember: the lightmap is not for a whole scene, rather for a mesh.]
On runtime depending upon logic, I will choose a lightmap for "this" mesh, from "that array".
Can this be done? If yes, how?
Why I need this: A gameobject's light information will change on runtime. Due to performance reason I can not afford realtime lighting. Now you got it, all.
Pardon my ignorance. Unity's lightmap is per scene basis, not per object basis. Guess I have to find some way to bake the lightmap to a texture for a mesh, then.
Your answer
Follow this Question
Related Questions
Lightmap uv's are stacked after running Mesh.CombineMeshes 1 Answer
How to light map (bake) lightning? 0 Answers
Issue with baked lighting on build 1 Answer
Bake Indirect mode is not working 0 Answers
Pre baked shadows in Unity 5?? 1 Answer