Search Unity

Question How can i prevent terrain details from drawing inside my vehicles

Discussion in 'High Definition Render Pipeline' started by Homicide, Oct 2, 2022.

  1. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    Hey guys, im entering the art and polish stage of my little driving game, but i have hit a snag i just dont understand. Render draw order / depth. In the old pipeline, this was easy peasy (though i have read that us camera stackers most definitely arent 'doin it right', im fine with that, im no pro.), and i imagine it probably is easy in HDRP, if you know how. Sadly i do not. I have read over the material sorting, and renderer sorting (which seems to rely on the assigned materials, and is not actually just a renderer explicit order.)

    Long to short is, my terrain grass is constantly coming into the vehicles. The vehicles are made of many parts, and definly do not use all transparent materials, nor should they have to use all transparent materials i would hope, but i did try to set all my materials to transparent and order them, but that only really worked well if viewing from inside the car, the moment i jump to outer view, its a mess.

    I keep coming across 'Custom Pass' articles that seem to be touching on the subject of depth/ draw order, but i have not been able to make sense of any of it yet, in relation to my goal. Im hoping some good samaritan might be able to drop a little insight my way. How can i go about ensuring my vehicle is not having terrain details in it.?

    Thanks. J.D.
     
    soleron likes this.
  2. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    I'm pretty much a beginner myself, but I have dealt with this issue somewhat. Perhaps make a layer specifically for the car GameObjects, and then make a custom pass that renders that layer after post-process. I can post a screenshot of one that I have, if that helps.
     
    Homicide and soleron like this.
  3. Homicide

    Homicide

    Joined:
    Oct 11, 2012
    Posts:
    657
    Hmm, im still unclear on the custom pass and set up, but, i question if it renders after Post Process, would that not in turn affect the bloom used on vehicle lights? Ultimately negating the fx on the vehicle?

    But yea, a screenshot of the pass properties and setup might help. as i have tried using a custom pass, and it does nothing (with my settings), which im sure are wrong..


    EDIT:

    AH HAH! Thanks mate, a little tinkering and i got 'er working using your propsed setup. Cheers.
     
    Last edited: Oct 8, 2022
  4. mike11986

    mike11986

    Joined:
    Jul 23, 2018
    Posts:
    24
    Excellent! I'm glad my limited knowledge was enough. I'm very used to collaborating by throwing out a few ideas or receiving a few ideas and it being enough to get a solution between a few people.