- Home /
Using all scene objects to generate lightmap, but only applying lightmap to certain objects
I have a forest scene where I want to compute a lightmap for the ground which catches all the shadows from the trees, but I don't want to apply a lightmap to the trees themselves since I've used some texture from my trees with baked in shadow detail already. Is there a way to calculate a lightmap for the ground using the trees but have the trees not lightmapped?
I tried deleting all the lightmaps from the scene except the one for the ground to no avail. Is there a way to turn off lightmapping on a per object basis after the lightmap is baked?
Answer by Paulius-Liekis · May 22, 2012 at 07:16 PM
Do this: renderer.lightmapIndex = 255; for the objects that you don't want to be affected by lightmaps.
Answer by quitebuttery · Jun 24, 2012 at 01:18 AM
What if I turn off "receives shadows" in the mesh renderer. Does the lightmapper look at those settings when computing the lightmaps?
Answer by sathya · Aug 07, 2012 at 11:46 AM
uncheck "static" from all the trees once baking is done. not sure whether it works. give a try.
Your answer
![](https://koobas.hobune.stream/wayback/20220613071732im_/https://answers.unity.com/themes/thub/images/avi.jpg)