Added:
- Depth buffer - Debug display basics - Basic vector + matrix maths Made partially with gemini + antigravity
This commit is contained in:
27
Assets/source/Debug.vert.hlsl
Normal file
27
Assets/source/Debug.vert.hlsl
Normal file
@@ -0,0 +1,27 @@
|
||||
struct Output
|
||||
{
|
||||
float4 Color : TEXCOORD0;
|
||||
float4 Position : SV_Position;
|
||||
};
|
||||
|
||||
#include "RootConstants.hlsl"
|
||||
|
||||
Output main(uint vertexIndex : SV_VertexID)
|
||||
{
|
||||
Output output;
|
||||
|
||||
// Retrieve the vertex buffer using SM6.6 bindless syntax
|
||||
ByteAddressBuffer buffer = ResourceDescriptorHeap[BufferIndex];
|
||||
|
||||
// Vertex layout: float3 Position (12 bytes) + float4 Color (16 bytes) = 28 bytes stride
|
||||
uint stride = 28;
|
||||
uint offset = vertexIndex * stride;
|
||||
|
||||
float3 pos = asfloat(buffer.Load3(offset));
|
||||
float4 col = asfloat(buffer.Load4(offset + 12));
|
||||
|
||||
// Standard row-major transformation
|
||||
output.Position = mul(ViewProjection, float4(pos, 1.0f));
|
||||
output.Color = col;
|
||||
return output;
|
||||
}
|
||||
Reference in New Issue
Block a user