Files
Juliet/Assets/source/Triangle.vert.hlsl
Patedam 87831d0fd6 Added basic concept of Mesh
Right now can create a quad or a cube.
Need a mesh renderer taht keep the buffer and all to optimally handle the mega buffer.
2026-02-15 17:44:48 -05:00

26 lines
566 B
HLSL

struct Output
{
float4 Color : TEXCOORD0;
float4 Position : SV_Position;
};
#include "RootConstants.hlsl"
Output main(uint vertexIndex : SV_VertexID)
{
Output output;
ByteAddressBuffer buffer = ResourceDescriptorHeap[BufferIndex];
uint stride = 28;
uint offset = vertexIndex * stride;
float3 pos = asfloat(buffer.Load3(offset));
float4 col = asfloat(buffer.Load4(offset + 12));
//output.Position = float4(pos, 1.0f);
output.Position = mul(ViewProjection, float4(pos, 1.0f));
output.Color = col;
return output;
}