summaryrefslogtreecommitdiff
path: root/src/3d/renderer.h
diff options
context:
space:
mode:
authorskal <pascal.massimino@gmail.com>2026-03-29 01:50:47 +0100
committerskal <pascal.massimino@gmail.com>2026-03-29 01:50:47 +0100
commita178de4e8680051925af9454b140343bf7eae214 (patch)
treee7c8cf472fb2ebe49ab015b2e3aecf61d2c3c6d6 /src/3d/renderer.h
parent70b77307a9a9ee4fdff23f783e041fe49e60e100 (diff)
fix(3d): restore correct orientation in test_3d_render (direct-to-surface)
Add Renderer3D::set_direct_render(bool) flag (must be set before init()). When true, uses standard CCW winding and un-negates perspective Y, restoring the pre-ba7ea27 orientation for direct-to-surface rendering where the post-process Y-flip is absent. handoff(Gemini): set_direct_render() is the escape hatch for any future renderer usage that bypasses the post-process chain.
Diffstat (limited to 'src/3d/renderer.h')
-rw-r--r--src/3d/renderer.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/3d/renderer.h b/src/3d/renderer.h
index 11a7931..8f933b5 100644
--- a/src/3d/renderer.h
+++ b/src/3d/renderer.h
@@ -78,6 +78,10 @@ class Renderer3D {
bvh_enabled_ = enabled;
}
+ // Call before init(). When true, renders directly to surface (no post-process
+ // Y-flip): uses standard perspective (Y not negated) and CCW winding.
+ void set_direct_render(bool v) { direct_render_ = v; }
+
struct MeshGpuData {
WGPUBuffer vertex_buffer;
WGPUBuffer index_buffer;
@@ -120,6 +124,7 @@ class Renderer3D {
BVH cpu_bvh_; // Keep a CPU-side copy for building/uploading
bool bvh_enabled_ = true;
+ bool direct_render_ = false; // true = render to surface (no post-process flip)
std::map<AssetId, MeshGpuData> mesh_cache_;
const MeshGpuData* temp_mesh_override_ = nullptr; // HACK for test_mesh tool