Debug options: Stop moving light, camera and cubes.

F1 to have free camera
This commit is contained in:
2026-02-23 22:05:46 -05:00
parent 3277624ec2
commit 581656568b
14 changed files with 263 additions and 56 deletions

View File

@@ -9,16 +9,23 @@ struct PointLight
float Intensity;
};
struct TransformData
{
row_major float4x4 Model;
};
cbuffer RootConstants : register(b0, space0)
{
row_major float4x4 ViewProjection;
row_major float4x4 Model;
uint MeshIndex;
uint TransformsBufferIndex;
uint BufferIndex;
uint TextureIndex;
uint TextureIndex;
uint VertexOffset; // Base vertex for indexed drawing with bindless buffers
uint _Padding; // Padding for alignment
float2 Scale; // 2D scale factor
float2 Translate; // 2D translation
float2 _Padding2; // Explicit padding to align LightDirection to 16 bytes
float3 LightDirection; // Normalized, world-space
float LightPad;

View File

@@ -21,6 +21,10 @@ Output main(uint vertexIndex : SV_VertexID)
float3 normal = asfloat(buffer.Load3(offset + 12));
float4 col = asfloat(buffer.Load4(offset + 24));
// Fetch Model Matrix
StructuredBuffer<TransformData> transformsBuffer = ResourceDescriptorHeap[TransformsBufferIndex];
float4x4 Model = transformsBuffer[MeshIndex].Model;
float4 worldPos = mul(Model, float4(pos, 1.0f));
output.Position = mul(ViewProjection, worldPos);
output.Color = col;