Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity Terrain Optimization on PS4

Discussion in 'World Building' started by Trebuchet_Boris, Nov 2, 2020.

  1. Trebuchet_Boris

    Trebuchet_Boris

    Joined:
    Nov 2, 2020
    Posts:
    2
    Hello,

    We are experiencing issues rendering our terrain in reasonable time on PS4 and we would like to request your help on the matter.

    A few things about our project :
    * It is a VR Game targeting the PS4 (We have been redirected here from the Unity team on the DevNet forums)
    * We are using the default Unity Terrain
    * It is an open world with a single big terrain of 3000 * 3000 unity distance units
    * We are using the MapMagic plugin to design and edit the terrain
    * We are using 8 terrain layers which translate to 2 splatmaps and 2 render passes
    * It seems that all of the terrain is rendered on each frame

    Optimizations that we have thought about and or tested:
    * Splitting the terrain into multiple tiles:
    -> requires a lot of work for uncertain gain at this stage of development, on hold
    * Using the Microsplat plugin to render the terrain in one pass with the fewest texture read as possible:
    -> positive early results, needs more work

    The main question is:
    Is there a better terrain renderer with good PS4 performance that we could switch to?

    Any help that you could provide will be greatly appreciated.
    We'll be happy to provide GPU traces if you think nothing of scale can be done and we need to optimize it as is.

    Thanks in advance,

    Boris
     
  2. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,105
    The things I've done with success on console:
    1. isolate what's slowing down - some consoles struggle with culling because their cpu is from the 80s but are fine with GPU load except that due to shared memory you have a finite amount of bandwidth to contend with so textures had to be compressed a lot, @jbooth knows more about this
    2. switched to Draw Instanced was a 2x gain
    3. baked occlusion worked insanely well in this level that had tall occluders. Mountains? I'd do that
    4. baked horizon, this requires sliced terrain, there are asset to automate all that
    5. brutally increase pixel error when framerate drops, that's done off your performance controller
    I'm sure you've done all that so I be lurking.
     
  3. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,457
    Well since I was summoned. There's an optimization guide in the MicroSplat docs folder which will give you information on optimizing terrain and MicroSplat's shaders. The key is knowing where your bottlenecks are, GPU or CPU, and if GPU what is it actually bound on? With 8 terrain layers, MicroSplat will use less than half the memory bandwidth of the Unity terrain shader, and execute everything in one pass instead of 2, so that should be a pretty big savings.
     
  4. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    591
    Lauren and Jason have pretty much covered everything here, but to expand on the isolation.
    It can be super key here, since the PS4 GPU doesn't like overly complicated code being shoved it way, you can work from your basic terrain, adding what "features" you have have included, and see if you have performance alternatives, such as Occlusion culling (PS4 hates it on terrains) Vs Async loading segments (higher potential mem but potentially lighter at one time load on the GPU)

    It's really hard to tell with unity terrain what actually affects it sometimes.

    Also grab the GPU/ CPU profiler from DevNet if you haven't already, since you'll be able to profile target systems too, prior to brining it onto you test/Dev kits