// Copyright (c) .NET Foundation and Contributors (https://dotnetfoundation.org/ & https://stride3d.net) and Silicon Studio Corp. (https://www.siliconstudio.co.jp)
// Distributed under the MIT license. See the LICENSE.md file in the project root for more information.

shader VolumeMinMaxShader : ShaderBase, PositionHStream4
{
    stage matrix WorldViewProjection;
    stage stream float4 Position : POSITION;

    stage override void VSMain()
    {
        streams.ShadingPosition = mul(streams.Position, WorldViewProjection);
        streams.PositionH = streams.ShadingPosition;
    }

    stage override void PSMain()
    {
        float depth = streams.PositionH.z / streams.PositionH.w;
        streams.ColorTarget = float4(depth, depth, 0, 1);
    }
};
