You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
55 lines
1.2 KiB
Plaintext
55 lines
1.2 KiB
Plaintext
/*
|
|
* 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 <viewsrg.srgi>
|
|
#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;
|
|
}
|