I’m trying to create a lightmap for my terrain with trees on it. All settings are set to default. Terrain and lightsource (directional) are static. While objects (including the terrain it self) cast shadows as usually, all trees on the terrain do not. Also the light probes appear to be not applyed on the trees in oposite to realtime-mode.
I’m using Unity 5 and standart assets only. Any ideas?
For the time being, I have made this quick workaround:
- Turn OFF drawing Trees & Details in the settings tab of the Terrain object
- Run the editor script. It creates real instances of the tree prefabs with the exact same Transforms as the internal tree instances of the Terrain. This can be a LOT of meshes!
- Bake the lightmap. Grab a coffee.
- Finally, throw away the generated geometry and turn Trees & Details drawing back ON in the Terrain settings.
And a year later, in v5.6, this remains broken…
I’ve been testing the new distance shadowmaps and the work beautifully! But, seriously, we still can’t bake shadows with terrain instanced trees?
Dear Unity, please stop developing new features and finish those on which we depend. Thx.
Currently in Unity5 you can not bake the shadow of Terrain trees onto the light-map.
Its a currently missing feature that Unity Technologies is trying to make it available as fast as possible.
I can’t speak to the validity of the Mar 13 answer, but as of 5.2 I placed some terrain trees, let my GI jobs run and I have shadows.
Bump on this issue. I cannot get shadows from trees to bake on ANY terrain in Unity 5.3.2p3. Has anyone been successful in Unity 5???
guess what they didnt fixed that in 2018.3 with their new terrain system
Can we have shadow now ? Its look bad without
I was able to use your script, set terrain and tree to static, bake it, still no shadow
White bark are tree shadow caster, and colored are terrain tree
I was also struggling to find the way, it’s very easy! Do the following steps:
Mark the tree you painted as “Contribute GI” or “Static”.
Go to the terrain settings of your terrain on which you want to bake lighting.
Tick these 3 options under Tree & detail objects : Bake Light probes for trees, Remove light probe ringing, and the most important Preserve tree prototype. The last one is the most important one. If that’s turned off, no tree would be contributed in Global Illumination.
Choose a good resolution for the lightmap according to your scene.
BOOM! Trees were also contributed in GI, giving you baked shadows.
This is still an issue xD I cannot bake trees on terrain in 2020.3.24. I need to use this workaround Thanks
Thank you so much @tanmaykulkarni This worked. I think you also have to have your tree prototype that you are painting on the terrain set to Contribute Global Illumination. I’ve been looking for an answer for this for a long time.
,Thank you so much tanmaykulkarni This worked. I think you also have to have your tree prototype that you are painting on the terrain set to Contribute Global Illumination. I’ve been looking for an answer for this for a long time.