Hi!
I’m trying to make a house with a basement. Unity version 2020.2.2f1. I created a terrain with a hole for the basement level. I used the built-in unity tools.
House and terrain marked as Static.
Also i used some emissive material and baked spot lights as indoor lighting. When i try to bake the light i get some artifacts.
Terrain still affects on indoor lighting, although basement terrain’s area is a hole. Also i got green reflections on the ceiling due to the terrain grass material.
When i uncheck Contribute Global Illumination parameter of the terrain, i get the result i wanted.
But I don’t want to turn it off, because the outdoor lighting will not be correct.
What i should to do to fix this?
P.S. Sorry for my english, I did my best)
Have you tried making the basement roof double-sided, perhaps a little thick, and underground?
Like this:

I thought about it, but it’s not quite what I need.
I solved the problem in a different way. First, I lifted up the terrain and house on some value. I used Set Height instrument of the terrain. Then I made a deepening for the basement. Like this:
You don’t even need to draw holes. Just a deepening. This solved all light baking problems.
Now the sea level will be different from 0, but it is not a problem. Unity cannot work with negative terrain heights, so we had to lift it up to make a deepening.
2 Likes
Thank you for taking the time to followup!!
There’s actually a solution for this too: numerically lift the ENTIRE terrain heightmap up some amount, then physically move the terrain object down… I do this automatically at runtime in my terrain deformer, so that even a flat terrain (all heights at 0.0f) can be dented downwards. I don’t save the results but you obviously would.
Relevant code (download the whole package to see it functioning):
https://bitbucket.org/kurtdekker/makegeo/src/master/makegeo/Assets/TerrainStuff/TerrainDamager/TerrainPreAdjustment.cs
It’s pretty trivial to just onetime lift the terrain, then lower it’s placement, but be sure you’re using source control in case something goes wrong and you need to revert the terrain!
1 Like
Hi, I had a problem very similar to yours; I posted yesterday on Unity forum the problem here: https://forum.unity.com/threads/help-about-lighting-through-hole-in-terrain.1171610/
And this morrning I thought to do exactly what you wrote in your post: create a deepening in the terrain instead than an hole: I don’t think it’s a solution, but just a workaround: however it can solv the problem.
I hope that Unity will solve the issue of lightmapping through holes, that I consider a bug.
You have to understand that the Unity system for creating holes in the terrain, is different from actually digging a hole by means of terrain tools (raise/lower terrain), which is essentially, altering the height map in a different way.
So each way will act differently, so test both, choose what works best…
1 Like