
{
    "Name": "Immersive Portal Material Definition",
    "OverrideMaterial": "engine:engineDefaults.rematerialdefinition",
    "Parameters": {
        "Buffers": {
            "portalTileArray" : "fallback.zeros",
            "rateMapData" : "fallback.zeros",
            "tile" : "geometry.triangleVertices"
        },
        "Textures": {
            "immersionPortal" : "fallback.blackArray",
            "immersionPortalDepth" : "fallback.blackArray",
            "textureMask"  : "fallback.texture2dArray",
            "reducedMask" : "fallback.texture2dArray",
            "skyVertexBuffer" : "fallback.white"
        }
    },
    "Techniques": [
    {
        "Name": "StencilIncrement",
        "VertexShader": {
            "Entry": "vsStencilGrid"
        },
        "State" : {
            "AlphaBlend" : false,
            "WriteDepth" : false,
            "DepthCompareFunction" : "Always",
            "ColorWriteMask" : "None"
        },
        "SupportsRuntimeFunctionConstants" : true,
        "PreloadOptions" : {
            "PositionFormatOverride" : [1]
        }
    },
    {
        "Name": "StencilIncrementMesh",
        "VertexShader": {
            "Entry": "opensky::vsOpenSkyEdgeLoop"
        },
        "State" : {
            "AlphaBlend" : false,
            "WriteDepth" : false,
            "DepthCompareFunction" : "Always",
            "ColorWriteMask" : "None"
        },
        "SupportsRuntimeFunctionConstants" : true,
        "PreloadOptions" : {
            "PositionFormatOverride" : [1]
        }
    },
    {
        "Name": "StencilDecrement",
        "VertexShader": {
            "Entry": "vsStencilGridRemoveOpaque"
        },
        "State" : {
            "AlphaBlend" : false,
            "WriteDepth" : false,
            "DepthCompareFunction" : "Always",
            "ColorWriteMask" : "None"
        },
        "SupportsRuntimeFunctionConstants" : true,
        "PreloadOptions" : {
            "PositionFormatOverride" : [1]
        }
    },
    {
        "Name": "ColorBufferFeather",
        "VertexShader": {
            "Entry": "vsFullscreenNearPlane"
        },
        "PixelShader": {
            "Entry": "fsApplyImmersionMask"
        },
        "State" : {
            "AlphaBlend"             : true,
            "WriteDepth"             : false,
            "DepthCompareFunction"   : "Always",
            "AlphaBlendOperation"       : "Add",
            "AlphaSourceFactor"         : "BlendAlpha",
            "AlphaDestinationFactor"    : "OneMinusSourceAlpha",
            "RgbBlendOperation"         : "Add",
            "RgbSourceFactor"           : "BlendColor",
            "RgbDestinationFactor"      : "OneMinusSourceAlpha"
        },
        "FunctionConstants" : {
            "ApplyDitheringToImmersionMask" : "false",
            "PerceptualBlendingMode" : "2"
        },
        "SupportsRuntimeFunctionConstants" : true
    },
    {
        "Name": "ColorBufferFeatherPortalNode",
        "VertexShader": {
            "Entry": "vsFullscreenNearPlane"
        },
        "PixelShader": {
            "Entry": "fsApplyImmersionMask"
        },
        "State" : {
            "AlphaBlend"             : true,
            "WriteDepth"             : false,
            "DepthCompareFunction"   : "Always",
            "AlphaBlendOperation"       : "Add",
            "AlphaSourceFactor"         : "BlendAlpha",
            "AlphaDestinationFactor"    : "OneMinusSourceAlpha",
            "RgbBlendOperation"         : "Add",
            "RgbSourceFactor"           : "BlendColor",
            "RgbDestinationFactor"      : "OneMinusSourceAlpha"
        },
        "FunctionConstants" : {
            "ApplyDitheringToImmersionMask" : "false",
            "PerceptualBlendingMode" : "2"
        },
        "SupportsRuntimeFunctionConstants" : true
    },
    {
        "Name": "ColorBufferFeatherMesh",
        "VertexShader": {
            "Entry": "opensky::vsOpenSkyEdgeLoop"
        },
        "PixelShader": {
            "Entry": "opensky::fsGenerateMaskOpenSkyEdgeLoop"
        },
        "State" : {
            "AlphaBlend"             : true,
            "WriteDepth"             : false,
            "DepthCompareFunction"   : "Always",
            "AlphaBlendOperation"       : "Add",
            "AlphaSourceFactor"         : "BlendAlpha",
            "AlphaDestinationFactor"    : "SourceAlpha",
            "RgbBlendOperation"         : "Add",
            "RgbSourceFactor"           : "BlendColor",
            "RgbDestinationFactor"      : "SourceAlpha"
        },
        "SupportsRuntimeFunctionConstants" : true
    },
    {
        "Name": "ColorBufferFeatherDithered",
        "VertexShader": {
            "Entry": "vsFullscreenNearPlane"
        },
        "PixelShader": {
            "Entry": "fsApplyImmersionMask"
        },
        "State" : {
            "AlphaBlend"             : true,
            "WriteDepth"             : false,
            "DepthCompareFunction"   : "Always",
            "AlphaBlendOperation"       : "Add",
            "AlphaSourceFactor"         : "BlendAlpha",
            "AlphaDestinationFactor"    : "OneMinusSourceAlpha",
            "RgbBlendOperation"         : "Add",
            "RgbSourceFactor"           : "BlendColor",
            "RgbDestinationFactor"      : "OneMinusSourceAlpha"
        },
        "FunctionConstants" : {
            "ApplyDitheringToImmersionMask" : "true",
            "PerceptualBlendingMode" : "2"
        },
        "SupportsRuntimeFunctionConstants" : true
    },
    {
        "Name": "ColorBufferFeatherPortalNodeDithered",
        "VertexShader": {
            "Entry": "vsFullscreenNearPlane"
        },
        "PixelShader": {
            "Entry": "fsApplyImmersionMask"
        },
        "State" : {
            "AlphaBlend"             : true,
            "WriteDepth"             : false,
            "DepthCompareFunction"   : "Always",
            "AlphaBlendOperation"       : "Add",
            "AlphaSourceFactor"         : "BlendAlpha",
            "AlphaDestinationFactor"    : "OneMinusSourceAlpha",
            "RgbBlendOperation"         : "Add",
            "RgbSourceFactor"           : "BlendColor",
            "RgbDestinationFactor"      : "OneMinusSourceAlpha"
        },
        "FunctionConstants" : {
            "ApplyDitheringToImmersionMask" : "true",
            "PerceptualBlendingMode" : "2"
        },
        "SupportsRuntimeFunctionConstants" : true
    },
    {
        "Name": "DebugVisualizeFeatherRegion",
        "VertexShader": {
            "Entry": "vsFullscreenNearPlane"
        },
        "PixelShader": {
            "Entry": "fsDebugVisualizeFeatherRegion"
        },
        "State" : {
            "AlphaBlend"             : false,
            "WriteDepth"             : false,
            "DepthCompareFunction"   : "Always"
        }
    }
    ],
    "TechniqueMapping": {
        "StencilIncrement": "StencilIncrement",
        "StencilIncrementMesh": "StencilIncrementMesh",
        "StencilDecrement": "StencilDecrement",
        "ColorBufferFeather": "ColorBufferFeather",
        "ColorBufferFeatherDithered": "ColorBufferFeatherDithered",
        "ColorBufferFeatherPortalNode": "ColorBufferFeatherPortalNode",
        "ColorBufferFeatherPortalNodeDithered": "ColorBufferFeatherPortalNodeDithered",
        "ColorBufferFeatherMesh" : "ColorBufferFeatherMesh",
        "DebugVisualizeFeatherRegion": "DebugVisualizeFeatherRegion"
    }
}

