Search Unity

Question Only 4 terrain layers working as expected

Discussion in 'High Definition Render Pipeline' started by sniffle63, Apr 19, 2023.

  1. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    Hello, for some reason all my terrain layers after the fourth layer are showing up black.
    It works fine in the editor, but once I build it out and put it on the cloud, and then download it, only 4 layers work.

    If I delete one of the working layers at runtime, the first black layer will look normal again. I feel like I have some settings set or something but have spent 10 hours a day for 4 days now trying to figure it out and am at a loss

    Unity: 2021.3.20f1
    HDRP: 12.1.10

    This is what it should look like
    upload_2023-4-19_13-9-14.png


    This is what it looks like
    upload_2023-4-19_13-11-29.png
     
  2. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    Heres a GIF of me removing a layer and the other layer showing up
     

    Attached Files:

  3. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    Couldn't figure it out so just installed microsplat.

    If anyone ever figures out why I can only use 4 terrains instead of 8 that would be great tho.
     
  4. ShilohGames

    ShilohGames

    Joined:
    Mar 24, 2014
    Posts:
    3,023
    I have not seen that happen with 4 textures. I have definitely run into the 8 terrain texture limit, though. In my case, trying to use a 9th terrain texture caused the entire scene to render completely black, not just the painted terrain. The 8 terrain texture limit is far too low for any real game, so I installed Microsplat. Has anybody built a cool HDRP game without Microsplat?
     
  5. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    @sniffle63 hey

    What's it like when you try and build play with only 4 textures?

    Also when you say download from cloud, are you uploading the build to play on WebGL? If so that might be a limitation, if not, have you tried just running it locally

    @ShilohGames to avoid any confusion, just an FYI HDRP uses 4 tiles in a single pass and an extra 4 for a second pass to make a total of 8 textures. However this is per tile not per project, you could still have 4 terrains with 32 textures of you want, you just need to balance the memory consumption.
     
  6. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    Everything works fine with only 4 textures, adding a 5th draws that texture as black. Removing any texture before the 5th will fix the 5th one. Works fine in editor.

    Hosting on S3 and downloading with addressables, is a PC build.
     
  7. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595

    How bizarre, I don't even think you can turn off the second terrain pass even in the HDRP asset.

    Does it happen in a clean project same editor version too?
     
  8. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    I do not believe I have the same problem in a clean unity project. Would have to double-check.
    The only thing I can think of that has happened recently is upgrading from unity 2020 to unity 2021 LTS, but hard to say if that is when it started.
     
  9. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    Noticed today, it happens in HDRP and URP. Verry odd
     
  10. HIBIKI_entertainment

    HIBIKI_entertainment

    Joined:
    Dec 4, 2018
    Posts:
    595
    Interesting indeed. It's worth noting that upgrades can certainly cause quirks. What I was just thinking is that perhaps upgrades haven't updated the SRP. Versions too, you could whether those version have updated to their respective version for your target editor version too.

    Finally another thought, the Terrain material is related to the SRP version, if you created a new terrain it'll load the version shader, which can be cloned if you need control, it may well be that the upgrade, may have kept older terrain shader instances for some reason
     
  11. sniffle63

    sniffle63

    Joined:
    Aug 31, 2013
    Posts:
    365
    very interesting, I will have to check and see if that could be the issue. Either way, useful info. Thanks!
     
    HIBIKI_entertainment likes this.
  12. NikoVReality

    NikoVReality

    Joined:
    May 17, 2022
    Posts:
    9
    Hello, has anyone solved the issue?
    I've noticed the issue in VR, when I had different texture colors in left and right eyes (brighter and darker, that makes you sooo dizzy, not even possible to look at the terrain where they painted), was pulling my hair and finally found out - it only happens with 5+ texture layers (as mentioned only 4 layers work as expected). I found this thread, and see it's a known issue. I'm using 2022 URP. What's the solution??