Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Feature Request Lit Shader Channel Packing Height Map

Discussion in 'Universal Render Pipeline' started by Ferazel, Nov 19, 2021.

  1. Ferazel

    Ferazel

    Joined:
    Apr 18, 2010
    Posts:
    517
    I saw that the default lit shader does support channel packing. Which is good! The problem is that for some reason the channel packing is not as optimal that is could be. Is there a reason why the default lit shader doesn't use the Blue channel for the height/parallax map so that we can combine more of the shaders together into a single texture?

    A better option would be to somehow specify which channel we have encoded to each of these maps, but I'll take a hard-coded value for now. Yes, I could write our own shader, but there are a lot of other benefits to using the default lit shader (it's the default, has checkboxes for reflections/specular, additional maps, etc.).

    upload_2021-11-19_12-57-7.png
     
  2. burningmime

    burningmime

    Joined:
    Jan 25, 2014
    Posts:
    845
    Maybe it's to maintain HDRP compatibility? HDRP uses blue for the detail mask. Which begs the question as to why URP doesn't do that and uses mask alpha instead.
     
  3. rz_0lento

    rz_0lento

    Joined:
    Oct 8, 2013
    Posts:
    2,361
    I'd say it's more of a legacy reason rather than mimicking what HDRP did.

    Some may be surprised that built-in standard shaders have supported this style channel packing since Unity 5 released. It has clearly not been obvious to users as most of the assets prepared for Unity seem to use separate files for occlusion textures (altho granted separate files do allow you to use different texture settings).

    If you hover over built-in Standard shader's inputs, you'll see this on metallic:
    "Metallic (R) and Smoothness (A)"

    and this on occlusion:"
    "Occlusion (G)"

    Why they never used blue channel properly on Unity standard shaders or in URP stock shaders is still a mystery for me, at least HDRP mapped that mask map for it.

    In general you are pretty much forced to author custom SG or do the remapping on modified Lit shader yourself if you need fancier packing setup.
     
    burningmime likes this.