Hi!
i have created a large landscape from about 400 terrain chunks. each chunk consists of a 2049*2049px elevation map. to save performance all chunks which are not in sight of a camera are put on castshadows.shadowsonly. this works fine and smooth, but the landscape uses too much memory for most systems. according to the profiler the 8mb-heightmap is loaded as render texture into the ram (3,2GB). in addition, Unity automatically generates a normalmap per chunk as RenderTexture (21mb) and writes it into the ram (8.4GB). these RenderTextures are permanently in the ram, no matter whether the corresponding chunks are visible or not.
originally i wanted to disable invisible terrain chunks completely to free up the ram, but the operation is too expensive during runtime. now i’m looking for a way to compress/optimize the automatically generated normalmap, but failed until now.
is there a way to minimize the size of these auto-generated normalmaps or manually remove invisible normalmaps from memory once the corresponding chunk is no longer visible for the camera?