summaryrefslogtreecommitdiff
path: root/src/3d/renderer.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-02-02 13:34:36 +0100
committerskal <pascal.massimino@gmail.com>2026-02-02 13:34:36 +0100
commit15c4c0cf02d2b4ec8b3446bbc1805651ab312889 (patch)
tree6b46325473eff047dd89aa6f6da2bc54ba7c8d3f /src/3d/renderer.h
parent2c535b3bb4905584da9a99129dfb19976e2dabb2 (diff)
feat(3d): Implement scene query shadows (POC)
- Updated Renderer3D shader to include 'map_scene' and 'calc_shadow' functions. - Shader now iterates over all objects (up to kMaxObjects) to evaluate the scene SDF globally. - Implemented hard/soft shadows from a fixed directional light. - Updated GlobalUniforms struct with proper packing/padding for WebGPU compatibility. - Captured 'GPU BVH & Shadows' task in PROJECT_CONTEXT.md for future optimization.
Diffstat (limited to 'src/3d/renderer.h')
-rw-r--r--src/3d/renderer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/3d/renderer.h b/src/3d/renderer.h
index 453daf2..c4fec06 100644
--- a/src/3d/renderer.h
+++ b/src/3d/renderer.h
@@ -16,8 +16,8 @@
// Matches the GPU struct layout
struct GlobalUniforms {
mat4 view_proj;
- vec3 camera_pos;
- float time;
+ vec4 camera_pos_time; // xyz = camera_pos, w = time
+ vec4 params; // x = num_objects, yzw = padding
};
// Matches the GPU struct layout