Occlusion Culling huge performance drop

Hi there. I am building a level that is a sci fi city and has many buildings and details. I managed to get it pretty optimised with atlasing and draw call optimisation. But since there are many objects I wanted to bake OC so they are not rendered. Well i did and i did it a lot of times but what it ends up doing is slow my performance instead of boosting it. Heres a profiler screen to show you just how bad it is.

http://img29.imageshack.us/img29/401/img10062013173506.png

And here is some of the city with culling http://img507.imageshack.us/img507/213/img10062013174930.png

While i was writing the thread i found out that most of the problems are caused by the terrain culling wich gets it to absurd ms values like 50 - 60ms.

I would appreciate it if some of you can shed some light on the situataion with OC

Cheers :slight_smile:

Yes, this is caused by the terrain culling. However, AFAIK, there is no way of disabling the terrain from being culled. Unmark it as static completely if you will, it will still be culled. Even if you disable the terrain during the baking, it will still be culled. I don’t know what can be done here.
My guess would be exporting the terrain as a mesh, but you will have a really hard time getting the texture data from your real terrain to your mesh.

The only thing i can think of as an alternative is to export and import the terrain as a mesh and then if i can figure out a way to apply the control texture so it looks the same it will proabably cull it without the CPU overhead.

http://video.unity3d.com/video/6394457/mesh-painting
You could probably use some mesh painting method like this one. I don’t know if this one is anywhere to be found for download, but got me interested.I don’t know if any mesh painting tool has been released at all. Another option would be to use a shader that uses a control texture and has several other texture layers which get blended according to the control texture.

Well since no seems to know, this is what i did to fix it by myself. I got T4M wich is a unity plugin that allows you to conver your terrain to a mesh or import custom meshes and still treat it as a terrain (paint it and plant vegetation) and so now i dont have the performance problems. I hope this is useful to someone who has that problem :slight_smile:

Would be no problem to match the texture data. Put a heightmapped object in your 3d suite and have it convert it to pure geometry, then simply apply a flat projected uv on it for it to align properly with the colormaps you have already made.