Search Unity

Question [SOLVED] Custom Passes for Unity Terrain

Discussion in 'High Definition Render Pipeline' started by Bordeaux_Fox, Jul 22, 2020.

  1. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Hi,

    how can I make Custom Passes make affect Unity Terrain?

    Thanks. :)

    EDIT: The solution is to disable "Draw Instanced" in the Terrain Settings.
     
    Last edited: Jul 24, 2020
    umarali_43 and valarnur like this.
  2. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
  3. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    265
    Hello,

    Is it possible to have more detail about your issue?

    The FullScreenPass affects the color buffer so the terrain is included as long as it's visible on the screen and from what I tested on terrain with DrawRenderers pass, it works correctly.
     
  4. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Hm, the Custom Pass does not affect my terrain. Only meshes with Lit shader or my custom graphs.

    About my shader: I take the HD scene color node, apply my filters and add triplanar mapped texture onto it.
     

    Attached Files:

  5. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    265
    I tried to replicate your setup but it works for me:


    Here's the ShaderGraph I'm using:
    upload_2020-7-24_17-27-2.png

    Are you using the builtin unity terrain?
     
    valarnur and Bordeaux_Fox like this.
  6. Bordeaux_Fox

    Bordeaux_Fox

    Joined:
    Nov 14, 2018
    Posts:
    589
    Hi, thanks for the reply, that looks interesting!

    Yes, Unity terrain is used. We are on Unity 2019 LTS and HDRP 7.4.1.
    I see you're using Unity alpha. Could it be it does not work with our version?

    EDIT: Ok, I found out, when "Draw Instanced" is enabled on Terrain, Custom Passes will not work. :eek:
     
    Last edited: Jul 24, 2020
    umarali_43 likes this.
  7. antoinel_unity

    antoinel_unity

    Unity Technologies

    Joined:
    Jan 7, 2019
    Posts:
    265
    Indeed, I managed to repro as well, I'll add this to the list of things to fix, thanks for investigating the issue :)
     
    umarali_43 and valarnur like this.
  8. chiu_1985

    chiu_1985

    Joined:
    Jul 22, 2021
    Posts:
    2
    this issue still can be found on Unity 2020.3.18, when "Draw Instanced" is enabled on Terrain, Custom Pass will not work.
     
  9. stevphie123

    stevphie123

    Joined:
    Mar 24, 2021
    Posts:
    82
    is there any workarounds for this?
     
  10. Genebris

    Genebris

    Joined:
    Mar 18, 2013
    Posts:
    144
    Hate to repeat old post, but has anyone found any workaround? The issue is still there in 2022 LTS.