/* * 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 "ObjectSrg.azsli" option enum class ViewProjectionMode { ViewProjection, ManualOverride } o_viewProjMode; struct VSInput { float3 m_position : POSITION; }; struct VSOutput { float4 m_position : SV_Position; [[vk::builtin("PointSize")]] float m_pointSize : PSIZE; }; VSOutput MainVS(VSInput vsInput) { VSOutput OUT; OUT.m_position.xyz = mul(ObjectSrg::GetWorldMatrix(), float4(vsInput.m_position, 1.0)).xyz; if (o_viewProjMode == ViewProjectionMode::ViewProjection) { OUT.m_position = mul(ViewSrg::m_viewProjectionMatrix, float4(OUT.m_position.xyz, 1.0)); } else if (o_viewProjMode == ViewProjectionMode::ManualOverride) { OUT.m_position = mul(ObjectSrg::m_viewProjectionOverride, float4(OUT.m_position.xyz, 1.0)); } OUT.m_pointSize = ObjectSrg::m_pointSize; return OUT; } struct PSOutput { float4 m_color : SV_Target0; }; PSOutput MainPS() { PSOutput OUT; OUT.m_color = ObjectSrg::m_color; return OUT; }