| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- /*
- * 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>
- ShaderResourceGroup MrtScreenInstanceSrg : SRG_PerObject
- {
- Texture2D rMap;
- Texture2D gMap;
- Texture2D bMap;
- Sampler m_sampler
- {
- MaxAnisotropy = 16;
- AddressU = Wrap;
- AddressV = Wrap;
- AddressW = Wrap;
- };
- }
- struct VSInput
- {
- float3 m_position : POSITION;
- float2 m_uv : UV0;
- };
- struct VSOutput
- {
- float4 m_position : SV_Position;
- float2 m_uv : UV0;
- };
- VSOutput MainVS(VSInput vsInput)
- {
- VSOutput OUT;
- OUT.m_position = float4(vsInput.m_position, 1.0);
- OUT.m_uv = vsInput.m_uv;
- return OUT;
- }
- struct PSOutput
- {
- float4 m_color : SV_Target0;
- };
- PSOutput MainPS(VSOutput psInput)
- {
- PSOutput OUT;
- float red = MrtScreenInstanceSrg::rMap.Sample(MrtScreenInstanceSrg::m_sampler, psInput.m_uv).x;
- float green = MrtScreenInstanceSrg::gMap.Sample(MrtScreenInstanceSrg::m_sampler, psInput.m_uv).x;
- float blue = MrtScreenInstanceSrg::bMap.Sample(MrtScreenInstanceSrg::m_sampler, psInput.m_uv).x;
- OUT.m_color = float4(red, green, blue, 1);
- return OUT;
- }
|