Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Shader changes in api 14x

Discussion in '2022.2 Beta' started by DEEnvironment, Apr 22, 2022.

  1. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    looking for Unity shader changes from api 12x into api 14x
    this is what i found so far

    HD/Lit

    -- removed _AlphaToMask and _AlphaToMaskInspectorValue

    Code (CSharp):
    1. /// [HideInInspector][ToggleUI]_AlphaToMaskInspectorValue("_AlphaToMaskInspectorValue", Float) = 0 // Property used to save the alpha to mask state in the inspector
    2. ///[HideInInspector][ToggleUI]_AlphaToMask("__alphaToMask", Float) = 0
    -- removed pragma for local _ALPHATOMASK_ON
    Code (CSharp):
    1. #pragma shader_feature_local _ALPHATOMASK_ON
    -- change in "WRITE_MSAA_DEPTH" no longer looks for "_ALPHATOMASK_ON", Alpha channel is used for alpha to coverage
    Code (CSharp):
    1.     // Depth and Alpha to coverage
    2.     #ifdef WRITE_MSAA_DEPTH
    3.     // In case we are rendering in MSAA, reading the an MSAA depth buffer is way too expensive. To avoid that, we export the depth to a color buffer
    4.     depthColor = packedInput.vmesh.positionCS.z;
    5.  
    6.     // Alpha channel is used for alpha to coverage
    7.     depthColor.a = SharpenAlpha(builtinData.opacity, builtinData.alphaClipTreshold);
    8.     #endif
     
  2. DEEnvironment

    DEEnvironment

    Joined:
    Dec 30, 2018
    Posts:
    437
    HD/Lit

    -- Unity added a new property for Alpha Remap exposed in surface inputs
    however only seems to only work when set in transparent type
    no idea why they did not put this with the alpha threshold under surface option for consistency

    Code (CSharp):
    1. _AlphaRemapMin("AlphaRemapMin", Float) = 0.0
    2. _AlphaRemapMax("AlphaRemapMax", Float) = 1.0

    from looking at this it may be working with perhaps a one minus / max ?
    do we know what script this is found in?

    my first try looks something like this ?
    upload_2022-4-22_0-0-32.png