123456789101112131415161718192021222324252627282930 |
- /*
- * Copyright (c) Contributors to the Open 3D Engine Project.
- * For complete copyright and license terms please see the LICENSE at the root of this distribution.
- *
- * SPDX-License-Identifier: Apache-2.0 OR MIT
- *
- */
-
- #include <EditorModeCommon.azsli>
- PSOutput MainPS(VSOutput IN)
- {
- PSOutput OUT;
- const float3 inColor = PassSrg::m_framebuffer.Sample(PassSrg::LinearSampler, IN.m_texCoord).rgb;
- const float mask = PassSrg::m_entityMask.Sample(PassSrg::PointSampler, IN.m_texCoord).r;
- // Tint effect
- const float3 finalEffect = lerp(inColor, PassSrg::m_tintColor.rgb, PassSrg::m_tintAmount);
- // Apply the depth transition to the blend amount
- const float zDepth = PassSrg::m_depth.Sample(PassSrg::PointSampler, IN.m_texCoord).r;
- const float t = PassSrg::CalculateTransitionBlendAmountFromDepth(zDepth, mask);
-
- // Apply the visual effect to non-mask entities, leaving mask entities untouched
- OUT.m_color = PassSrg::CalculateFinalBlendAmountAndOutputColor(inColor, finalEffect, t);
- return OUT;
- }
|