Custom lightmaps?

how are lightmaps applied onto objects? they dont seem to be part of the normal shaders or?

Are they projected like Projector/Lightcookies? whats the performance penality for using them compared to Lightcookies that makes the pixelshaders go nuts?

I have a webplayer, the scene is empty by default, but when a user addes objects. Lets say a cube. I would like to prerender a new lightmap serverside, and then load the texture or Lightmap. It doesnt have to be the Beast lightmap quality, I am just trying to figure out how the lightmap textures are applied and if there is a penality somehow.

Download the “buildin_shaders” and look for “Lightmap-*.shader”.
These are Unity “Surface Shaders” which use code gen processing to build the actual vertex and fragment shaders at runtime.

One thing about batching that I’ve noticed: Unity will not batch multiple meshes with different lightmap indices. So I’ve noticed it is best to use the largest lightmaps you can and to use the “Scale In Lightmap” parameter in Lightmapping → Object.