- Home /
Is it possible to bake the lightmap projected shadows for an object without lightmapping that object?
Hello. I was wondering if it would be possible to bake the projected shadows for specific objects (on other objects) in a lightmap without lightmapping those objects (Avoid wasting space in the lightmap file for these ones).
I know that is possible to bake, remove the objects and place new No-Lightmappeed ones, but it will keep the old lightmap portions for the removed objects in the lightmap image.
I'm sure that there would be a better way to manage this. Right?
Thanks in advance.
Are you asking to remove the shadow caster or the shadow receiver from the lightmap? It's a bit hard to know from the way the question is written.
Hi, I apologize if I have not expressed it clearly. I'd like to remove the lightmap shadow receiver for an object. Is it possible?
Answer by MakeCodeNow · May 27, 2014 at 09:41 PM
You can remove any object from being lightmapped, but, well, then it won't be lightmapped. Lightmaps store the lighting information at specific points on specific objects, so you can't get the benefits of the shadow without paying the cost of the benefit. You can pre-bake shadowmaps and then use those at runtime, which a lot of AAA games do, but that requires a decent amount of knowledge to implement in Unity. Alternatively, if you know something is going to be in shadow you can remove it from the lightmap and just assign a dark material to it or something, but there's no built in auto-magic way to do that.
Thanks a lot for the answer, $$anonymous$$akeCodeNow. So, I guess the best option is to bake the entire scene (in order to get the projected shadows for all objects), remove objects that do not need to receive lightmapping on their faces and replace them with similar new no lightmapped objects in the same position. So, these objects will be not lightmapped but the shadows of the old ones will remain in the same place.
That will work but it won't save you any memory because lightmap space will already be reserved for the objects when you remove them. You would need to repack the lightmaps (hard). To be honest, unless you are desperate for the memory, this is probably a lot of pain for not much gain.
Great. You're right. I guess it should not be so bad to leave those unusable portions on the lightmap. Thanks a lot for the answer $$anonymous$$akeCodeNow.
Answer by topofsteel · Jun 06, 2014 at 08:14 PM
I believe if you set a static object's lightmap index to 0, it will be used in the lightmaping calculation but not receive lightmaps it's self.
Your answer
Follow this Question
Related Questions
Reflection probe baked shadows fails at 2K, but works at 1K 0 Answers
Baked + Real-Time Shadows 6 Answers
Trees have no shadows (baked shadow) 1 Answer
bake error 1 Answer