12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455 |
- /*
- * 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 <scenesrg_all.srgi>
- #include <viewsrg_all.srgi>
- // To get the world matrix shader constant for the current object.
- #include <Atom/Features/PBR/DefaultObjectSrg.azsli>
- struct VSInput
- {
- float3 m_position : POSITION;
- float3 m_normal : NORMAL;
- // For the complete list of supported input stream semantics see ModelAssetBuilderComponent::CreateMesh()
- };
- struct VSOutput
- {
- float4 m_position : SV_Position;
- float3 m_normal: NORMAL;
- };
- VSOutput MainVS(VSInput IN)
- {
- VSOutput OUT;
- float3 worldPosition = mul(ObjectSrg::GetWorldMatrix(), float4(IN.m_position, 1.0)).xyz;
- OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(worldPosition, 1.0));
- OUT.m_normal = IN.m_normal;
- return OUT;
- }
- struct PSOutput
- {
- float4 m_color : SV_Target0;
- };
- PSOutput MainPS(VSOutput IN)
- {
- PSOutput OUT;
- const float3 RED_COLOR = float3(1, 0, 0);
- const float3 GREEN_COLOR = float3(0, 1, 0);
- const float3 BLUE_COLOR = float3(0, 0, 1);
- // ShaderReloadTest START
- const float3 TEST_COLOR = BLUE_COLOR;
- // ShaderReloadTest END
- OUT.m_color = float4(TEST_COLOR, 1.0);
- return OUT;
- }
|