Search Unity

What is Density map in a terrain?

Discussion in 'High Definition Render Pipeline' started by mrtkhosravi, Oct 7, 2019.

  1. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    I'm creating terrain layers in a HD project. Manual says this about diffuse texture in a HDRP setting:

    the High Definition Render Pipeline (HDRP) uses the Alpha channel for Smoothness. However, if there is a Mask Map Texture on the Terrain Layer, it uses the Alpha channel of the Diffuse Texture for Density values.

    I use mask but I don't know what Density values refers to.

    EDIT:
    Found this thread for the same question but the answers given make no sense. According to Unity devs density map is for layered material setup. But I can't understand what material layer has to do with terrains since TerrainLit shader is not a layered shader anyway.

    In any case is it okay to leave it and just an RGB texture instead with no alpha to save memory?
     
    Last edited: Oct 7, 2019
  2. FunJumpr

    FunJumpr

    Joined:
    Oct 17, 2019
    Posts:
    3
    In the new HDRP rendering pipeline the terrain uses the new Layered Lit shader that allows you to stack several materials into one. The Density Map can be used to mask off a particular layer to just the parts of the texture you want to show through. So say you want to be able to add footprints to areas of mud without it being a feature already included in the mud tile. You can add a new material layer and mask off just the footprint and paint that on top. With just a single terrain material and splatmap you would have to try to do it by using the brush opacity to only paint the footprints parts of the texture.

    And yeah If you don't have an alpha channel it just shows the whole texture as normal.
     
    pachermann and mrtkhosravi like this.
  3. mrtkhosravi

    mrtkhosravi

    Joined:
    Nov 9, 2014
    Posts:
    198
    Thank so much for the info.
     
    pachermann likes this.