summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--PROJECT_CONTEXT.md3
-rw-r--r--TODO.md33
-rw-r--r--assets/final/demo_assets.txt3
-rw-r--r--assets/final/shaders/math/sdf_utils.wgsl8
-rw-r--r--assets/final/shaders/render/scene_query_bvh.wgsl55
-rw-r--r--assets/final/shaders/render/scene_query_linear.wgsl (renamed from assets/final/shaders/render/scene_query.wgsl)9
-rw-r--r--assets/final/shaders/renderer_3d.wgsl13
-rw-r--r--src/3d/renderer.cc189
-rw-r--r--src/3d/renderer.h21
-rw-r--r--src/generated/assets.h7
-rw-r--r--src/generated/assets_data.cc628
-rw-r--r--src/generated/test_assets.h7
-rw-r--r--src/generated/test_assets_data.cc94
-rw-r--r--src/gpu/effects/shader_composer.cc33
-rw-r--r--src/gpu/effects/shader_composer.h9
-rw-r--r--src/gpu/effects/shaders.cc6
-rw-r--r--src/tests/test_3d_physics.cc3
-rw-r--r--src/tests/test_3d_render.cc3
18 files changed, 755 insertions, 369 deletions
diff --git a/PROJECT_CONTEXT.md b/PROJECT_CONTEXT.md
index 88dfa2a..520e733 100644
--- a/PROJECT_CONTEXT.md
+++ b/PROJECT_CONTEXT.md
@@ -55,6 +55,9 @@ Style:
#### Milestone: Audio Lifecycle Refactor (February 5, 2026)
- **Task #56: AudioEngine Implementation**: Completed 4-phase refactor to eliminate fragile initialization order dependency between synth and tracker. **Phase 1 (Design & Prototype)**: Created `AudioEngine` class and `SpectrogramResourceManager` for unified lifecycle management with lazy loading. **Phase 2 (Test Migration)**: Migrated all tracker tests to use AudioEngine (test_tracker.cc, test_tracker_timing.cc, test_variable_tempo.cc, test_wav_dump.cc). **Phase 3 (Production Integration)**: Updated main.cc to use AudioEngine, fixed pre-existing procedural texture crash (flash_cube_effect.cc, hybrid_3d_effect.cc). **Phase 4 (Cleanup & Documentation)**: Removed backwards compatibility (synth_init from audio_init), updated HOWTO.md and CONTRIBUTING.md with usage patterns. Result: All 20 tests pass, binary size impact <500 bytes, initialization fragility eliminated.
+#### Milestone: Interactive Timeline Editor (February 5, 2026) 🎉
+- **Task #57 Phase 1: Production-Ready Timeline Editor**: Created fully functional web-based editor for `demo.seq` timeline files. **Core Features**: Load/save demo.seq with BPM parsing, Gantt-style visual timeline, drag & drop sequences/effects with snap-to-beat, resize handles (left/right) allowing negative relative times, stack-order based priority system (Up/Down buttons + "Same as Above" toggle), floating auto-apply properties panel, diagonal mouse wheel scroll with 10% viewport slack, dynamic sequence bounds calculation, delete/add sequences, re-order by time. **Audio Visualization**: WAV waveform display above timeline using Web Audio API, scales with zoom (pixels per second), documented integration with `--dump_wav` flag for aligning sequences with actual demo audio output. **UI Polish**: Hoverable sequence names (large centered, fades on hover), hidden scrollbars, crosshair cursor on waveform, flash animation on active sequence change, clean minimal interface. **Bug Fixes**: Resolved critical e.target vs e.currentTarget drag offset bug, fixed sequence overlap with cumulative Y positioning, corrected effect relative time calculations. **Files**: `tools/timeline_editor/index.html` (~1200 lines pure HTML/CSS/JS, no dependencies), `README.md` (usage guide, wav_dump integration docs), `ROADMAP.md` (3 phases, 117-161 hour estimate). **Next**: Phase 1.2 (Add Effect button), Phase 2.5 (music.track visualization overlay). **Impact**: Visual timeline editing now production-ready, eliminates manual text editing for sequence placement and timing adjustments.
+
- **Task #50: WGSL Modularization**: Updated `ShaderComposer` to support recursive `#include` directives, refactored the entire shader library into granular snippets (shapes, utils, lighting), and updated the 3D renderer to use this modular system. This resolved macOS shader compilation issues and significantly improved shader maintainability.
- **Task #48: Improve Audio Coverage**: Achieved 93% coverage for `src/audio/` by adding dedicated tests for DCT transforms, procedural generation, and synthesis rendering.
- **Task #47: Improve Asset Manager Coverage**: Increased `asset_manager.cc` coverage to 88% by testing runtime error paths (unknown functions, generation failure).
diff --git a/TODO.md b/TODO.md
index aecc06a..69bb111 100644
--- a/TODO.md
+++ b/TODO.md
@@ -120,6 +120,23 @@ This file tracks prioritized tasks with detailed attack plans.
- [x] **Enhanced Procedural Noise:** Implemented a multi-octave Value Noise generator for higher-quality skybox textures.
- [x] **Scene Integrity:** Restored proper object indexing and removed redundant geometry, ensuring the floor grid and objects render correctly.
+- [x] **Task #57: Interactive Timeline Editor (Phase 1 Complete)** 🎉
+ - [x] **Core Parser & Renderer**: Implemented demo.seq parser with BPM, beat notation, priority modifiers. Gantt-style timeline rendering with dynamic sequence/effect positioning.
+ - [x] **Drag & Drop**: Sequences and effects draggable along timeline with proper offset calculation. Fixed critical e.target vs e.currentTarget bug preventing erratic jumping.
+ - [x] **Resize Handles**: Left/right handles on selected effects. Allow negative relative times (effects extend before sequence start).
+ - [x] **Snap-to-Beat**: Checkbox toggle with beat markers. Automatic snapping when dragging in beat mode.
+ - [x] **Properties Panel**: Floating, collapsible panel with auto-apply (no Apply button). Properties update on input change.
+ - [x] **Stack-Order Priority**: Up/Down buttons to reorder effects within sequence. Stack position determines rendering priority (higher index = rendered later = on top).
+ - [x] **Priority Modifiers**: Toggle button for "Same as Above" (= modifier) vs "Increment" (+ modifier). Visual feedback in button text.
+ - [x] **Diagonal Scroll**: Mouse wheel navigation with 10% viewport slack. Smooth following to time-ordered sequence cascade. Flash animation on active sequence change.
+ - [x] **Dynamic Bounds**: Sequence visual bounds calculated from min/max effect times. Cumulative Y positioning prevents overlap.
+ - [x] **Waveform Visualization**: Load WAV files (via Web Audio API) and display waveform above timeline. Scales with zoom (pixels per second). Documented integration with `--dump_wav` flag.
+ - [x] **UI Polish**: Hoverable sequence names (large centered text, fades on hover). No scrollbars (hidden CSS). Clean, minimal interface.
+ - [x] **File I/O**: Load/save demo.seq files with proper serialization. BPM parsing and display. Re-order sequences by time.
+ - [x] **Delete & Add**: Delete sequences/effects. Add new sequences (at time 0, priority 0).
+ - **Result**: Fully functional timeline editor ready for production use. Phase 1.1 complete (basic editing, snap-to-beat, waveform). Phase 1.2 (Add Effect button) and Phase 2.5 (music.track visualization) documented in ROADMAP.md.
+ - **Files**: `tools/timeline_editor/index.html` (~1200 lines), `README.md`, `ROADMAP.md` (3 phases, 117-161 hour estimate).
+
## Priority 2: 3D System Enhancements (Task #18)
**Goal:** Establish a pipeline for importing complex 3D scenes to replace hardcoded geometry.
- [ ] **Task #18.0: Basic OBJ Asset Pipeline** (New)
@@ -130,10 +147,11 @@ This file tracks prioritized tasks with detailed attack plans.
- [ ] **Task #37: Asset Ingestion:** Update `asset_packer` to handle the new 3D binary format.
- [ ] **Task #38: Runtime Loader:** Implement a minimal C++ parser to load the scene data into the ECS/Renderer.
-- [ ] **Task #18-B: GPU BVH & Shadows** (Optimization)
- - [ ] **Upload BVH:** Create a storage buffer for `BVHNode` data and upload the CPU-built BVH every frame in `Renderer3D`.
- - [ ] **Shader Traversal:** Implement stack-based BVH traversal in `scene_query.wgsl` to replace the linear loop in `map_scene`.
- - [ ] **Shadow Optimization:** Use the BVH traversal for `calc_shadow` to skip occluded objects efficiently.
+- [x] **Task #18-B: GPU BVH & Shadows** (Optimization)
+ - [x] **Upload BVH:** Create a storage buffer for `BVHNode` data and upload the CPU-built BVH every frame in `Renderer3D`.
+ - [x] **Shader Traversal:** Implement stack-based BVH traversal in `scene_query.wgsl` to replace the linear loop in `map_scene`.
+ - [x] **Shadow Optimization:** Use the BVH traversal for `calc_shadow` to skip occluded objects efficiently.
+ - [x] **Compile-Time Switch:** Implemented dual-pipeline architecture (BVH vs Linear) using `ShaderComposer` substitution to avoid runtime branching cost.
## Priority 3: WGSL Modularization (Task #50) [RECURRENT]
@@ -158,6 +176,13 @@ This file tracks prioritized tasks with detailed attack plans.
- [ ] **Task #35: CRT Replacement**: investigation and implementation of CRT-free entry point.
+## Future Goals & Ideas (Untriaged)
+
+- [ ] **Task #58: Advanced Shader Factorization**: Further factorize WGSL code into smaller, reusable snippets.
+- [ ] **Task #59: Comprehensive RNG Library**: Add WGSL snippets for float/vec2/vec3 noise (Perlin, Gyroid, etc.) and random number generators.
+- [ ] **Task #60: OOP Refactoring**: Investigate if more C++ code can be made object-oriented without size penalty (vs functional style).
+- [ ] **Task #61: GPU Procedural Generation**: Implement system to generate procedural data (textures, geometry) on GPU and read back to CPU.
+
---
## Task #51: Tracker Timing Verification - Detailed Attack Plan
diff --git a/assets/final/demo_assets.txt b/assets/final/demo_assets.txt
index 5ba2ec2..c38da51 100644
--- a/assets/final/demo_assets.txt
+++ b/assets/final/demo_assets.txt
@@ -44,5 +44,6 @@ SHADER_SKYBOX, NONE, shaders/skybox.wgsl, "Skybox background shader"
SHADER_MATH_SDF_SHAPES, NONE, shaders/math/sdf_shapes.wgsl, "SDF Shapes Snippet"
SHADER_MATH_SDF_UTILS, NONE, shaders/math/sdf_utils.wgsl, "SDF Utils Snippet"
SHADER_RENDER_SHADOWS, NONE, shaders/render/shadows.wgsl, "Shadows Snippet"
-SHADER_RENDER_SCENE_QUERY, NONE, shaders/render/scene_query.wgsl, "Scene Query Snippet"
+SHADER_RENDER_SCENE_QUERY_BVH, NONE, shaders/render/scene_query_bvh.wgsl, "Scene Query Snippet (BVH)"
+SHADER_RENDER_SCENE_QUERY_LINEAR, NONE, shaders/render/scene_query_linear.wgsl, "Scene Query Snippet (Linear)"
SHADER_RENDER_LIGHTING_UTILS, NONE, shaders/render/lighting_utils.wgsl, "Lighting Utils Snippet" \ No newline at end of file
diff --git a/assets/final/shaders/math/sdf_utils.wgsl b/assets/final/shaders/math/sdf_utils.wgsl
index ce902bf..502ba5b 100644
--- a/assets/final/shaders/math/sdf_utils.wgsl
+++ b/assets/final/shaders/math/sdf_utils.wgsl
@@ -7,3 +7,11 @@ fn get_normal_basic(p: vec3<f32>, obj_type: f32) -> vec3<f32> {
get_dist(p + e.yyx, obj_type) - get_dist(p - e.yyx, obj_type)
));
}
+
+// Distance to an Axis-Aligned Bounding Box
+fn aabb_sdf(p: vec3<f32>, min_p: vec3<f32>, max_p: vec3<f32>) -> f32 {
+ let center = (min_p + max_p) * 0.5;
+ let extent = (max_p - min_p) * 0.5;
+ let q = abs(p - center) - extent;
+ return length(max(q, vec3<f32>(0.0))) + min(max(q.x, max(q.y, q.z)), 0.0);
+}
diff --git a/assets/final/shaders/render/scene_query_bvh.wgsl b/assets/final/shaders/render/scene_query_bvh.wgsl
new file mode 100644
index 0000000..c7dfdf4
--- /dev/null
+++ b/assets/final/shaders/render/scene_query_bvh.wgsl
@@ -0,0 +1,55 @@
+#include "math/sdf_shapes"
+#include "math/sdf_utils"
+
+struct BVHNode {
+ min: vec3<f32>,
+ left_idx: i32,
+ max: vec3<f32>,
+ obj_idx_or_right: i32,
+};
+
+@group(0) @binding(2) var<storage, read> bvh_nodes: array<BVHNode>;
+
+fn get_dist(p: vec3<f32>, obj_type: f32) -> f32 {
+ if (obj_type == 1.0) { return length(p) - 1.0; } // Unit Sphere
+ if (obj_type == 2.0) { return sdBox(p, vec3<f32>(1.0)); } // Unit Box
+ if (obj_type == 3.0) { return sdTorus(p, vec2<f32>(1.0, 0.4)); } // Unit Torus
+ if (obj_type == 4.0) { return sdPlane(p, vec3<f32>(0.0, 1.0, 0.0), 0.0); }
+ return 100.0;
+}
+
+fn map_scene(p: vec3<f32>, skip_idx: u32) -> f32 {
+ var d = 1000.0;
+ var stack: array<i32, 32>;
+ var stack_ptr = 0;
+
+ if (arrayLength(&bvh_nodes) > 0u) {
+ stack[stack_ptr] = 0;
+ stack_ptr++;
+ }
+
+ while (stack_ptr > 0) {
+ stack_ptr--;
+ let node_idx = stack[stack_ptr];
+ let node = bvh_nodes[node_idx];
+
+ if (aabb_sdf(p, node.min, node.max) < d) {
+ if (node.left_idx < 0) { // Leaf
+ let obj_idx = u32(node.obj_idx_or_right);
+ if (obj_idx == skip_idx) { continue; }
+ let obj = object_data.objects[obj_idx];
+ let q = (obj.inv_model * vec4<f32>(p, 1.0)).xyz;
+ let s = min(length(obj.model[0].xyz), min(length(obj.model[1].xyz), length(obj.model[2].xyz)));
+ d = min(d, get_dist(q, obj.params.x) * s);
+ } else { // Internal
+ if (stack_ptr < 31) {
+ stack[stack_ptr] = node.left_idx;
+ stack_ptr++;
+ stack[stack_ptr] = node.obj_idx_or_right;
+ stack_ptr++;
+ }
+ }
+ }
+ }
+ return d;
+}
diff --git a/assets/final/shaders/render/scene_query.wgsl b/assets/final/shaders/render/scene_query_linear.wgsl
index b58f28c..7bcd96f 100644
--- a/assets/final/shaders/render/scene_query.wgsl
+++ b/assets/final/shaders/render/scene_query_linear.wgsl
@@ -16,17 +16,10 @@ fn map_scene(p: vec3<f32>, skip_idx: u32) -> f32 {
if (i == skip_idx) { continue; }
let obj = object_data.objects[i];
let obj_type = obj.params.x;
- // Skip rasterized objects (like the floor) in the SDF map
if (obj_type <= 0.0) { continue; }
let q = (obj.inv_model * vec4<f32>(p, 1.0)).xyz;
-
- let scale_x = length(obj.model[0].xyz);
- let scale_y = length(obj.model[1].xyz);
- let scale_z = length(obj.model[2].xyz);
- // Use conservative minimum scale to avoid overstepping the distance field
- let s = min(scale_x, min(scale_y, scale_z));
-
+ let s = min(length(obj.model[0].xyz), min(length(obj.model[1].xyz), length(obj.model[2].xyz)));
d = min(d, get_dist(q, obj_type) * s);
}
return d;
diff --git a/assets/final/shaders/renderer_3d.wgsl b/assets/final/shaders/renderer_3d.wgsl
index b39525d..f855052 100644
--- a/assets/final/shaders/renderer_3d.wgsl
+++ b/assets/final/shaders/renderer_3d.wgsl
@@ -2,9 +2,12 @@
@group(0) @binding(0) var<uniform> globals: GlobalUniforms;
@group(0) @binding(1) var<storage, read> object_data: ObjectsBuffer;
-@group(0) @binding(2) var noise_tex: texture_2d<f32>;
-@group(0) @binding(3) var noise_sampler: sampler;
-@group(0) @binding(4) var sky_tex: texture_2d<f32>;
+
+// Binding 2 is reserved for BVH buffer when enabled
+
+@group(0) @binding(3) var noise_tex: texture_2d<f32>;
+@group(0) @binding(4) var noise_sampler: sampler;
+@group(0) @binding(5) var sky_tex: texture_2d<f32>;
struct VertexOutput {
@builtin(position) position: vec4<f32>,
@@ -56,7 +59,7 @@ fn vs_main(@builtin(vertex_index) vertex_index: u32,
return out;
}
-#include "render/scene_query"
+#include "render/scene_query_mode"
#include "render/shadows"
#include "render/lighting_utils"
#include "ray_box"
@@ -166,4 +169,4 @@ fn fs_main(in: VertexOutput) -> @location(0) vec4<f32> {
let shadow = calc_shadow(p, light_dir, 0.05, 20.0, in.instance_index);
let lit_color = calculate_lighting(base_color, normal, p, shadow);
return vec4<f32>(lit_color, 1.0);
-}
+} \ No newline at end of file
diff --git a/src/3d/renderer.cc b/src/3d/renderer.cc
index 684fda9..9dfc1f8 100644
--- a/src/3d/renderer.cc
+++ b/src/3d/renderer.cc
@@ -133,6 +133,8 @@ void Renderer3D::shutdown() {
wgpuSamplerRelease(default_sampler_);
if (pipeline_)
wgpuRenderPipelineRelease(pipeline_);
+ if (pipeline_no_bvh_)
+ wgpuRenderPipelineRelease(pipeline_no_bvh_);
if (bind_group_)
wgpuBindGroupRelease(bind_group_);
if (skybox_pipeline_)
@@ -143,6 +145,8 @@ void Renderer3D::shutdown() {
wgpuBufferRelease(global_uniform_buffer_);
if (object_storage_buffer_)
wgpuBufferRelease(object_storage_buffer_);
+ if (bvh_storage_buffer_)
+ wgpuBufferRelease(bvh_storage_buffer_);
if (depth_view_)
wgpuTextureViewRelease(depth_view_);
if (depth_texture_)
@@ -189,6 +193,10 @@ void Renderer3D::create_default_resources() {
WGPUBufferUsage_Storage | WGPUBufferUsage_CopyDst,
nullptr)
.buffer;
+ bvh_storage_buffer_ = gpu_create_buffer(
+ device_, sizeof(BVHNode) * kMaxObjects * 2, // Capacity for a full tree
+ WGPUBufferUsage_Storage | WGPUBufferUsage_CopyDst, nullptr)
+ .buffer;
}
void Renderer3D::set_noise_texture(WGPUTextureView noise_view) {
@@ -207,34 +215,75 @@ void Renderer3D::add_debug_aabb(const vec3& min, const vec3& max,
}
void Renderer3D::create_pipeline() {
- WGPUBindGroupLayoutEntry entries[5] = {};
- entries[0].binding = 0;
- entries[0].visibility = WGPUShaderStage_Vertex | WGPUShaderStage_Fragment;
- entries[0].buffer.type = WGPUBufferBindingType_Uniform;
- entries[0].buffer.minBindingSize = sizeof(GlobalUniforms);
+ pipeline_ = create_pipeline_impl(true); // BVH enabled
+ pipeline_no_bvh_ = create_pipeline_impl(false); // BVH disabled
+}
- entries[1].binding = 1;
- entries[1].visibility = WGPUShaderStage_Vertex | WGPUShaderStage_Fragment;
- entries[1].buffer.type = WGPUBufferBindingType_ReadOnlyStorage;
- entries[1].buffer.minBindingSize = sizeof(ObjectData) * kMaxObjects;
+WGPURenderPipeline Renderer3D::create_pipeline_impl(bool use_bvh) {
+ std::vector<WGPUBindGroupLayoutEntry> entries;
- entries[2].binding = 2;
- entries[2].visibility = WGPUShaderStage_Fragment;
- entries[2].texture.sampleType = WGPUTextureSampleType_Float;
- entries[2].texture.viewDimension = WGPUTextureViewDimension_2D;
+ // Binding 0: Global Uniforms
+ {
+ WGPUBindGroupLayoutEntry e = {};
+ e.binding = 0;
+ e.visibility = WGPUShaderStage_Vertex | WGPUShaderStage_Fragment;
+ e.buffer.type = WGPUBufferBindingType_Uniform;
+ e.buffer.minBindingSize = sizeof(GlobalUniforms);
+ entries.push_back(e);
+ }
+
+ // Binding 1: Object Data
+ {
+ WGPUBindGroupLayoutEntry e = {};
+ e.binding = 1;
+ e.visibility = WGPUShaderStage_Vertex | WGPUShaderStage_Fragment;
+ e.buffer.type = WGPUBufferBindingType_ReadOnlyStorage;
+ e.buffer.minBindingSize = sizeof(ObjectData) * kMaxObjects;
+ entries.push_back(e);
+ }
+
+ // Binding 2: BVH Nodes (only if BVH is used)
+ if (use_bvh) {
+ WGPUBindGroupLayoutEntry e = {};
+ e.binding = 2;
+ e.visibility = WGPUShaderStage_Fragment;
+ e.buffer.type = WGPUBufferBindingType_ReadOnlyStorage;
+ e.buffer.minBindingSize = sizeof(BVHNode) * kMaxObjects * 2;
+ entries.push_back(e);
+ }
- entries[3].binding = 3;
- entries[3].visibility = WGPUShaderStage_Fragment;
- entries[3].sampler.type = WGPUSamplerBindingType_Filtering;
+ // Binding 3: Noise Texture
+ {
+ WGPUBindGroupLayoutEntry e = {};
+ e.binding = 3;
+ e.visibility = WGPUShaderStage_Fragment;
+ e.texture.sampleType = WGPUTextureSampleType_Float;
+ e.texture.viewDimension = WGPUTextureViewDimension_2D;
+ entries.push_back(e);
+ }
- entries[4].binding = 4;
- entries[4].visibility = WGPUShaderStage_Fragment;
- entries[4].texture.sampleType = WGPUTextureSampleType_Float;
- entries[4].texture.viewDimension = WGPUTextureViewDimension_2D;
+ // Binding 4: Default Sampler
+ {
+ WGPUBindGroupLayoutEntry e = {};
+ e.binding = 4;
+ e.visibility = WGPUShaderStage_Fragment;
+ e.sampler.type = WGPUSamplerBindingType_Filtering;
+ entries.push_back(e);
+ }
+
+ // Binding 5: Sky Texture
+ {
+ WGPUBindGroupLayoutEntry e = {};
+ e.binding = 5;
+ e.visibility = WGPUShaderStage_Fragment;
+ e.texture.sampleType = WGPUTextureSampleType_Float;
+ e.texture.viewDimension = WGPUTextureViewDimension_2D;
+ entries.push_back(e);
+ }
WGPUBindGroupLayoutDescriptor bgl_desc = {};
- bgl_desc.entryCount = 5;
- bgl_desc.entries = entries;
+ bgl_desc.entryCount = (uint32_t)entries.size();
+ bgl_desc.entries = entries.data();
WGPUBindGroupLayout bgl = wgpuDeviceCreateBindGroupLayout(device_, &bgl_desc);
WGPUPipelineLayoutDescriptor pl_desc = {};
@@ -246,7 +295,18 @@ void Renderer3D::create_pipeline() {
const char* asset_data =
(const char*)GetAsset(AssetId::ASSET_SHADER_RENDERER_3D);
std::string main_code = asset_data;
- std::string shader_source = ShaderComposer::Get().Compose({}, main_code);
+
+ // Use ShaderComposer to dynamically include the correct scene_query snippet
+ ShaderComposer::CompositionMap composition_map;
+ if (use_bvh) {
+ composition_map["render/scene_query_mode"] = "render/scene_query_bvh";
+ } else {
+ composition_map["render/scene_query_mode"] = "render/scene_query_linear";
+ }
+ std::string shader_source = ShaderComposer::Get().Compose({}, main_code, composition_map);
+
+ // DEBUG: Print shader source to check for include errors
+ std::cout << "Shader Source (BVH=" << use_bvh << "):" << std::endl << shader_source << std::endl;
#if defined(DEMO_CROSS_COMPILE_WIN32)
WGPUShaderModuleWGSLDescriptor wgsl_desc = {};
@@ -297,10 +357,12 @@ void Renderer3D::create_pipeline() {
desc.multisample.count = 1;
desc.multisample.mask = 0xFFFFFFFF;
- pipeline_ = wgpuDeviceCreateRenderPipeline(device_, &desc);
+ WGPURenderPipeline pipeline = wgpuDeviceCreateRenderPipeline(device_, &desc);
wgpuBindGroupLayoutRelease(bgl);
wgpuPipelineLayoutRelease(pipeline_layout);
wgpuShaderModuleRelease(shader_module);
+
+ return pipeline;
}
void Renderer3D::update_uniforms(const Scene& scene, const Camera& camera,
@@ -346,6 +408,13 @@ void Renderer3D::update_uniforms(const Scene& scene, const Camera& camera,
wgpuQueueWriteBuffer(queue_, object_storage_buffer_, 0, obj_data.data(),
obj_data.size() * sizeof(ObjectData));
}
+
+ // Build and upload BVH (always uploaded, used by BVH pipeline)
+ BVHBuilder::build(cpu_bvh_, scene.objects);
+ if (!cpu_bvh_.nodes.empty()) {
+ wgpuQueueWriteBuffer(queue_, bvh_storage_buffer_, 0, cpu_bvh_.nodes.data(),
+ cpu_bvh_.nodes.size() * sizeof(BVHNode));
+ }
}
void Renderer3D::draw(WGPURenderPassEncoder pass, const Scene& scene,
@@ -357,36 +426,70 @@ void Renderer3D::draw(WGPURenderPassEncoder pass, const Scene& scene,
if (bind_group_)
wgpuBindGroupRelease(bind_group_);
- WGPUBindGroupEntry bg_entries[5] = {};
+ std::vector<WGPUBindGroupEntry> bg_entries;
+
+ {
+ WGPUBindGroupEntry e = {};
+ e.binding = 0;
+ e.buffer = global_uniform_buffer_;
+ e.size = sizeof(GlobalUniforms);
+ bg_entries.push_back(e);
+ }
- bg_entries[0].binding = 0;
- bg_entries[0].buffer = global_uniform_buffer_;
- bg_entries[0].size = sizeof(GlobalUniforms);
+ {
+ WGPUBindGroupEntry e = {};
+ e.binding = 1;
+ e.buffer = object_storage_buffer_;
+ e.size = sizeof(ObjectData) * kMaxObjects;
+ bg_entries.push_back(e);
+ }
- bg_entries[1].binding = 1;
- bg_entries[1].buffer = object_storage_buffer_;
- bg_entries[1].size = sizeof(ObjectData) * kMaxObjects;
+ if (bvh_enabled_) {
+ WGPUBindGroupEntry e = {};
+ e.binding = 2;
+ e.buffer = bvh_storage_buffer_;
+ e.size = sizeof(BVHNode) * kMaxObjects * 2;
+ bg_entries.push_back(e);
+ }
- bg_entries[2].binding = 2;
- bg_entries[2].textureView = noise_texture_view_;
+ {
+ WGPUBindGroupEntry e = {};
+ e.binding = 3;
+ e.textureView = noise_texture_view_;
+ bg_entries.push_back(e);
+ }
- bg_entries[3].binding = 3;
- bg_entries[3].sampler = default_sampler_;
+ {
+ WGPUBindGroupEntry e = {};
+ e.binding = 4;
+ e.sampler = default_sampler_;
+ bg_entries.push_back(e);
+ }
+
+ {
+ WGPUBindGroupEntry e = {};
+ e.binding = 5;
+ e.textureView =
+ sky_texture_view_ ? sky_texture_view_ : noise_texture_view_;
+ bg_entries.push_back(e);
+ }
- bg_entries[4].binding = 4;
- bg_entries[4].textureView =
- sky_texture_view_ ? sky_texture_view_ : noise_texture_view_; // Fallback
+ // Select the correct pipeline and bind group layout
+ WGPURenderPipeline current_pipeline =
+ bvh_enabled_ ? pipeline_ : pipeline_no_bvh_;
+ WGPUBindGroupLayout current_layout =
+ wgpuRenderPipelineGetBindGroupLayout(current_pipeline, 0);
WGPUBindGroupDescriptor bg_desc = {};
- bg_desc.layout = wgpuRenderPipelineGetBindGroupLayout(pipeline_, 0);
- bg_desc.entryCount = 5;
- bg_desc.entries = bg_entries;
+ bg_desc.layout = current_layout;
+ bg_desc.entryCount = (uint32_t)bg_entries.size();
+ bg_desc.entries = bg_entries.data();
bind_group_ = wgpuDeviceCreateBindGroup(device_, &bg_desc);
- wgpuBindGroupLayoutRelease(bg_desc.layout);
+ wgpuBindGroupLayoutRelease(current_layout);
- wgpuRenderPassEncoderSetPipeline(pass, pipeline_);
+ wgpuRenderPassEncoderSetPipeline(pass, current_pipeline);
wgpuRenderPassEncoderSetBindGroup(pass, 0, bind_group_, 0, nullptr);
diff --git a/src/3d/renderer.h b/src/3d/renderer.h
index 8068bdc..db86b72 100644
--- a/src/3d/renderer.h
+++ b/src/3d/renderer.h
@@ -6,6 +6,7 @@
#include "3d/camera.h"
#include "3d/scene.h"
+#include "3d/bvh.h"
#include "gpu/gpu.h"
#include <vector>
@@ -43,19 +44,12 @@ class Renderer3D {
#endif
// Renders the scene to the given texture view (Convenience: creates a pass)
-
void render(const Scene& scene, const Camera& camera, float time,
-
WGPUTextureView target_view,
WGPUTextureView depth_view_opt = nullptr);
// Records draw commands to an existing pass.
-
// Assumes the pass has a compatible pipeline (or we set it here).
-
- // Note: Caller must ensure depth/color attachments are set up correctly in
- // the pass.
-
void draw(WGPURenderPassEncoder pass, const Scene& scene,
const Camera& camera, float time);
@@ -67,8 +61,12 @@ class Renderer3D {
// Resize handler (if needed for internal buffers)
void resize(int width, int height);
+ // Set whether to use BVH acceleration
+ void SetBvhEnabled(bool enabled) { bvh_enabled_ = enabled; }
+
private:
void create_pipeline();
+ WGPURenderPipeline create_pipeline_impl(bool use_bvh);
void create_skybox_pipeline();
void create_default_resources();
void update_uniforms(const Scene& scene, const Camera& camera, float time);
@@ -77,12 +75,17 @@ class Renderer3D {
WGPUQueue queue_ = nullptr;
WGPUTextureFormat format_ = WGPUTextureFormat_Undefined;
- WGPURenderPipeline pipeline_ = nullptr;
+ WGPURenderPipeline pipeline_ = nullptr; // BVH enabled
+ WGPURenderPipeline pipeline_no_bvh_ = nullptr; // BVH disabled
WGPUBindGroup bind_group_ = nullptr;
WGPURenderPipeline skybox_pipeline_ = nullptr;
WGPUBindGroup skybox_bind_group_ = nullptr;
WGPUBuffer global_uniform_buffer_ = nullptr;
WGPUBuffer object_storage_buffer_ = nullptr;
+ WGPUBuffer bvh_storage_buffer_ = nullptr;
+
+ BVH cpu_bvh_; // Keep a CPU-side copy for building/uploading
+ bool bvh_enabled_ = true;
WGPUTextureView noise_texture_view_ = nullptr;
WGPUTextureView sky_texture_view_ = nullptr;
@@ -101,4 +104,4 @@ class Renderer3D {
VisualDebug visual_debug_;
static bool s_debug_enabled_;
#endif
-};
+}; \ No newline at end of file
diff --git a/src/generated/assets.h b/src/generated/assets.h
index cda571b..7a4f449 100644
--- a/src/generated/assets.h
+++ b/src/generated/assets.h
@@ -41,9 +41,10 @@ enum class AssetId : uint16_t {
ASSET_SHADER_MATH_SDF_SHAPES = 34,
ASSET_SHADER_MATH_SDF_UTILS = 35,
ASSET_SHADER_RENDER_SHADOWS = 36,
- ASSET_SHADER_RENDER_SCENE_QUERY = 37,
- ASSET_SHADER_RENDER_LIGHTING_UTILS = 38,
- ASSET_LAST_ID = 39,
+ ASSET_SHADER_RENDER_SCENE_QUERY_BVH = 37,
+ ASSET_SHADER_RENDER_SCENE_QUERY_LINEAR = 38,
+ ASSET_SHADER_RENDER_LIGHTING_UTILS = 39,
+ ASSET_LAST_ID = 40,
};
#include "util/asset_manager.h"
diff --git a/src/generated/assets_data.cc b/src/generated/assets_data.cc
index 8bcd6d5..b6a3c7b 100644
--- a/src/generated/assets_data.cc
+++ b/src/generated/assets_data.cc
@@ -369584,7 +369584,7 @@ static const float ASSET_PROC_PARAMS_NOISE_TEX[] = {1234.000000, 16.000000};
static const char* ASSET_PROC_FUNC_STR_NOISE_TEX = "gen_noise";
-const size_t ASSET_SIZE_SHADER_RENDERER_3D = 7477;
+const size_t ASSET_SIZE_SHADER_RENDERER_3D = 7536;
alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDERER_3D[] = {
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x63, 0x6f,
0x6d, 0x6d, 0x6f, 0x6e, 0x5f, 0x75, 0x6e, 0x69, 0x66, 0x6f, 0x72, 0x6d,
@@ -369599,187 +369599,192 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDERER_3D[] = {
0x65, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x3e, 0x20, 0x6f, 0x62, 0x6a,
0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x3a, 0x20, 0x4f, 0x62,
0x6a, 0x65, 0x63, 0x74, 0x73, 0x42, 0x75, 0x66, 0x66, 0x65, 0x72, 0x3b,
- 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x29, 0x20, 0x40,
- 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x32, 0x29, 0x20, 0x76,
- 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x69, 0x73, 0x65, 0x5f, 0x74, 0x65, 0x78,
- 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x32, 0x64,
- 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x3b, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75,
- 0x70, 0x28, 0x30, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e,
- 0x67, 0x28, 0x33, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x69,
- 0x73, 0x65, 0x5f, 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x3a, 0x20,
- 0x73, 0x61, 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x3b, 0x0a, 0x40, 0x67, 0x72,
- 0x6f, 0x75, 0x70, 0x28, 0x30, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64,
- 0x69, 0x6e, 0x67, 0x28, 0x34, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x73,
- 0x6b, 0x79, 0x5f, 0x74, 0x65, 0x78, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74,
- 0x75, 0x72, 0x65, 0x5f, 0x32, 0x64, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x3b,
- 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74, 0x20, 0x56, 0x65, 0x72,
- 0x74, 0x65, 0x78, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e,
- 0x28, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x20, 0x70,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x3a, 0x20, 0x76, 0x65, 0x63,
- 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
- 0x40, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x30, 0x29,
- 0x20, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x73, 0x3a, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20,
- 0x20, 0x20, 0x20, 0x40, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e,
- 0x28, 0x31, 0x29, 0x20, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76,
- 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x40, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28,
- 0x32, 0x29, 0x20, 0x40, 0x69, 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c,
- 0x61, 0x74, 0x65, 0x28, 0x66, 0x6c, 0x61, 0x74, 0x29, 0x20, 0x69, 0x6e,
- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78,
- 0x3a, 0x20, 0x75, 0x33, 0x32, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x40,
- 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x33, 0x29, 0x20,
- 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x3a, 0x20, 0x76,
- 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x7d, 0x3b,
- 0x0a, 0x0a, 0x40, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x0a, 0x66, 0x6e,
- 0x20, 0x76, 0x73, 0x5f, 0x6d, 0x61, 0x69, 0x6e, 0x28, 0x40, 0x62, 0x75,
- 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78,
- 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x20, 0x76, 0x65, 0x72, 0x74,
- 0x65, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x75, 0x33,
- 0x32, 0x2c, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28,
- 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64,
- 0x65, 0x78, 0x29, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,
- 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x75, 0x33, 0x32, 0x29,
- 0x20, 0x2d, 0x3e, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x4f, 0x75,
- 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x70, 0x6f, 0x73, 0x20,
- 0x3d, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79, 0x3c, 0x76, 0x65, 0x63, 0x33,
- 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x20, 0x33, 0x36, 0x3e, 0x28, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33,
- 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c,
- 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e,
- 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e,
- 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20,
- 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20,
- 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20,
- 0x20, 0x20, 0x20, 0x29, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76,
- 0x61, 0x72, 0x20, 0x70, 0x20, 0x3d, 0x20, 0x70, 0x6f, 0x73, 0x5b, 0x76,
- 0x65, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5d,
- 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6f, 0x62,
- 0x6a, 0x20, 0x3d, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64,
- 0x61, 0x74, 0x61, 0x2e, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5b,
- 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64,
- 0x65, 0x78, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74,
- 0x20, 0x6f, 0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20,
- 0x6f, 0x62, 0x6a, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78,
- 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x69,
- 0x67, 0x68, 0x74, 0x20, 0x66, 0x69, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20,
- 0x54, 0x6f, 0x72, 0x75, 0x73, 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x20,
- 0x68, 0x75, 0x6c, 0x6c, 0x20, 0x28, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20,
- 0x72, 0x61, 0x64, 0x69, 0x75, 0x73, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
- 0x6d, 0x69, 0x6e, 0x6f, 0x72, 0x20, 0x30, 0x2e, 0x34, 0x29, 0x0a, 0x20,
- 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6f, 0x62, 0x6a, 0x5f, 0x74,
- 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x20,
- 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x2e,
- 0x78, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x31, 0x2e,
- 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70,
- 0x2e, 0x7a, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x7a, 0x20, 0x2a, 0x20, 0x31,
- 0x2e, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x70, 0x2e, 0x79, 0x20, 0x3d, 0x20, 0x70, 0x2e, 0x79, 0x20, 0x2a, 0x20,
- 0x30, 0x2e, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6c,
- 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x6f, 0x62, 0x6a, 0x2e,
- 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x2a, 0x20, 0x76, 0x65, 0x63, 0x34,
- 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x70, 0x2c, 0x20, 0x31, 0x2e, 0x30,
- 0x29, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x63,
- 0x6c, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x67, 0x6c,
- 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x2e, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70,
- 0x72, 0x6f, 0x6a, 0x20, 0x2a, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f,
- 0x70, 0x6f, 0x73, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61,
- 0x72, 0x20, 0x6f, 0x75, 0x74, 0x3a, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65,
- 0x78, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20,
- 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f,
- 0x6e, 0x20, 0x3d, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x73,
- 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x6c, 0x6f,
- 0x63, 0x61, 0x6c, 0x5f, 0x70, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x70, 0x3b,
- 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x63, 0x6f,
- 0x6c, 0x6f, 0x72, 0x20, 0x3d, 0x20, 0x6f, 0x62, 0x6a, 0x2e, 0x63, 0x6f,
- 0x6c, 0x6f, 0x72, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74,
- 0x2e, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e,
- 0x64, 0x65, 0x78, 0x20, 0x3d, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,
- 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3b, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f,
- 0x70, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f,
- 0x70, 0x6f, 0x73, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20,
- 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b,
- 0x0a, 0x7d, 0x0a, 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65,
- 0x20, 0x22, 0x72, 0x65, 0x6e, 0x64, 0x65, 0x72, 0x2f, 0x73, 0x63, 0x65,
- 0x6e, 0x65, 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x22, 0x0a, 0x23, 0x69,
+ 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x42, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67,
+ 0x20, 0x32, 0x20, 0x69, 0x73, 0x20, 0x72, 0x65, 0x73, 0x65, 0x72, 0x76,
+ 0x65, 0x64, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x42, 0x56, 0x48, 0x20, 0x62,
+ 0x75, 0x66, 0x66, 0x65, 0x72, 0x20, 0x77, 0x68, 0x65, 0x6e, 0x20, 0x65,
+ 0x6e, 0x61, 0x62, 0x6c, 0x65, 0x64, 0x0a, 0x0a, 0x40, 0x67, 0x72, 0x6f,
+ 0x75, 0x70, 0x28, 0x30, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69,
+ 0x6e, 0x67, 0x28, 0x33, 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f,
+ 0x69, 0x73, 0x65, 0x5f, 0x74, 0x65, 0x78, 0x3a, 0x20, 0x74, 0x65, 0x78,
+ 0x74, 0x75, 0x72, 0x65, 0x5f, 0x32, 0x64, 0x3c, 0x66, 0x33, 0x32, 0x3e,
+ 0x3b, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30, 0x29, 0x20,
+ 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x34, 0x29, 0x20,
+ 0x76, 0x61, 0x72, 0x20, 0x6e, 0x6f, 0x69, 0x73, 0x65, 0x5f, 0x73, 0x61,
+ 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x3a, 0x20, 0x73, 0x61, 0x6d, 0x70, 0x6c,
+ 0x65, 0x72, 0x3b, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28, 0x30,
+ 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28, 0x35,
+ 0x29, 0x20, 0x76, 0x61, 0x72, 0x20, 0x73, 0x6b, 0x79, 0x5f, 0x74, 0x65,
+ 0x78, 0x3a, 0x20, 0x74, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x5f, 0x32,
+ 0x64, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x3b, 0x0a, 0x0a, 0x73, 0x74, 0x72,
+ 0x75, 0x63, 0x74, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x4f, 0x75,
+ 0x74, 0x70, 0x75, 0x74, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x40,
+ 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x70, 0x6f, 0x73, 0x69,
+ 0x74, 0x69, 0x6f, 0x6e, 0x29, 0x20, 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69,
+ 0x6f, 0x6e, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32,
+ 0x3e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x40, 0x6c, 0x6f, 0x63, 0x61,
+ 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x30, 0x29, 0x20, 0x6c, 0x6f, 0x63, 0x61,
+ 0x6c, 0x5f, 0x70, 0x6f, 0x73, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c,
+ 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x40, 0x6c,
+ 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x31, 0x29, 0x20, 0x63,
+ 0x6f, 0x6c, 0x6f, 0x72, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66,
+ 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x40, 0x6c, 0x6f,
+ 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x28, 0x32, 0x29, 0x20, 0x40, 0x69,
+ 0x6e, 0x74, 0x65, 0x72, 0x70, 0x6f, 0x6c, 0x61, 0x74, 0x65, 0x28, 0x66,
+ 0x6c, 0x61, 0x74, 0x29, 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,
+ 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x3a, 0x20, 0x75, 0x33, 0x32,
+ 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x40, 0x6c, 0x6f, 0x63, 0x61, 0x74,
+ 0x69, 0x6f, 0x6e, 0x28, 0x33, 0x29, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64,
+ 0x5f, 0x70, 0x6f, 0x73, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x66,
+ 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x40, 0x76, 0x65,
+ 0x72, 0x74, 0x65, 0x78, 0x0a, 0x66, 0x6e, 0x20, 0x76, 0x73, 0x5f, 0x6d,
+ 0x61, 0x69, 0x6e, 0x28, 0x40, 0x62, 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e,
+ 0x28, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x29, 0x20, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78, 0x5f, 0x69, 0x6e,
+ 0x64, 0x65, 0x78, 0x3a, 0x20, 0x75, 0x33, 0x32, 0x2c, 0x20, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x40, 0x62,
+ 0x75, 0x69, 0x6c, 0x74, 0x69, 0x6e, 0x28, 0x69, 0x6e, 0x73, 0x74, 0x61,
+ 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x29, 0x20, 0x69,
+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65,
+ 0x78, 0x3a, 0x20, 0x75, 0x33, 0x32, 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x56,
+ 0x65, 0x72, 0x74, 0x65, 0x78, 0x4f, 0x75, 0x74, 0x70, 0x75, 0x74, 0x20,
+ 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76,
+ 0x61, 0x72, 0x20, 0x70, 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x61, 0x72, 0x72,
+ 0x61, 0x79, 0x3c, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e,
+ 0x2c, 0x20, 0x33, 0x36, 0x3e, 0x28, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28, 0x20, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30,
+ 0x29, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x28, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31,
+ 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x20, 0x31, 0x2e, 0x30, 0x29, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x28,
+ 0x2d, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20,
+ 0x2d, 0x31, 0x2e, 0x30, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x29, 0x3b,
+ 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x70, 0x20,
+ 0x3d, 0x20, 0x70, 0x6f, 0x73, 0x5b, 0x76, 0x65, 0x72, 0x74, 0x65, 0x78,
+ 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6f, 0x62, 0x6a, 0x20, 0x3d, 0x20, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5b, 0x69, 0x6e, 0x73, 0x74, 0x61,
+ 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x5d, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6f, 0x62, 0x6a, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x6f, 0x62, 0x6a, 0x2e, 0x70,
+ 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x3b, 0x0a, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x54, 0x69, 0x67, 0x68, 0x74, 0x20, 0x66,
+ 0x69, 0x74, 0x20, 0x66, 0x6f, 0x72, 0x20, 0x54, 0x6f, 0x72, 0x75, 0x73,
+ 0x20, 0x70, 0x72, 0x6f, 0x78, 0x79, 0x20, 0x68, 0x75, 0x6c, 0x6c, 0x20,
+ 0x28, 0x6d, 0x61, 0x6a, 0x6f, 0x72, 0x20, 0x72, 0x61, 0x64, 0x69, 0x75,
+ 0x73, 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x6d, 0x69, 0x6e, 0x6f, 0x72,
+ 0x20, 0x30, 0x2e, 0x34, 0x29, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66,
+ 0x20, 0x28, 0x6f, 0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d,
+ 0x3d, 0x20, 0x33, 0x2e, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x2e, 0x78, 0x20, 0x3d, 0x20, 0x70,
+ 0x2e, 0x78, 0x20, 0x2a, 0x20, 0x31, 0x2e, 0x35, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x2e, 0x7a, 0x20, 0x3d, 0x20,
+ 0x70, 0x2e, 0x7a, 0x20, 0x2a, 0x20, 0x31, 0x2e, 0x35, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x70, 0x2e, 0x79, 0x20, 0x3d,
+ 0x20, 0x70, 0x2e, 0x79, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c,
+ 0x65, 0x74, 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x73,
+ 0x20, 0x3d, 0x20, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x20, 0x2a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e,
+ 0x28, 0x70, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x63, 0x6c, 0x69, 0x70, 0x5f, 0x70,
+ 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x67, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73,
+ 0x2e, 0x76, 0x69, 0x65, 0x77, 0x5f, 0x70, 0x72, 0x6f, 0x6a, 0x20, 0x2a,
+ 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x3b, 0x0a,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x6f, 0x75, 0x74,
+ 0x3a, 0x20, 0x56, 0x65, 0x72, 0x74, 0x65, 0x78, 0x4f, 0x75, 0x74, 0x70,
+ 0x75, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e,
+ 0x70, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x20, 0x3d, 0x20, 0x63,
+ 0x6c, 0x69, 0x70, 0x5f, 0x70, 0x6f, 0x73, 0x3b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x5f, 0x70,
+ 0x6f, 0x73, 0x20, 0x3d, 0x20, 0x70, 0x3b, 0x20, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x20, 0x3d,
+ 0x20, 0x6f, 0x62, 0x6a, 0x2e, 0x63, 0x6f, 0x6c, 0x6f, 0x72, 0x3b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74, 0x2e, 0x69, 0x6e, 0x73, 0x74,
+ 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x20, 0x3d,
+ 0x20, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x5f, 0x69, 0x6e,
+ 0x64, 0x65, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6f, 0x75, 0x74,
+ 0x2e, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x20, 0x3d,
+ 0x20, 0x77, 0x6f, 0x72, 0x6c, 0x64, 0x5f, 0x70, 0x6f, 0x73, 0x2e, 0x78,
+ 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75,
+ 0x72, 0x6e, 0x20, 0x6f, 0x75, 0x74, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x23,
+ 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x72, 0x65, 0x6e,
+ 0x64, 0x65, 0x72, 0x2f, 0x73, 0x63, 0x65, 0x6e, 0x65, 0x5f, 0x71, 0x75,
+ 0x65, 0x72, 0x79, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x22, 0x0a, 0x23, 0x69,
0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x72, 0x65, 0x6e, 0x64,
0x65, 0x72, 0x2f, 0x73, 0x68, 0x61, 0x64, 0x6f, 0x77, 0x73, 0x22, 0x0a,
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x72, 0x65,
@@ -370209,7 +370214,7 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDERER_3D[] = {
0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x76, 0x65, 0x63, 0x34,
0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x6c, 0x69, 0x74, 0x5f, 0x63, 0x6f,
0x6c, 0x6f, 0x72, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x7d,
- 0x0a, 0x00
+ 0x00
};
const size_t ASSET_SIZE_SHADER_COMMON_UNIFORMS = 346;
alignas(16) static const uint8_t ASSET_DATA_SHADER_COMMON_UNIFORMS[] = {
@@ -371636,7 +371641,7 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_MATH_SDF_SHAPES[] = {
0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x6f, 0x74, 0x28, 0x70, 0x2c, 0x20,
0x6e, 0x29, 0x20, 0x2b, 0x20, 0x68, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
};
-const size_t ASSET_SIZE_SHADER_MATH_SDF_UTILS = 403;
+const size_t ASSET_SIZE_SHADER_MATH_SDF_UTILS = 718;
alignas(16) static const uint8_t ASSET_DATA_SHADER_MATH_SDF_UTILS[] = {
0x66, 0x6e, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x6e, 0x6f, 0x72, 0x6d, 0x61,
0x6c, 0x5f, 0x62, 0x61, 0x73, 0x69, 0x63, 0x28, 0x70, 0x3a, 0x20, 0x76,
@@ -371671,7 +371676,33 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_MATH_SDF_UTILS[] = {
0x20, 0x2d, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x73, 0x74, 0x28,
0x70, 0x20, 0x2d, 0x20, 0x65, 0x2e, 0x79, 0x79, 0x78, 0x2c, 0x20, 0x6f,
0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x29, 0x0a, 0x20, 0x20, 0x20,
- 0x20, 0x29, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
+ 0x20, 0x29, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x2f, 0x2f, 0x20, 0x44,
+ 0x69, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61,
+ 0x6e, 0x20, 0x41, 0x78, 0x69, 0x73, 0x2d, 0x41, 0x6c, 0x69, 0x67, 0x6e,
+ 0x65, 0x64, 0x20, 0x42, 0x6f, 0x75, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x20,
+ 0x42, 0x6f, 0x78, 0x0a, 0x66, 0x6e, 0x20, 0x61, 0x61, 0x62, 0x62, 0x5f,
+ 0x73, 0x64, 0x66, 0x28, 0x70, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c,
+ 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x20, 0x6d, 0x69, 0x6e, 0x5f, 0x70, 0x3a,
+ 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x20,
+ 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c,
+ 0x66, 0x33, 0x32, 0x3e, 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x66, 0x33, 0x32,
+ 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x63,
+ 0x65, 0x6e, 0x74, 0x65, 0x72, 0x20, 0x3d, 0x20, 0x28, 0x6d, 0x69, 0x6e,
+ 0x5f, 0x70, 0x20, 0x2b, 0x20, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x29, 0x20,
+ 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c,
+ 0x65, 0x74, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x20, 0x3d, 0x20,
+ 0x28, 0x6d, 0x61, 0x78, 0x5f, 0x70, 0x20, 0x2d, 0x20, 0x6d, 0x69, 0x6e,
+ 0x5f, 0x70, 0x29, 0x20, 0x2a, 0x20, 0x30, 0x2e, 0x35, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x71, 0x20, 0x3d, 0x20, 0x61,
+ 0x62, 0x73, 0x28, 0x70, 0x20, 0x2d, 0x20, 0x63, 0x65, 0x6e, 0x74, 0x65,
+ 0x72, 0x29, 0x20, 0x2d, 0x20, 0x65, 0x78, 0x74, 0x65, 0x6e, 0x74, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x6d, 0x61, 0x78, 0x28, 0x71,
+ 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28,
+ 0x30, 0x2e, 0x30, 0x29, 0x29, 0x29, 0x20, 0x2b, 0x20, 0x6d, 0x69, 0x6e,
+ 0x28, 0x6d, 0x61, 0x78, 0x28, 0x71, 0x2e, 0x78, 0x2c, 0x20, 0x6d, 0x61,
+ 0x78, 0x28, 0x71, 0x2e, 0x79, 0x2c, 0x20, 0x71, 0x2e, 0x7a, 0x29, 0x29,
+ 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
};
const size_t ASSET_SIZE_SHADER_RENDER_SHADOWS = 441;
alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_SHADOWS[] = {
@@ -371713,8 +371744,160 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_SHADOWS[] = {
0x6d, 0x70, 0x28, 0x72, 0x65, 0x73, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x2c,
0x20, 0x31, 0x2e, 0x30, 0x29, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
};
-const size_t ASSET_SIZE_SHADER_RENDER_SCENE_QUERY = 1220;
-alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_SCENE_QUERY[] = {
+const size_t ASSET_SIZE_SHADER_RENDER_SCENE_QUERY_BVH = 1782;
+alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_SCENE_QUERY_BVH[] = {
+ 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x6d, 0x61,
+ 0x74, 0x68, 0x2f, 0x73, 0x64, 0x66, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65,
+ 0x73, 0x22, 0x0a, 0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20,
+ 0x22, 0x6d, 0x61, 0x74, 0x68, 0x2f, 0x73, 0x64, 0x66, 0x5f, 0x75, 0x74,
+ 0x69, 0x6c, 0x73, 0x22, 0x0a, 0x0a, 0x73, 0x74, 0x72, 0x75, 0x63, 0x74,
+ 0x20, 0x42, 0x56, 0x48, 0x4e, 0x6f, 0x64, 0x65, 0x20, 0x7b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x6d, 0x69, 0x6e, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33,
+ 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6c,
+ 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x78, 0x3a, 0x20, 0x69, 0x33, 0x32,
+ 0x2c, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x6d, 0x61, 0x78, 0x3a, 0x20, 0x76,
+ 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x6f, 0x62, 0x6a, 0x5f, 0x69, 0x64, 0x78, 0x5f, 0x6f, 0x72,
+ 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x3a, 0x20, 0x69, 0x33, 0x32, 0x2c,
+ 0x0a, 0x7d, 0x3b, 0x0a, 0x0a, 0x40, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x28,
+ 0x30, 0x29, 0x20, 0x40, 0x62, 0x69, 0x6e, 0x64, 0x69, 0x6e, 0x67, 0x28,
+ 0x32, 0x29, 0x20, 0x76, 0x61, 0x72, 0x3c, 0x73, 0x74, 0x6f, 0x72, 0x61,
+ 0x67, 0x65, 0x2c, 0x20, 0x72, 0x65, 0x61, 0x64, 0x3e, 0x20, 0x62, 0x76,
+ 0x68, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x3a, 0x20, 0x61, 0x72, 0x72,
+ 0x61, 0x79, 0x3c, 0x42, 0x56, 0x48, 0x4e, 0x6f, 0x64, 0x65, 0x3e, 0x3b,
+ 0x0a, 0x0a, 0x66, 0x6e, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x73,
+ 0x74, 0x28, 0x70, 0x3a, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c, 0x66, 0x33,
+ 0x32, 0x3e, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65,
+ 0x3a, 0x20, 0x66, 0x33, 0x32, 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x66, 0x33,
+ 0x32, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28,
+ 0x6f, 0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20,
+ 0x31, 0x2e, 0x30, 0x29, 0x20, 0x7b, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72,
+ 0x6e, 0x20, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x70, 0x29, 0x20,
+ 0x2d, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x20, 0x7d, 0x20, 0x2f, 0x2f, 0x20,
+ 0x55, 0x6e, 0x69, 0x74, 0x20, 0x53, 0x70, 0x68, 0x65, 0x72, 0x65, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6f, 0x62, 0x6a, 0x5f,
+ 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x32, 0x2e, 0x30, 0x29,
+ 0x20, 0x7b, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73, 0x64,
+ 0x42, 0x6f, 0x78, 0x28, 0x70, 0x2c, 0x20, 0x76, 0x65, 0x63, 0x33, 0x3c,
+ 0x66, 0x33, 0x32, 0x3e, 0x28, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x3b, 0x20,
+ 0x7d, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x20, 0x42, 0x6f,
+ 0x78, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6f, 0x62,
+ 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x33, 0x2e,
+ 0x30, 0x29, 0x20, 0x7b, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20,
+ 0x73, 0x64, 0x54, 0x6f, 0x72, 0x75, 0x73, 0x28, 0x70, 0x2c, 0x20, 0x76,
+ 0x65, 0x63, 0x32, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x31, 0x2e, 0x30,
+ 0x2c, 0x20, 0x30, 0x2e, 0x34, 0x29, 0x29, 0x3b, 0x20, 0x7d, 0x20, 0x2f,
+ 0x2f, 0x20, 0x55, 0x6e, 0x69, 0x74, 0x20, 0x54, 0x6f, 0x72, 0x75, 0x73,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6f, 0x62, 0x6a,
+ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x3d, 0x20, 0x34, 0x2e, 0x30,
+ 0x29, 0x20, 0x7b, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x73,
+ 0x64, 0x50, 0x6c, 0x61, 0x6e, 0x65, 0x28, 0x70, 0x2c, 0x20, 0x76, 0x65,
+ 0x63, 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x30, 0x2e, 0x30, 0x2c,
+ 0x20, 0x31, 0x2e, 0x30, 0x2c, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x2c, 0x20,
+ 0x30, 0x2e, 0x30, 0x29, 0x3b, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x30, 0x30, 0x2e, 0x30,
+ 0x3b, 0x0a, 0x7d, 0x0a, 0x0a, 0x66, 0x6e, 0x20, 0x6d, 0x61, 0x70, 0x5f,
+ 0x73, 0x63, 0x65, 0x6e, 0x65, 0x28, 0x70, 0x3a, 0x20, 0x76, 0x65, 0x63,
+ 0x33, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x2c, 0x20, 0x73, 0x6b, 0x69, 0x70,
+ 0x5f, 0x69, 0x64, 0x78, 0x3a, 0x20, 0x75, 0x33, 0x32, 0x29, 0x20, 0x2d,
+ 0x3e, 0x20, 0x66, 0x33, 0x32, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x76, 0x61, 0x72, 0x20, 0x64, 0x20, 0x3d, 0x20, 0x31, 0x30, 0x30, 0x30,
+ 0x2e, 0x30, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20,
+ 0x73, 0x74, 0x61, 0x63, 0x6b, 0x3a, 0x20, 0x61, 0x72, 0x72, 0x61, 0x79,
+ 0x3c, 0x69, 0x33, 0x32, 0x2c, 0x20, 0x33, 0x32, 0x3e, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x76, 0x61, 0x72, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b,
+ 0x5f, 0x70, 0x74, 0x72, 0x20, 0x3d, 0x20, 0x30, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x61,
+ 0x72, 0x72, 0x61, 0x79, 0x4c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x26,
+ 0x62, 0x76, 0x68, 0x5f, 0x6e, 0x6f, 0x64, 0x65, 0x73, 0x29, 0x20, 0x3e,
+ 0x20, 0x30, 0x75, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5b, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x5f, 0x70, 0x74, 0x72, 0x5d, 0x20, 0x3d, 0x20, 0x30, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x61,
+ 0x63, 0x6b, 0x5f, 0x70, 0x74, 0x72, 0x2b, 0x2b, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x7d, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x77, 0x68, 0x69,
+ 0x6c, 0x65, 0x20, 0x28, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70, 0x74,
+ 0x72, 0x20, 0x3e, 0x20, 0x30, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70,
+ 0x74, 0x72, 0x2d, 0x2d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69,
+ 0x64, 0x78, 0x20, 0x3d, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5b, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70, 0x74, 0x72, 0x5d, 0x3b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6e,
+ 0x6f, 0x64, 0x65, 0x20, 0x3d, 0x20, 0x62, 0x76, 0x68, 0x5f, 0x6e, 0x6f,
+ 0x64, 0x65, 0x73, 0x5b, 0x6e, 0x6f, 0x64, 0x65, 0x5f, 0x69, 0x64, 0x78,
+ 0x5d, 0x3b, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x69, 0x66, 0x20, 0x28, 0x61, 0x61, 0x62, 0x62, 0x5f, 0x73, 0x64, 0x66,
+ 0x28, 0x70, 0x2c, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6d, 0x69, 0x6e,
+ 0x2c, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6d, 0x61, 0x78, 0x29, 0x20,
+ 0x3c, 0x20, 0x64, 0x29, 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6e,
+ 0x6f, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74, 0x5f, 0x69, 0x64, 0x78,
+ 0x20, 0x3c, 0x20, 0x30, 0x29, 0x20, 0x7b, 0x20, 0x2f, 0x2f, 0x20, 0x4c,
+ 0x65, 0x61, 0x66, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20,
+ 0x6f, 0x62, 0x6a, 0x5f, 0x69, 0x64, 0x78, 0x20, 0x3d, 0x20, 0x75, 0x33,
+ 0x32, 0x28, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6f, 0x62, 0x6a, 0x5f, 0x69,
+ 0x64, 0x78, 0x5f, 0x6f, 0x72, 0x5f, 0x72, 0x69, 0x67, 0x68, 0x74, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6f, 0x62,
+ 0x6a, 0x5f, 0x69, 0x64, 0x78, 0x20, 0x3d, 0x3d, 0x20, 0x73, 0x6b, 0x69,
+ 0x70, 0x5f, 0x69, 0x64, 0x78, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x6e,
+ 0x74, 0x69, 0x6e, 0x75, 0x65, 0x3b, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6f, 0x62, 0x6a, 0x20, 0x3d, 0x20, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x2e, 0x6f,
+ 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x5b, 0x6f, 0x62, 0x6a, 0x5f, 0x69,
+ 0x64, 0x78, 0x5d, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74,
+ 0x20, 0x71, 0x20, 0x3d, 0x20, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x69, 0x6e,
+ 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x2a, 0x20, 0x76, 0x65,
+ 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x70, 0x2c, 0x20, 0x31,
+ 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x73, 0x20, 0x3d, 0x20, 0x6d, 0x69,
+ 0x6e, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a,
+ 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79,
+ 0x7a, 0x29, 0x2c, 0x20, 0x6d, 0x69, 0x6e, 0x28, 0x6c, 0x65, 0x6e, 0x67,
+ 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
+ 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x2c, 0x20, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x20, 0x3d, 0x20, 0x6d, 0x69,
+ 0x6e, 0x28, 0x64, 0x2c, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x69, 0x73,
+ 0x74, 0x28, 0x71, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x2e, 0x70, 0x61, 0x72,
+ 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x29, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x7d, 0x20, 0x65, 0x6c, 0x73, 0x65, 0x20, 0x7b, 0x20, 0x2f, 0x2f,
+ 0x20, 0x49, 0x6e, 0x74, 0x65, 0x72, 0x6e, 0x61, 0x6c, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f,
+ 0x70, 0x74, 0x72, 0x20, 0x3c, 0x20, 0x33, 0x31, 0x29, 0x20, 0x7b, 0x0a,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73, 0x74, 0x61, 0x63,
+ 0x6b, 0x5b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70, 0x74, 0x72, 0x5d,
+ 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6c, 0x65, 0x66, 0x74,
+ 0x5f, 0x69, 0x64, 0x78, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70, 0x74, 0x72, 0x2b,
+ 0x2b, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x73,
+ 0x74, 0x61, 0x63, 0x6b, 0x5b, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70,
+ 0x74, 0x72, 0x5d, 0x20, 0x3d, 0x20, 0x6e, 0x6f, 0x64, 0x65, 0x2e, 0x6f,
+ 0x62, 0x6a, 0x5f, 0x69, 0x64, 0x78, 0x5f, 0x6f, 0x72, 0x5f, 0x72, 0x69,
+ 0x67, 0x68, 0x74, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x73, 0x74, 0x61, 0x63, 0x6b, 0x5f, 0x70, 0x74, 0x72, 0x2b, 0x2b,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20,
+ 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e,
+ 0x20, 0x64, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
+};
+const size_t ASSET_SIZE_SHADER_RENDER_SCENE_QUERY_LINEAR = 959;
+alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_SCENE_QUERY_LINEAR[] = {
0x23, 0x69, 0x6e, 0x63, 0x6c, 0x75, 0x64, 0x65, 0x20, 0x22, 0x6d, 0x61,
0x74, 0x68, 0x2f, 0x73, 0x64, 0x66, 0x5f, 0x73, 0x68, 0x61, 0x70, 0x65,
0x73, 0x22, 0x0a, 0x0a, 0x66, 0x6e, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x64,
@@ -371772,51 +371955,29 @@ alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_SCENE_QUERY[] = {
0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x6f,
0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3d, 0x20, 0x6f, 0x62,
0x6a, 0x2e, 0x70, 0x61, 0x72, 0x61, 0x6d, 0x73, 0x2e, 0x78, 0x3b, 0x0a,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x53,
- 0x6b, 0x69, 0x70, 0x20, 0x72, 0x61, 0x73, 0x74, 0x65, 0x72, 0x69, 0x7a,
- 0x65, 0x64, 0x20, 0x6f, 0x62, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x20, 0x28,
- 0x6c, 0x69, 0x6b, 0x65, 0x20, 0x74, 0x68, 0x65, 0x20, 0x66, 0x6c, 0x6f,
- 0x6f, 0x72, 0x29, 0x20, 0x69, 0x6e, 0x20, 0x74, 0x68, 0x65, 0x20, 0x53,
- 0x44, 0x46, 0x20, 0x6d, 0x61, 0x70, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28, 0x6f, 0x62, 0x6a, 0x5f, 0x74,
- 0x79, 0x70, 0x65, 0x20, 0x3c, 0x3d, 0x20, 0x30, 0x2e, 0x30, 0x29, 0x20,
- 0x7b, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x69, 0x6e, 0x75, 0x65, 0x3b, 0x20,
- 0x7d, 0x20, 0x0a, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
- 0x6c, 0x65, 0x74, 0x20, 0x71, 0x20, 0x3d, 0x20, 0x28, 0x6f, 0x62, 0x6a,
- 0x2e, 0x69, 0x6e, 0x76, 0x5f, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x20, 0x2a,
- 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66, 0x33, 0x32, 0x3e, 0x28, 0x70,
- 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29, 0x2e, 0x78, 0x79, 0x7a, 0x3b,
- 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x73, 0x63,
- 0x61, 0x6c, 0x65, 0x5f, 0x78, 0x20, 0x3d, 0x20, 0x6c, 0x65, 0x6e, 0x67,
- 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
- 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x73, 0x63,
- 0x61, 0x6c, 0x65, 0x5f, 0x79, 0x20, 0x3d, 0x20, 0x6c, 0x65, 0x6e, 0x67,
- 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
- 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x73, 0x63,
- 0x61, 0x6c, 0x65, 0x5f, 0x7a, 0x20, 0x3d, 0x20, 0x6c, 0x65, 0x6e, 0x67,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x69, 0x66, 0x20, 0x28,
+ 0x6f, 0x62, 0x6a, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x20, 0x3c, 0x3d, 0x20,
+ 0x30, 0x2e, 0x30, 0x29, 0x20, 0x7b, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x69,
+ 0x6e, 0x75, 0x65, 0x3b, 0x20, 0x7d, 0x20, 0x0a, 0x0a, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x71, 0x20, 0x3d,
+ 0x20, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x69, 0x6e, 0x76, 0x5f, 0x6d, 0x6f,
+ 0x64, 0x65, 0x6c, 0x20, 0x2a, 0x20, 0x76, 0x65, 0x63, 0x34, 0x3c, 0x66,
+ 0x33, 0x32, 0x3e, 0x28, 0x70, 0x2c, 0x20, 0x31, 0x2e, 0x30, 0x29, 0x29,
+ 0x2e, 0x78, 0x79, 0x7a, 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
+ 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x73, 0x20, 0x3d, 0x20, 0x6d, 0x69,
+ 0x6e, 0x28, 0x6c, 0x65, 0x6e, 0x67, 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a,
+ 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c, 0x5b, 0x30, 0x5d, 0x2e, 0x78, 0x79,
+ 0x7a, 0x29, 0x2c, 0x20, 0x6d, 0x69, 0x6e, 0x28, 0x6c, 0x65, 0x6e, 0x67,
0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64, 0x65, 0x6c,
- 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x3b, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x2f, 0x2f, 0x20, 0x55, 0x73, 0x65,
- 0x20, 0x63, 0x6f, 0x6e, 0x73, 0x65, 0x72, 0x76, 0x61, 0x74, 0x69, 0x76,
- 0x65, 0x20, 0x6d, 0x69, 0x6e, 0x69, 0x6d, 0x75, 0x6d, 0x20, 0x73, 0x63,
- 0x61, 0x6c, 0x65, 0x20, 0x74, 0x6f, 0x20, 0x61, 0x76, 0x6f, 0x69, 0x64,
- 0x20, 0x6f, 0x76, 0x65, 0x72, 0x73, 0x74, 0x65, 0x70, 0x70, 0x69, 0x6e,
- 0x67, 0x20, 0x74, 0x68, 0x65, 0x20, 0x64, 0x69, 0x73, 0x74, 0x61, 0x6e,
- 0x63, 0x65, 0x20, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x0a, 0x20, 0x20, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x6c, 0x65, 0x74, 0x20, 0x73, 0x20, 0x3d,
- 0x20, 0x6d, 0x69, 0x6e, 0x28, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x78,
- 0x2c, 0x20, 0x6d, 0x69, 0x6e, 0x28, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f,
- 0x79, 0x2c, 0x20, 0x73, 0x63, 0x61, 0x6c, 0x65, 0x5f, 0x7a, 0x29, 0x29,
- 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x0a, 0x20,
- 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x20, 0x3d, 0x20, 0x6d,
- 0x69, 0x6e, 0x28, 0x64, 0x2c, 0x20, 0x67, 0x65, 0x74, 0x5f, 0x64, 0x69,
- 0x73, 0x74, 0x28, 0x71, 0x2c, 0x20, 0x6f, 0x62, 0x6a, 0x5f, 0x74, 0x79,
- 0x70, 0x65, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x29, 0x3b, 0x0a, 0x20, 0x20,
- 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75,
- 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
+ 0x5b, 0x31, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x2c, 0x20, 0x6c, 0x65,
+ 0x6e, 0x67, 0x74, 0x68, 0x28, 0x6f, 0x62, 0x6a, 0x2e, 0x6d, 0x6f, 0x64,
+ 0x65, 0x6c, 0x5b, 0x32, 0x5d, 0x2e, 0x78, 0x79, 0x7a, 0x29, 0x29, 0x29,
+ 0x3b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x64, 0x20,
+ 0x3d, 0x20, 0x6d, 0x69, 0x6e, 0x28, 0x64, 0x2c, 0x20, 0x67, 0x65, 0x74,
+ 0x5f, 0x64, 0x69, 0x73, 0x74, 0x28, 0x71, 0x2c, 0x20, 0x6f, 0x62, 0x6a,
+ 0x5f, 0x74, 0x79, 0x70, 0x65, 0x29, 0x20, 0x2a, 0x20, 0x73, 0x29, 0x3b,
+ 0x0a, 0x20, 0x20, 0x20, 0x20, 0x7d, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72,
+ 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x64, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
};
const size_t ASSET_SIZE_SHADER_RENDER_LIGHTING_UTILS = 330;
alignas(16) static const uint8_t ASSET_DATA_SHADER_RENDER_LIGHTING_UTILS[] = {
@@ -371888,13 +372049,14 @@ const AssetRecord* GetAssetRecordTable() {
{ ASSET_DATA_SHADER_MATH_SDF_SHAPES, ASSET_SIZE_SHADER_MATH_SDF_SHAPES, false, nullptr, nullptr, 0 },
{ ASSET_DATA_SHADER_MATH_SDF_UTILS, ASSET_SIZE_SHADER_MATH_SDF_UTILS, false, nullptr, nullptr, 0 },
{ ASSET_DATA_SHADER_RENDER_SHADOWS, ASSET_SIZE_SHADER_RENDER_SHADOWS, false, nullptr, nullptr, 0 },
- { ASSET_DATA_SHADER_RENDER_SCENE_QUERY, ASSET_SIZE_SHADER_RENDER_SCENE_QUERY, false, nullptr, nullptr, 0 },
+ { ASSET_DATA_SHADER_RENDER_SCENE_QUERY_BVH, ASSET_SIZE_SHADER_RENDER_SCENE_QUERY_BVH, false, nullptr, nullptr, 0 },
+ { ASSET_DATA_SHADER_RENDER_SCENE_QUERY_LINEAR, ASSET_SIZE_SHADER_RENDER_SCENE_QUERY_LINEAR, false, nullptr, nullptr, 0 },
{ ASSET_DATA_SHADER_RENDER_LIGHTING_UTILS, ASSET_SIZE_SHADER_RENDER_LIGHTING_UTILS, false, nullptr, nullptr, 0 },
};
return assets;
}
size_t GetAssetCount() {
- return 39;
+ return 40;
}
diff --git a/src/generated/test_assets.h b/src/generated/test_assets.h
index 7b66e75..f5ba129 100644
--- a/src/generated/test_assets.h
+++ b/src/generated/test_assets.h
@@ -9,9 +9,10 @@ enum class AssetId : uint16_t {
ASSET_SHADER_SNIPPET_A = 2,
ASSET_SHADER_SNIPPET_B = 3,
ASSET_PROC_NOISE_256 = 4,
- ASSET_PROC_UNKNOWN = 5,
- ASSET_PROC_FAIL = 6,
- ASSET_LAST_ID = 7,
+ ASSET_TEST_IMAGE = 5,
+ ASSET_PROC_UNKNOWN = 6,
+ ASSET_PROC_FAIL = 7,
+ ASSET_LAST_ID = 8,
};
#include "util/asset_manager.h"
diff --git a/src/generated/test_assets_data.cc b/src/generated/test_assets_data.cc
index bb222f0..03da564 100644
--- a/src/generated/test_assets_data.cc
+++ b/src/generated/test_assets_data.cc
@@ -1,50 +1,55 @@
// This file is auto-generated by asset_packer.cc. Do not edit.
-#include "test_assets.h"
#include "util/asset_manager.h"
-namespace procedural {
-void gen_noise(uint8_t*, int, int, const float*, int);
-}
-namespace procedural {
-void gen_grid(uint8_t*, int, int, const float*, int);
-}
-namespace procedural {
-void make_periodic(uint8_t*, int, int, const float*, int);
-}
+#include "test_assets.h"
+namespace procedural { void gen_noise(uint8_t*, int, int, const float*, int); }
+namespace procedural { void gen_grid(uint8_t*, int, int, const float*, int); }
+namespace procedural { void make_periodic(uint8_t*, int, int, const float*, int); }
const size_t ASSET_SIZE_TEST_ASSET_1 = 101;
alignas(16) static const uint8_t ASSET_DATA_TEST_ASSET_1[] = {
- 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
- 0x73, 0x74, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x20, 0x66, 0x69, 0x6c,
- 0x65, 0x2e, 0x0a, 0x49, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
- 0x6e, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74,
- 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x74, 0x6f, 0x20, 0x76, 0x65, 0x72,
- 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x73, 0x73, 0x65,
- 0x74, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79,
- 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x0a, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
- 0x37, 0x38, 0x39, 0x30, 0x0a, 0x00};
+ 0x54, 0x68, 0x69, 0x73, 0x20, 0x69, 0x73, 0x20, 0x61, 0x20, 0x74, 0x65,
+ 0x73, 0x74, 0x20, 0x61, 0x73, 0x73, 0x65, 0x74, 0x20, 0x66, 0x69, 0x6c,
+ 0x65, 0x2e, 0x0a, 0x49, 0x74, 0x20, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x69,
+ 0x6e, 0x73, 0x20, 0x73, 0x6f, 0x6d, 0x65, 0x20, 0x74, 0x65, 0x78, 0x74,
+ 0x20, 0x64, 0x61, 0x74, 0x61, 0x20, 0x74, 0x6f, 0x20, 0x76, 0x65, 0x72,
+ 0x69, 0x66, 0x79, 0x20, 0x74, 0x68, 0x65, 0x20, 0x61, 0x73, 0x73, 0x65,
+ 0x74, 0x20, 0x70, 0x61, 0x63, 0x6b, 0x69, 0x6e, 0x67, 0x20, 0x73, 0x79,
+ 0x73, 0x74, 0x65, 0x6d, 0x2e, 0x0a, 0x31, 0x32, 0x33, 0x34, 0x35, 0x36,
+ 0x37, 0x38, 0x39, 0x30, 0x0a, 0x00
+};
const size_t ASSET_SIZE_NULL_ASSET = 0;
-alignas(16) static const uint8_t ASSET_DATA_NULL_ASSET[] = {0x00};
+alignas(16) static const uint8_t ASSET_DATA_NULL_ASSET[] = {
+ 0x00
+};
const size_t ASSET_SIZE_SHADER_SNIPPET_A = 65;
alignas(16) static const uint8_t ASSET_DATA_SHADER_SNIPPET_A[] = {
- 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x6e, 0x69,
- 0x70, 0x70, 0x65, 0x74, 0x5f, 0x61, 0x2e, 0x77, 0x67, 0x73, 0x6c,
- 0x0a, 0x66, 0x6e, 0x20, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74,
- 0x5f, 0x61, 0x28, 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x66, 0x33, 0x32,
- 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75,
- 0x72, 0x6e, 0x20, 0x31, 0x2e, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x00};
+ 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x6e, 0x69, 0x70,
+ 0x70, 0x65, 0x74, 0x5f, 0x61, 0x2e, 0x77, 0x67, 0x73, 0x6c, 0x0a, 0x66,
+ 0x6e, 0x20, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x5f, 0x61, 0x28,
+ 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x66, 0x33, 0x32, 0x20, 0x7b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x31, 0x2e,
+ 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
+};
const size_t ASSET_SIZE_SHADER_SNIPPET_B = 65;
alignas(16) static const uint8_t ASSET_DATA_SHADER_SNIPPET_B[] = {
- 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x6e, 0x69,
- 0x70, 0x70, 0x65, 0x74, 0x5f, 0x62, 0x2e, 0x77, 0x67, 0x73, 0x6c,
- 0x0a, 0x66, 0x6e, 0x20, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74,
- 0x5f, 0x62, 0x28, 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x66, 0x33, 0x32,
- 0x20, 0x7b, 0x0a, 0x20, 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75,
- 0x72, 0x6e, 0x20, 0x32, 0x2e, 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x00};
+ 0x2f, 0x2f, 0x20, 0x74, 0x65, 0x73, 0x74, 0x5f, 0x73, 0x6e, 0x69, 0x70,
+ 0x70, 0x65, 0x74, 0x5f, 0x62, 0x2e, 0x77, 0x67, 0x73, 0x6c, 0x0a, 0x66,
+ 0x6e, 0x20, 0x73, 0x6e, 0x69, 0x70, 0x70, 0x65, 0x74, 0x5f, 0x62, 0x28,
+ 0x29, 0x20, 0x2d, 0x3e, 0x20, 0x66, 0x33, 0x32, 0x20, 0x7b, 0x0a, 0x20,
+ 0x20, 0x20, 0x20, 0x72, 0x65, 0x74, 0x75, 0x72, 0x6e, 0x20, 0x32, 0x2e,
+ 0x30, 0x3b, 0x0a, 0x7d, 0x0a, 0x00
+};
static const float ASSET_PROC_PARAMS_PROC_NOISE_256[] = {4321.000000, 8.000000};
static const char* ASSET_PROC_FUNC_STR_PROC_NOISE_256 = "gen_noise";
+const size_t ASSET_SIZE_TEST_IMAGE = 24;
+alignas(16) static const uint8_t ASSET_DATA_TEST_IMAGE[] = {
+ 0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0xff,
+ 0x00, 0xff, 0x00, 0xff, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
+ 0x00
+};
static const float ASSET_PROC_PARAMS_PROC_UNKNOWN[] = {0.000000};
static const char* ASSET_PROC_FUNC_STR_PROC_UNKNOWN = "gen_unknown_func";
@@ -55,24 +60,19 @@ static const char* ASSET_PROC_FUNC_STR_PROC_FAIL = "gen_noise";
const AssetRecord* GetAssetRecordTable() {
static const AssetRecord assets[] = {
- {ASSET_DATA_TEST_ASSET_1, ASSET_SIZE_TEST_ASSET_1, false, nullptr,
- nullptr, 0},
- {ASSET_DATA_NULL_ASSET, ASSET_SIZE_NULL_ASSET, false, nullptr, nullptr,
- 0},
- {ASSET_DATA_SHADER_SNIPPET_A, ASSET_SIZE_SHADER_SNIPPET_A, false, nullptr,
- nullptr, 0},
- {ASSET_DATA_SHADER_SNIPPET_B, ASSET_SIZE_SHADER_SNIPPET_B, false, nullptr,
- nullptr, 0},
- {nullptr, 0, true, ASSET_PROC_FUNC_STR_PROC_NOISE_256,
- ASSET_PROC_PARAMS_PROC_NOISE_256, 2},
- {nullptr, 0, true, ASSET_PROC_FUNC_STR_PROC_UNKNOWN,
- ASSET_PROC_PARAMS_PROC_UNKNOWN, 1},
- {nullptr, 0, true, ASSET_PROC_FUNC_STR_PROC_FAIL,
- ASSET_PROC_PARAMS_PROC_FAIL, 2},
+ { ASSET_DATA_TEST_ASSET_1, ASSET_SIZE_TEST_ASSET_1, false, nullptr, nullptr, 0 },
+ { ASSET_DATA_NULL_ASSET, ASSET_SIZE_NULL_ASSET, false, nullptr, nullptr, 0 },
+ { ASSET_DATA_SHADER_SNIPPET_A, ASSET_SIZE_SHADER_SNIPPET_A, false, nullptr, nullptr, 0 },
+ { ASSET_DATA_SHADER_SNIPPET_B, ASSET_SIZE_SHADER_SNIPPET_B, false, nullptr, nullptr, 0 },
+ { nullptr, 0, true, ASSET_PROC_FUNC_STR_PROC_NOISE_256, ASSET_PROC_PARAMS_PROC_NOISE_256, 2 },
+ { ASSET_DATA_TEST_IMAGE, ASSET_SIZE_TEST_IMAGE, false, nullptr, nullptr, 0 },
+ { nullptr, 0, true, ASSET_PROC_FUNC_STR_PROC_UNKNOWN, ASSET_PROC_PARAMS_PROC_UNKNOWN, 1 },
+ { nullptr, 0, true, ASSET_PROC_FUNC_STR_PROC_FAIL, ASSET_PROC_PARAMS_PROC_FAIL, 2 },
};
return assets;
}
size_t GetAssetCount() {
- return 7;
+ return 8;
}
+
diff --git a/src/gpu/effects/shader_composer.cc b/src/gpu/effects/shader_composer.cc
index 8d66ad7..055b996 100644
--- a/src/gpu/effects/shader_composer.cc
+++ b/src/gpu/effects/shader_composer.cc
@@ -17,7 +17,8 @@ void ShaderComposer::RegisterSnippet(const std::string& name,
void ShaderComposer::ResolveRecursive(const std::string& source,
std::stringstream& ss,
- std::set<std::string>& included) {
+ std::set<std::string>& included,
+ const CompositionMap& substitutions) {
std::istringstream stream(source);
std::string line;
while (std::getline(stream, line)) {
@@ -27,12 +28,19 @@ void ShaderComposer::ResolveRecursive(const std::string& source,
size_t end = line.find('"', start + 1);
if (start != std::string::npos && end != std::string::npos) {
std::string name = line.substr(start + 1, end - start - 1);
+
+ // Apply substitution if available
+ auto sub_it = substitutions.find(name);
+ if (sub_it != substitutions.end()) {
+ name = sub_it->second;
+ }
+
if (included.find(name) == included.end()) {
included.insert(name);
auto it = snippets_.find(name);
if (it != snippets_.end()) {
ss << "// --- Included: " << name << " ---\n";
- ResolveRecursive(it->second, ss, included);
+ ResolveRecursive(it->second, ss, included, substitutions);
ss << "// --- End Include: " << name << " ---\n";
} else {
ss << "// ERROR: Snippet not found: " << name << "\n";
@@ -47,7 +55,8 @@ void ShaderComposer::ResolveRecursive(const std::string& source,
std::string
ShaderComposer::Compose(const std::vector<std::string>& dependencies,
- const std::string& main_code) {
+ const std::string& main_code,
+ const CompositionMap& substitutions) {
std::stringstream ss;
ss << "// Generated by ShaderComposer\n\n";
@@ -55,19 +64,25 @@ ShaderComposer::Compose(const std::vector<std::string>& dependencies,
// Process explicit dependencies first
for (const auto& dep : dependencies) {
- if (included.find(dep) == included.end()) {
- included.insert(dep);
- auto it = snippets_.find(dep);
+ std::string name = dep;
+ auto sub_it = substitutions.find(name);
+ if (sub_it != substitutions.end()) {
+ name = sub_it->second;
+ }
+
+ if (included.find(name) == included.end()) {
+ included.insert(name);
+ auto it = snippets_.find(name);
if (it != snippets_.end()) {
- ss << "// --- Dependency: " << dep << " ---\n";
- ResolveRecursive(it->second, ss, included);
+ ss << "// --- Dependency: " << name << " ---\n";
+ ResolveRecursive(it->second, ss, included, substitutions);
ss << "\n";
}
}
}
ss << "// --- Main Code ---\n";
- ResolveRecursive(main_code, ss, included);
+ ResolveRecursive(main_code, ss, included, substitutions);
return ss.str();
}
diff --git a/src/gpu/effects/shader_composer.h b/src/gpu/effects/shader_composer.h
index a63a6a4..9eb43f4 100644
--- a/src/gpu/effects/shader_composer.h
+++ b/src/gpu/effects/shader_composer.h
@@ -15,16 +15,21 @@ class ShaderComposer {
// Register a snippet (e.g. "common_math", "sdf_primitives")
void RegisterSnippet(const std::string& name, const std::string& code);
+ using CompositionMap = std::map<std::string, std::string>;
+
// Assemble a final shader string by prepending required snippets
// and recursively resolving #include "snippet_name" directives.
+ // Optional substitutions: map "placeholder_name" -> "actual_snippet_name"
std::string Compose(const std::vector<std::string>& dependencies,
- const std::string& main_code);
+ const std::string& main_code,
+ const CompositionMap& substitutions = {});
private:
ShaderComposer() = default;
void ResolveRecursive(const std::string& source, std::stringstream& ss,
- std::set<std::string>& included);
+ std::set<std::string>& included,
+ const CompositionMap& substitutions);
std::map<std::string, std::string> snippets_;
};
diff --git a/src/gpu/effects/shaders.cc b/src/gpu/effects/shaders.cc
index 7b543e1..4fc8108 100644
--- a/src/gpu/effects/shaders.cc
+++ b/src/gpu/effects/shaders.cc
@@ -34,8 +34,10 @@ void InitShaderComposer() {
register_if_exists("math/sdf_shapes", AssetId::ASSET_SHADER_MATH_SDF_SHAPES);
register_if_exists("math/sdf_utils", AssetId::ASSET_SHADER_MATH_SDF_UTILS);
register_if_exists("render/shadows", AssetId::ASSET_SHADER_RENDER_SHADOWS);
- register_if_exists("render/scene_query",
- AssetId::ASSET_SHADER_RENDER_SCENE_QUERY);
+ register_if_exists("render/scene_query_bvh",
+ AssetId::ASSET_SHADER_RENDER_SCENE_QUERY_BVH);
+ register_if_exists("render/scene_query_linear",
+ AssetId::ASSET_SHADER_RENDER_SCENE_QUERY_LINEAR);
register_if_exists("render/lighting_utils",
AssetId::ASSET_SHADER_RENDER_LIGHTING_UTILS);
diff --git a/src/tests/test_3d_physics.cc b/src/tests/test_3d_physics.cc
index 84be333..0dfe1ce 100644
--- a/src/tests/test_3d_physics.cc
+++ b/src/tests/test_3d_physics.cc
@@ -194,6 +194,9 @@ int main(int argc, char** argv) {
if (strcmp(argv[i], "--debug") == 0) {
Renderer3D::SetDebugEnabled(true);
}
+ if (strcmp(argv[i], "--no-bvh") == 0) {
+ g_renderer.SetBvhEnabled(false);
+ }
}
#else
(void)argc;
diff --git a/src/tests/test_3d_render.cc b/src/tests/test_3d_render.cc
index 002cb55..f8bbaa7 100644
--- a/src/tests/test_3d_render.cc
+++ b/src/tests/test_3d_render.cc
@@ -183,6 +183,9 @@ int main(int argc, char** argv) {
if (strcmp(argv[i], "--debug") == 0) {
Renderer3D::SetDebugEnabled(true);
}
+ if (strcmp(argv[i], "--no-bvh") == 0) {
+ g_renderer.SetBvhEnabled(false);
+ }
}
#else
(void)argc;