- Home /
Animation of terrain causes drastic performance drop (fps)
I have a scene in which there is a large terrain. On the parent node of this terrain is an animation component (NOT animator) which just plays a simple clip of the terrain moving up and down. The terrain is quite large but only 512 res. Basically the frame rate drops hugely as soon as the animation starts playing (from 150-200 down to around 40). I ran the profiler and It appears that UpdateDepthtexture, Drawing (highest is Render.OpaqueGeometry) and Culling (highest is Terrain.Heightmap.RenderStep3) take up most of the time when the animation is playing. The time they take drops as soon as the animation has ended. I know it is the terrain that is causing this because deactivating only the terrain allows the frame rate to stay high (and there are still other objects moving). I have tried turning off all lights in the scene in order to make sure lighting isn't causing an effect and it doesn't really help. I also made sure the terrain has no collider as well as other moving objects. I also replaced the animation component with a animation scrip I made that just manipulates the transform of the game object. However, this doesn't really seem to help. I'm really unsure of what else I can do to improve the performance without removing the terrain.
Edit So I exported the terrain as a mesh using this script: http://wiki.unity3d.com/index.php?title=TerrainObjExporter. The performance drop is completely eliminated when I then use the exported mesh in the scene rather than the terrain object. The only problem is that this exporter does not also export the texture of the terrain. Is there any better way of exporting the terrain or having unity treat the terrain as just a mesh?
Any ideas? I have included screenshots of the profiler whilst the animation is playing and stopped:
Your answer
Follow this Question
Related Questions
Simple Animation showing as ~6.3 in Xcode console profiler 0 Answers
Adding animation clips via script 2 Answers
Extremely poor Android performance, even in simple scenes 0 Answers
Unity3.4 Mobile Terrain Lag 1 Answer
Post Processing significantly reduces my frame-rate, what can I do to improve it? 0 Answers