Search Unity

unity terrain / size of auto-generated RenderTexture/Normalmap

Discussion in 'World Building' started by burk0v, Jul 12, 2020.

  1. burk0v

    burk0v

    Joined:
    Apr 23, 2019
    Posts:
    2
    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?
     
  2. Deleted User

    Deleted User

    Guest

    So, you want a 20X20 landsape with 40,960 total resolution? with unity? in real time?

    buy something that has done the work for you..World Streamer (50% off)
     
  3. burk0v

    burk0v

    Joined:
    Apr 23, 2019
    Posts:
    2
    "So, you want a 20X20 landsape with 40,960 total resolution? with unity? in real time?"

    thx for your reply! although I can understand your concerns, the answer is yes :)

    as mentioned, the whole thing is already running very satisfactorily. the only wish would be to reduce the ram consumption. since i'm not dependent on the game running on old, inefficient devices or mobile devices, it's actually already ok the way it is (for me). But since I end up with just over 16GB of Ram, it would be great if I could push it a bit more, without increasing complexity.

    in order to maintain the current quality level and requirements i would need to leave at least 10x10 chunks visible & loaded all the time.

    can this be done with worldstreamer? if so, I will definitely have a look at it.