12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- /*
- * 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 <Atom/Features/SrgSemantics.azsli>
- #include <Atom/Features/PostProcessing/FullscreenPixelInfo.azsli>
- #include <Atom/Features/PostProcessing/FullscreenVertex.azsli>
- #include <Atom/Features/PostProcessing/PostProcessUtil.azsli>
- ShaderResourceGroup PassSrg : SRG_PerPass
- {
- Texture2D<float4> m_framebuffer;
- Sampler LinearSampler
- {
- MinFilter = Linear;
- MagFilter = Linear;
- MipFilter = Linear;
- AddressU = Clamp;
- AddressV = Clamp;
- AddressW = Clamp;
- };
-
- float4 m_colorTint;
- }
- PSOutput MainPS(VSOutput IN)
- {
- PSOutput OUT;
- float3 color = PassSrg::m_framebuffer.Sample(PassSrg::LinearSampler, IN.m_texCoord).rgb;
- float average = color.r + color.g + color.b;
- average /= 3.0f;
- OUT.m_color.rgb = float3(average, average, average);
- OUT.m_color.w = 1;
- OUT.m_color.rgb *= PassSrg::m_colorTint.rgb;
- return OUT;
- }
|