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.
26 lines
566 B
HLSL
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;
|
|
}
|