mirror of
https://github.com/antopilo/Nuake.git
synced 2026-09-21 20:08:40 +03:00
Added textured quad to gizmo api
This commit is contained in:
@@ -92,6 +92,7 @@ struct PSOutput {
|
||||
struct DebugConstant
|
||||
{
|
||||
float4x4 Transform;
|
||||
int TextureID;
|
||||
};
|
||||
|
||||
[[vk::push_constant]]
|
||||
@@ -101,6 +102,23 @@ PSOutput main(PSInput input)
|
||||
{
|
||||
PSOutput output;
|
||||
|
||||
output.oColor0 = float4(input.UV.x, input.UV.y, 0, 1);
|
||||
if(pushConstants.TextureID < 0)
|
||||
{
|
||||
output.oColor0 = float4(input.UV.x, input.UV.y, 0, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
float2 uv = input.UV;
|
||||
float4 textureSample = textures[pushConstants.TextureID].Sample(mySampler, uv);
|
||||
|
||||
// Alpha scisorring
|
||||
if(textureSample.a < 0.1)
|
||||
{
|
||||
discard;
|
||||
}
|
||||
|
||||
output.oColor0 = textureSample;
|
||||
}
|
||||
|
||||
return output;
|
||||
}
|
||||
@@ -83,6 +83,7 @@ StructuredBuffer<CameraView> cameras;
|
||||
struct DebugConstant
|
||||
{
|
||||
float4x4 Transform;
|
||||
int TextureID;
|
||||
};
|
||||
|
||||
[[vk::push_constant]]
|
||||
|
||||
Reference in New Issue
Block a user