/* * 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 #include // To get the world matrix shader constant for the current object. #include 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(SceneSrg::GetObjectToWorldMatrix(ObjectSrg::m_objectId), 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; }