Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

Feature Request Lit Shader Channel Packing Height Map

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

  1. Ferazel


    Apr 18, 2010
    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.).

  2. burningmime


    Jan 25, 2014
    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


    Oct 8, 2013
    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.