29 lines
693 B
HLSL
29 lines
693 B
HLSL
struct Output
|
|
{
|
|
float4 Color : TEXCOORD0;
|
|
float3 Normal : TEXCOORD1;
|
|
float4 Position : SV_Position;
|
|
};
|
|
|
|
#include "RootConstants.hlsl"
|
|
|
|
Output main(uint vertexIndex : SV_VertexID)
|
|
{
|
|
Output output;
|
|
|
|
ByteAddressBuffer buffer = ResourceDescriptorHeap[BufferIndex];
|
|
|
|
uint stride = 40;
|
|
uint offset = vertexIndex * stride;
|
|
|
|
float3 pos = asfloat(buffer.Load3(offset));
|
|
float3 normal = asfloat(buffer.Load3(offset + 12));
|
|
float4 col = asfloat(buffer.Load4(offset + 24));
|
|
|
|
//output.Position = float4(pos, 1.0f);
|
|
output.Position = mul(ViewProjection, mul(Model, float4(pos, 1.0f)));
|
|
output.Color = col;
|
|
output.Normal = normal;
|
|
return output;
|
|
}
|