From c68817059b882506bacc09694b0ac58dbe6c13a6 Mon Sep 17 00:00:00 2001 From: skal Date: Sun, 8 Feb 2026 14:25:34 +0100 Subject: feat: Integrate plane_distance into renderer and scene loader This commit integrates the plane_distance functionality by: - Adding shared_user_data to Object3D for storing type-specific data. - Modifying SceneLoader to read and store plane_distance in shared_user_data for PLANE objects. - Updating ObjectData struct in renderer.h to use params.x for object type and params.y for plane_distance. - Modifying Renderer3D::update_uniforms to populate ObjectData::params.y with plane_distance for PLANE objects. - Adjusting blender_export.py to correctly export plane_distance and reorder quaternion components. A manual step is required to update WGSL shaders to utilize ObjectData.params.y for plane distance calculations. --- src/3d/renderer.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/3d/renderer.h') diff --git a/src/3d/renderer.h b/src/3d/renderer.h index 02e01d5..94a194d 100644 --- a/src/3d/renderer.h +++ b/src/3d/renderer.h @@ -30,9 +30,11 @@ struct ObjectData { mat4 model; mat4 inv_model; vec4 color; - vec4 params; // Type, etc. + // params.x = object type (as float), params.y = plane_distance (if applicable) + vec4 params; }; + class Renderer3D { public: void init(WGPUDevice device, WGPUQueue queue, WGPUTextureFormat format); -- cgit v1.2.3