{
    "Name": "uiPortal",
    "OverrideMaterial": "uiCALayer.rematerialdefinition",
    "Parameters": {
        "Constants": {
            "clearColor" : "[0, 0, 0, 1]",
            "colorMatchMatrix": "[1,0,0,0,1,0,0,0,1]"
        },
        "Textures": {
            "blurredColor" : "fallback.graySrgbArray",
            "VCABlurredColor" : "fallback.graySrgbArray",
            "backgroundTexture"  : "fallback.white"
        },
        "Samplers": {
            "backgroundSampler": {
                "BaseFilter": "BilinearClamp"
            }
        },
        "Buffers": {
            "rateMapData" : "fallback.zeros",
            "vertDistanceToPlatterEdge" : "geometry.vertDistanceToPlatterEdge"
        }
    },
    "Techniques": [
        {
            "Name": "StencilIncrement",
            "VertexShader": {
                "Entry": "vsIncrementStencil"
            },
            "PixelShader": {
                "Entry": "fsIncrementStencil"
            },
            "State" : {
                "ColorWriteMask" : "None",
                "AlphaBlend" : false,
                "WriteDepth" : true,
                "DepthCompareFunction" : "Greater"
            },
            "FunctionConstants" : {
                "EnableClipping"                 : "false",
                "EnableDitherFade"               : "false",
                "EnableBtMask"                   : "false",
                "EnableSpatialFocus"             : "false",
                "RenderForBlur"                  : "false",
                "EnableNearFieldVignetting"      : "false",
                "DitherRange"                    : "0.01"
            },
            "Variations" : {
                "EnableClipping"  : ["true", "false"],
                "EnableDitherFade"  : ["true", "false"],
                "EnableBtMask"  : ["true", "false"],
                "EnableSpatialFocus"  : ["true", "false"],
                "RenderForBlur"  : ["true", "false"]
            },
             "RuntimeFunctionConstantDefaults" : {
                "EnableClipping" : "true",
                "EnableDitherFade" : "true",
                "EnableBtMask" : "true",
                "EnableSpatialFocus" : "true",
                "RenderForBlur"         : "false",
                "EnableNearFieldVignetting" : "false"
            },
            "SupportsRuntimeFunctionConstants" : true
        },
        {
            "Name": "DepthBufferClear",
            "VertexShader": {
                "Entry": "vsUnlit"
            },
            "PixelShader": {
                "Entry": "fsClearDepthWithColor"
            },
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : true,
                "DepthCompareFunction" : "Always"
            },
            "FunctionConstants" : {
                "EnableUnlitTexture"             : "true",
                "EnableSRGBToLinearConversion"   : "true",
                "EnableVertexColor"              : "false",
                "EnableOpacityMap"               : "false"
            }
        },
        {
            "Name": "DepthBufferClearBlur",
            "VertexShader": {
                "Entry": "vsRealityPbr"
            },
            "PixelShader": {
                "Entry": "fsClearDepthWithBlur"
            },
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : true,
                "DepthCompareFunction" : "Always"
            },
            "FunctionConstants" : {
                "EnableVCABlurPlane"             : "true",
                "EnablePassthroughBlurPlane"     : "true",
                "EnableUnlitTexture"             : "false",
                "EnableSRGBToLinearConversion"   : "false",
                "EnableVertexColor"              : "false",
                "EnableOpacityMap"               : "false",
                "EnableVRROnCapableDevice"       : "false",
                "EnableUserEnvironment"          : "false",
            },
            "Variations" : {
                "EnableVRROnCapableDevice" : ["true", "false"]
            },
            "RuntimeFunctionConstantDefaults" : {
                "EnableVRROnCapableDevice" : "true"
            },
            "SupportsRuntimeFunctionConstants" : true,
            "Tags" : {
                "VCABlur" : "True"
            }
        },
        {
            "Name": "DepthBufferClearNoColor",
            "VertexShader": {
                "Entry": "vsDepthClear"
            },
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : true,
                "DepthCompareFunction" : "Always"
            }
        },
        {
            "Name": "TransparentUI",
            "InheritState" : true,
            "State" : {
                "DepthCompareFunction" : "Always",
            },
            "FunctionConstants" : {
                "EnableOpacityThreshold"                 : "false",
                "AllowAlphaBlendingWithOpacityThreshold" : "false",
                "IsPtSurface"                            : "true",
                "EnableAlphaWhenDithered"                : "true",
                "EnableDepthMitigation"                  : "false",
                "DitherRange"                            : "0.01"
            },
            "Variations" : {
                "EnableDepthMitigation"  : ["true", "false"],
            },
             "RuntimeFunctionConstantDefaults" : {
                "EnableDepthMitigation" : "true",
            }
        },
        {
            "Name": "TransparentUIWithNoColor",
            "InheritFromTechnique": "TransparentUI",
            "InheritState" : false,
            "State" : {
                "DepthCompareFunction" : "GreaterEqual",
                "WriteDepth" : true,
                "ColorWriteMask": "None"
            }
        },
        {
            "Name": "DepthBufferPatchAndStencilDecrement",
            "InheritFromTechnique": "StencilIncrement",
            "State" : {
                "WriteDepth" : true,
                "DepthCompareFunction" : "Always",
                "RenderAttachmentState" : [
                    {
                        "AlphaBlend"                : true,
                        "AlphaBlendOperation"       : "Add",
                        "AlphaSourceFactor"         : "Zero",
                        "AlphaDestinationFactor"    : "SourceAlpha",
                        "RgbBlendOperation"         : "Add",
                        "RgbSourceFactor"           : "Zero",
                        "RgbDestinationFactor"      : "SourceAlpha"
                    }
                ]
            },
            "FunctionConstants" : {
                "EnableAlphaWhenDithered"        : "true",
                "EnableDepthMitigation"          : "false",
                "DitherRange"                    : "0.01"
            },
            "Variations" : {
                "EnableDepthMitigation"  : ["true", "false"],
            },
             "RuntimeFunctionConstantDefaults" : {
                "EnableDepthMitigation" : "true",
            }
        },
        {
            "Name": "DepthBufferPatchAndStencilDecrementWithNoColor",
            "InheritFromTechnique": "DepthBufferPatchAndStencilDecrement",
            "InheritState" : false,
            "State" : {
                "DepthCompareFunction" : "GreaterEqual",
                "WriteDepth" : true,
                "ColorWriteMask": "None"
            }
        },
        {
            "Name": "DepthBufferPatchAndStencilDecrementNoFragmentFunctionTechnique",
            "VertexShader": {
                "Entry": "vsIncrementStencil"
            },
            "State" : {
                "WriteDepth" : true,
                "DepthCompareFunction" : "Always"
            },
            "FunctionConstants" : {
                "EnableAlphaWhenDithered"        : "true",
                "EnableDepthMitigation"          : "false"
            },
            "Variations" : {
                "EnableDepthMitigation"  : ["true", "false"],
            },
             "RuntimeFunctionConstantDefaults" : {
                "EnableDepthMitigation" : "true",
            }
        }
    ],
    "TechniqueMapping": {
        "StencilIncrement": "StencilIncrement",
        "DepthBufferClear": "DepthBufferClear",
        "DepthBufferClearNoColor": "DepthBufferClearNoColor",
        "DepthBufferPatchAndStencilDecrement": "TransparentUI",
        "DepthBufferPatchAndStencilDecrementNoFragmentFunction": "DepthBufferPatchAndStencilDecrementNoFragmentFunctionTechnique",

        "FadeDepthPrepass": "TransparentUIWithNoColor",

        "Transparent": "",
        "TransparentOverdraw": ""
    },
    "TechniqueMappingOverrides": {
        "Fade": {
            "FadeDepthPrepass": "TransparentUIWithNoColor",

            "Transparent": "",
            "TransparentOverdraw": ""
        }
    },
}
