{
    "Name": "CustomUICALayer",
    "ProfilingCategory": "CARE",
    "OverrideMaterial": "engine:pbrCommon.rematerialdefinition",
    "Parameters": {
        "Constants": {
            "colorOutline"          : "false",
            "tintContent"           : "false",
            "visualizeFovea"        : "false",
            "visualizeOverdraw"     : "false",
            "visualizeMips"         : "false",
            "visualizeTextureDerivative" : "false",
            "visualizeRateZones"    : "false",
            "visualizeOpaqueLayers" : "false",
            "visualizeTransparency" : "false",
            "visualizeNormal"       : "false",
            "visualizeDistanceToPlatterEdge" : "false",
            "visualizeOverP3"       : "false",
            "visualizeEdgeAAStrength" : "false",
            "visualizeEscapedLayer" : "false",
            "visualizePreSamplerDegamma" : "false",
            "enableFading"          : "false",
            "textureRange" : "[0, 0, 1, 1]",
            "tilePadding" : "[0, 0]",
            "mainLightDirectionAndSpecularExponent" : "[1, -0.8, 0.1, 8]",
            "mainLightSpecularStrength" : "0.6",
            "fillLightDirectionAndSpecularExponent" : "[-0.6, 0.6, 0.1, 12]",
            "fillLightSpecularStrength" : "0.4",
            "sheenMultiplier" : "0.0",
            "sheenFalloff" : "30.0",
            "specularStrength" : "0.75",
            "fakeFresnelStrength" : "0.12",
            "fakeFresnelMaxDist" : "0.005",
            "fakeFresnelFalloff" : "2.0",
            "specularFadeoutSpeed" : "1.25",
            "inverseColorMatchScale": "[1,1,1]",

            "inverseWorldTransform" : "[1,0,0,0,1,0,0,0,1]",
            "recessedMaterialCornerRadius" : "0.4",
            "recessedMaterialWidth" : "1.0",
            "recessedMaterialHeight" : "1.0",
            "recessedMaterialOuterBevelSize" : "3",
            "recessedMaterialInnerBevelSize" : "3",

            "bevelSize": "10",

            "perEyeTransformsLeft" : "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]",
            "perEyeTransformsRight" : "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]",

            "inheritedOpacity": "1",

            "mipLodBiasStartRate":0.0,
            "mipLodBiasStartValue":0.0,
            "mipLodBiasEndRate":0.0,
            "mipLodBiasEndValue":0.0,
            "mipLodBiasRateDeltaRecip":0.0,

            "blurInvColorFilterMatrix": "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]",
            "colorMatchMatrix": "[1,0,0,0,1,0,0,0,1]",
            "inverseColorMatchMatrix": "[1,0,0,0,1,0,0,0,1]",
            "edrScaleGamma": 1.0,

            "edgeBevelShadowRadius": "0",
            "edgeBevelShadowOpacity": "0",
            "edgeBevelShadowUVOffset": "[0, 0]",

            "breakthroughCornerRadius" : "5",
            "breakthroughFeatherWidth" : "5",

            "layerSize" : "[0, 0]",
            "innerRadius" : "0.01",
            "glowParamsCount" : "0",
            "dynamicLuminance" : "false",
            "luminanceCurve": "[0.06103, 0.29577, 0.76056, 1.08451]",
            "isLayerOriginAtTopLeft" : "true",

            "dragUIShadowMaxDarkening" : "1",
            "dragUIShadowAABBHalfSizeDataAndIntensity" : "[0, 0, 0, 0]",
            "dragUIShadowUseEllipseSDF" : "false",
            "dragUIShadowParams" : "[0, 0, 0, 0]",
            "dragUIWorldToCaster" : "[1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1]",
            "edgeAnalyticAAStrength": "0"
        },
        "Textures": {
            "passthroughBlurColor" : "rendergraph.FilteredPassthroughBlurredColorSRGB",
            "vcaBlurColor" : "rendergraph.VCABlurredColorSRGB",
            "vcOnlyBlurColor": "rendergraph.VCOnlyBlurredColorSRGB",
            "dmWarpedAlphaMask" : "rendergraph.DMWarpedAlphaMask",
            "textureVisualDepth": "rendergraph.VisualDepthTexture",
            "textureSUOcclusionAlphaMask": "rendergraph.SUOcclusionAlphaMask",
            "textureImmersiveEnvironmentMask": "rendergraph.immersiveEnvironmentMask",

            "textureSDF" : "fallback.white",
            "textureGradient" : "fallback.white",
            "textureBaseColor": "fallback.missingUITexture",
            "textureBaseColor1": "fallback.gray",
            "textureBaseColor2": "fallback.lightBlue",
            "textureShadowSDF": "fallback.white",
            "textureShadowColor": "fallback.white",
            "tonemapInverseLUT": "global.tonemapInverseLUT",
            
            "videoTexturePlane0[0]": "fallback.black",
            "videoTexturePlane1[0]": "fallback.black",
            "videoTexturePlane2[0]": "fallback.white",
            "videoTexturePlane0[1]": "fallback.black",
            "videoTexturePlane1[1]": "fallback.black",
            "videoTexturePlane2[1]": "fallback.white",
            "videoGammaToneCurvePowerFunctionTable": "fallback.white1D",
            "videoGammaBoostPowerFunctionTable": "fallback.white1D",
            
            "textureUIShadowColor" : "fallback.black"
        },
        "Buffers": {
            "foveatedFrame" : "fallback.zeros",
            "gammaLUTs": "global.gammaLUTs",
            "vertDistanceToPlatterEdge" : "geometry.vertDistanceToPlatterEdge"
        }
    },
    "Techniques": [
        {
            "Name": "TransparentUI",
            "VertexShader": {
                "Entry": "vsCustomCALayer"
            },
            "PixelShader": {
                "Entry": "fsCustomCALayer"
            },
            "State" : {
                "WriteDepth"           : true,
                "DepthCompareFunction" : "GreaterEqual",
                "AlphaToCoverage"      : false,
                "AlphaToOne"           : false,
                "RenderAttachmentState" : [
                    {
                        "PreferProgrammableBlending" : true,
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Add",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "OneMinusSourceAlpha",
                        "RgbBlendOperation"      : "Add",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "OneMinusSourceAlpha"
                    },
                    {
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Add",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "OneMinusSourceAlpha",
                        "RgbBlendOperation"      : "Add",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "OneMinusSourceAlpha"},
                    {},
                    {},
                    {
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Max",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "One",
                        "RgbBlendOperation"      : "Max",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "One"
                    }
                ]
            },
            "FunctionConstants" : {
                "EnableClipping"             : "false",
                "EnableBaseColorMap"         : "true",
                "EnableTransparency"         : "true",
                "EnableOpacityThreshold"     : "false",
                "EnableAnisotropy"           : "false",
                "EnableNonVRRAnisotropy"     : "false",
                "IsFullyTransparent"         : "false",
                "EnablePassthroughBlurPlane" : "true",
                "EnableVCABlurPlane"         : "false",
                "EnablePlatter"              : "false",
                "CAEdgeSpecularMode"         : "0",
                "EdgeBevelShadowMode"        : "0",
                "EnableCAShaderDebug"        : "false",
                "EnableCAPreSamplerDegamma"  : "false",
                "EnableInset"                : "false",
                "EnableCAPerEyeTransform"    : "false",
                "EnablePlatterSpecular"      : "false",
                "EnablePlatterFakeFresnel"   : "false",
                "UseDirectionalLight"        : "true",
                "EnableDepthMitigation"      : "false",
                "EnableVisualDepthStaticOcclusion" : "false",
                "EnableSceneUnderstandingStaticOcclusion" : "false",
                "IsVisualDepthStaticOcclusionTextureAvailable" : "false",
                "EnableDitherTransitionToRenderFarPlane" : "false",
                "EnableBtMask"               : "false",
                "EnableUIBlending"           : "false",
                "EnableSpatialFocus"         : "false",
                "EnableDragUIShadow"         : "false",
                "EnableUserEnvironment"      : "false",
                "EnableGlow"                 : "false",
                "TonemappingMode"            : "0",
                "RenderForBlur"              : "false",
                "PerceptualBlendingMode"     : "0",
                "EnableEdgeAnalyticAA"       : "false",
                "PortalClippingMode"          : "0",
                "EnableInvertBlurColorMatrix" : "false",
                "UesVCOnlyBlur"               : "false",
                                
                "EnableEscapedLayer" : "false",
                "EnableTriPlanarVideoSupport" : "false",
                "EnableVideoColorSpaceTransformation" : "false",
                "EnableVideoColorTransformation" : "false",
                "EnableVideoLegacyMode" : "false",
                "EnableInvertColors" : "false",
                "EnableMultiUVs" : "false",
                
                "EnableUIShadowReceiver" : "false"
            },
            "Variations" : {
                "EnableClipping"            : ["false", "true"],
                "EnableAnisotropy"          : ["false", "true"],
                "EnableNonVRRAnisotropy"    : ["false", "true"],
                "IsFullyTransparent"        : ["false", "true"],
                "EnablePlatter"             : ["false", "true"],
                "CAEdgeSpecularMode"        : ["0", "1", "2"],
                "EdgeBevelShadowMode"       : ["0", "1", "2"],
                "EnableCAShaderDebug"       : ["false", "true"],
                "EnableCAPreSamplerDegamma" : ["false", "true"],
                "EnableInset"               : ["false", "true"],
                "EnableCAPerEyeTransform"   : ["false", "true"],
                "EnablePlatterSpecular"     : ["false", "true"],
                "EnablePlatterFakeFresnel"  : ["false", "true"],
                "UseDirectionalLight"       : ["false", "true"],
                "EnableDragUIShadow"        : ["false", "true"],
                "EnableDepthMitigation"     : ["false", "true"],
                "EnableVisualDepthStaticOcclusion"             : ["false", "true"],
                "EnableSceneUnderstandingStaticOcclusion" : ["false", "true"],
                "IsVisualDepthStaticOcclusionTextureAvailable" : ["false", "true"],
                "EnableDitherTransitionToRenderFarPlane" : ["false", "true"],
                "EnableBtMask"              : ["false", "true"],
                "EnableUIBlending"          : ["false", "true"],
                "EnableSpatialFocus"        : ["false", "true"],
                "EnableUserEnvironment"     : ["false", "true"],
                "EnableGlow"                : ["false", "true"],
                "TonemappingMode"           : ["0", "1", "2"],
                "RenderForBlur"             : ["false", "true"],
                "PerceptualBlendingMode"    : ["0", "1", "2", "3"],
                "EnableEdgeAnalyticAA"      : ["false", "true"],
                "PortalClippingMode"         : ["0", "1", "2", "3", "4"],
                "EnableInvertBlurColorMatrix" : ["false", "true"],
                "UseVCOnlyBlur"               : ["false", "true"],
                
                "EnableEscapedLayer" : ["false", "true"],
                "EnableTriPlanarVideoSupport" : ["false", "true"],
                "EnableVideoColorSpaceTransformation" : ["false", "true"],
                "EnableVideoColorTransformation" : ["false", "true"],
                "EnableVideoLegacyMode" : ["false", "true"],
                "EnableInvertColors" : ["false", "true"],
                
                "EnableUIShadowReceiver" : ["false", "true"]
            },
            "RuntimeFunctionConstantDefaults" : {
                "EnableClipping"            : "true",
                "EnableAnisotropy"          : "false",
                "EnableNonVRRAnisotropy"    : "false",
                "IsFullyTransparent"        : "true",
                "EnablePlatter"             : "true",
                "CAEdgeSpecularMode"        : "2",
                "EdgeBevelShadowMode"       : "2",
                "EnableCAShaderDebug"       : "true",
                "EnableCAPreSamplerDegamma" : "true",
                "EnableInset"               : "true",
                "EnableCAPerEyeTransform"   : "true",
                "EnablePlatterSpecular"     : "true",
                "EnablePlatterFakeFresnel"  : "true",
                "UseDirectionalLight"       : "true",
                "EnableDragUIShadow"        : "true",
                "EnableDepthMitigation"     : "true",
                "EnableVisualDepthStaticOcclusion" : "true",
                "EnableSceneUnderstandingStaticOcclusion" : "true",
                "IsVisualDepthStaticOcclusionTextureAvailable" : "true",
                "EnableDitherTransitionToRenderFarPlane" : "true",
                "EnableBtMask"              : "true",
                "EnableUIBlending"          : "true",
                "EnableSpatialFocus"        : "true",
                "EnableUserEnvironment"     : "true",
                "EnableGlow"                : "true",
                "TonemappingMode"           : "2",
                "RenderForBlur"             : "false",
                "PerceptualBlendingMode"    : "0",
                "EnableEdgeAnalyticAA"      : "true",
                "PortalClippingMode"         : "0",
                "EnableInvertBlurColorMatrix" : "false",
                "UseVCOnlyBlur"               : "false",
                
                "EnableEscapedLayer" : "true",
                "EnableTriPlanarVideoSupport" : "true",
                "EnableVideoColorSpaceTransformation" : "true",
                "EnableVideoColorTransformation" : "true",
                "EnableVideoLegacyMode" : "false",
                "EnableInvertColors" : "true",
                
                "EnableUIShadowReceiver" : "true"
            },
            "SupportsRuntimeFunctionConstants" : true,
            "PreloadOptions" : {
                "PixelFormat" : [81, 115],
                "SampleCount" : [4, 1],
                "OverrideFlags" : [0, 2]
            }
        },
        {
            "Name": "TransparentUIColorOnly",
            "InheritFromTechnique": "TransparentUI",
            "InheritState": false,
            "State" : {
                "WriteDepth"           : false,
                "DepthCompareFunction" : "GreaterEqual",
                "AlphaToCoverage"      : false,
                "AlphaToOne"           : false,
                "RenderAttachmentState" : [
                    {
                        "PreferProgrammableBlending" : true,
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Add",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "OneMinusSourceAlpha",
                        "RgbBlendOperation"      : "Add",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "OneMinusSourceAlpha"
                    },
                    {
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Add",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "OneMinusSourceAlpha",
                        "RgbBlendOperation"      : "Add",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "OneMinusSourceAlpha"},
                    {},
                    {},
                    {
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Max",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "One",
                        "RgbBlendOperation"      : "Max",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "One"
                    }
                ]
            },
            "Variations" : {
                "IsFullyTransparent"   : [],
                "EnablePlatter"        : [],
                "EnableInset"          : [],
                "EnableEdgeAnalyticAA" : [],
                "EnableInvertColors" : []
            },
            "RuntimeFunctionConstantDefaults" : {
                "IsFullyTransparent"   : "false",
                "EnablePlatter"        : "false",
                "EnableInset"          : "false",
                "EnableEdgeAnalyticAA" : "false",
                "EnableInvertColors" : "false"
            }
        },
        {
            "Name": "OpaqueUI",
            "InheritFromTechnique": "TransparentUI",
            "InheritState": false,
            "State" : {
                "WriteDepth"           : true,
                "DepthCompareFunction" : "GreaterEqual"
            },
            "FunctionConstants" : {
                "EnableTransparency" : "false",
                "EnableVCABlurPlane" : "false"
            },
            "Variations" : {
                "EnableBtMask"       : [],
                "EnableUIBlending"   : []
            },
            "RuntimeFunctionConstantDefaults" : {
                "EnableBtMask"         : "false",
                "EnableUIBlending"     : "false",
                "EnableEdgeAnalyticAA" : "false"
            }
        },
        {
            "Name": "FadeOpaqueUI",
            "InheritFromTechnique": "TransparentUI",
            "InheritState": true,
            "FunctionConstants" : {
                "EnableTransparency" : "false",
                "EnableVCABlurPlane" : "false"
            },
            "RuntimeFunctionConstantDefaults" : {
                "EnableEdgeAnalyticAA" : "false"
            }
        },
        {
            "Name": "TransparentOverdraw",
            "VertexShader": {
                "Entry": "vsCALayer"
            },
            "PixelShader": {
                "Entry": "fsOverdrawDebug"
            },
            "State" : {
                "WriteDepth"             : true,
                "DepthCompareFunction"   : "GreaterEqual",
                "RenderAttachmentState"  : [
                    {
                        "AlphaBlend"             : true,
                        "AlphaBlendOperation"    : "Add",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "One",
                        "RgbBlendOperation"      : "Add",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "One"
                    }
                ]
            }
        },
        {
            "Name": "VCAPlatterOpaque",
            "InheritFromTechnique": "OpaqueUI",
            "InheritState": true,
            "FunctionConstants" : {
                "EnableVCABlurPlane" : "true",
                "EnablePlatter"      : "true"
            },
            "Tags" : {
                "VCABlur" : "True"
            }
        },
        {
            "Name": "VCAPlatterTransparent",
            "InheritFromTechnique": "TransparentUI",
            "InheritState": true,
            "FunctionConstants" : {
                "EnableVCABlurPlane" : "true",
                "EnablePlatter"      : "true",
                "EnableEscapedLayer" : "false"
            },
            "Tags" : {
                "VCABlur" : "True"
            },
            "Variations" : {
                "EnableEscapedLayer" : ["false", "true"]
            }
        },
        {
            "Name": "StenciledRenderNoPlatter",
            "InheritFromTechnique": "VCAPlatterTransparent",
            "InheritState": true,
            "FunctionConstants" : {
                "EnablePlatter"              : "false",
                "EnablePassthroughBlurPlane" : "false",
                "EnableVCABlurPlane"         : "false",
                "RenderForBlur"              : "true"
            },
            "Tags" : {
                "VCABlur" : "False"
            },
            "Variations" : {
                "EnablePlatter"              : [],
                "EnablePassthroughBlurPlane" : [],
                "EnableVCABlurPlane"         : [],
                "RenderForBlur"              : []
            },
            "RuntimeFunctionConstantDefaults" : {
                "EnablePlatter"              : "false",
                "EnablePassthroughBlurPlane" : "false",
                "EnableVCABlurPlane"         : "false",
                "RenderForBlur"              : "true"
            }
        },
        {
            "Name": "OnlyPlattersVS",
            "InheritFromTechnique": "VCAPlatterOpaque",
            "InheritState": false,
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : false,
                "DepthCompareFunction" : "Always",
                "ColorWriteMask" : "None"
            }
        },
        {
            "Name": "OnlyPlattersBreakthrough",
            "VertexShader": {
                "Entry": "vsUnlit"
            },
            "PixelShader": {
                "Entry": "fsSFBStencilBreakthrough"
            },
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : false,
                "DepthCompareFunction" : "Always"
            },
            "FunctionConstants" : {
                "EnableUnlitTexture"             : "false",
                "EnableSRGBToLinearConversion"   : "false",
                "EnableVertexColor"              : "false",
                "EnableOpacityMap"               : "false",
                "EnableBtMask"                   : "false"
            },
            "Variations" : {
                "EnableBtMask" : ["false", "true"]
            },
            "RuntimeFunctionConstantDefaults" : {
                "EnableBtMask" : "true"
            },
            "Tags" : {
                "VCABlur" : "True"
            },
            "SupportsRuntimeFunctionConstants" : true
        },
        {
            "Name": "OnlyPlattersWithDepthVS",
            "InheritFromTechnique": "VCAPlatterOpaque",
            "InheritState": false,
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : true,
                "DepthCompareFunction" : "GreaterEqual",
                "ColorWriteMask" : "None"
            }
        },
        {
            "Name": "UIDepthOnly",
            "InheritFromTechnique": "OpaqueUI",
            "InheritState": false,
            "State" : {
                "AlphaBlend" : false,
                "WriteDepth" : true,
                "DepthCompareFunction" : "GreaterEqual",
                "ColorWriteMask" : "None"
            }
        },
        {
            "Name": "TransparentUI_BackCompat",
            "InheritFromTechnique": "TransparentUI",
            "InheritState": true,
            "Tags" : {
                "Transparent_BackCompat" : "True"
            }
        },
        {
            "Name": "VCAPlatterTransparent_BackCompat",
            "InheritFromTechnique": "VCAPlatterTransparent",
            "InheritState": true,
            "Tags" : {
                "VCABlur" : "True",
                "Transparent_BackCompat" : "True"
            }
        },
        {
            "Name": "UIShadowCaster",
            "VertexShader": {
                "Entry": "vsUIShadow"
            },
            "PixelShader": {
                "Entry": "fsUIShadow"
            },
            "InstancedArguments" : [ "instanceConstantsArray" ],
            "SupportsRuntimeFunctionConstants" : true,
            "State" : {
                "WriteDepth"             : true,
                "DepthCompareFunction"   : "Always",
                "AlphaBlend"             : false,
                "AlphaBlendOperation"    : "Add",
                "AlphaSourceFactor"      : "One",
                "AlphaDestinationFactor" : "OneMinusSourceAlpha",
                "RgbBlendOperation"      : "Add",
                "RgbSourceFactor"        : "One",
                "RgbDestinationFactor"   : "One",
                "RenderAttachmentState"  : [
                    {
                        "AlphaBlend"             : false,
                        "AlphaBlendOperation"    : "Add",
                        "AlphaSourceFactor"      : "One",
                        "AlphaDestinationFactor" : "OneMinusSourceAlpha",
                        "RgbBlendOperation"      : "Add",
                        "RgbSourceFactor"        : "One",
                        "RgbDestinationFactor"   : "One"
                    }
                ]
            }
        }
    ],
    "TechniqueMapping": {
        "Transparent": "TransparentUI",
        "TransparentOverdraw": "TransparentOverdraw",
        "UIShadowCaster": "UIShadowCaster"
    },
    "TechniqueMappingOverrides": {
        "Fade": {
            "Transparent": "TransparentUI",
            "TransparentOverdraw": "TransparentOverdraw"
        }
    },
    "ShaderCompilationMode" : {
        "FadeOpaqueLite"            : 2,
        "OpaqueLite"                : 2,
        "TransparentLite"           : 2,
        "DepthOnly"                 : 2,
        "TransparentUI"             : 1,
        "OpaqueUI"                  : 1,
        "VCAPlatterOpaque"          : 1,
        "VCAPlatterTransparent"     : 1,
        "StenciledRenderNoPlatter"  : 1
    }
}
