Skip to content
Draft
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ gltf = { version = "1.1", default-features = false }
log = "0.4"
mint = "0.5"
naga = { version = "22", features = ["wgsl-in"] }
nanorand = { version = "0.7", default-features = false }
profiling = "1"
slab = "0.4"
strum = { version = "0.25", features = ["derive"] }
Expand Down Expand Up @@ -79,7 +80,7 @@ glam = { workspace = true }
log = { workspace = true }
mint = { workspace = true, features = ["serde"] }
naga = { workspace = true }
nanorand = { version = "0.7", default-features = false, features = ["wyrand"] }
nanorand = { workspace = true, features = ["wyrand"] }
profiling = { workspace = true }
ron = "0.8"
serde = { version = "1", features = ["serde_derive"] }
Expand All @@ -95,7 +96,6 @@ egui-winit = "0.28"
console_error_panic_hook = "0.1.7"
console_log = "1"
web-sys = { workspace = true, features = ["Window"] }
getrandom = { version = "0.2", features = ["js"] }

[target.'cfg(any(target_os = "windows", target_os = "linux"))'.dev-dependencies]
renderdoc = "0.12"
Expand Down
17 changes: 11 additions & 6 deletions blade-graphics/src/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,19 @@ impl super::TextureFormat {
}
}

impl super::Extent {
pub fn group_by(&self, size: [u32; 3]) -> [u32; 3] {
[
(self.width + size[0] - 1) / size[0],
(self.height + size[1] - 1) / size[1],
(self.depth + size[2] - 1) / size[2],
]
}
}

impl super::ComputePipeline {
/// Return the dispatch group counts sufficient to cover the given extent.
pub fn get_dispatch_for(&self, extent: super::Extent) -> [u32; 3] {
let wg_size = self.get_workgroup_size();
[
(extent.width + wg_size[0] - 1) / wg_size[0],
(extent.height + wg_size[1] - 1) / wg_size[1],
(extent.depth + wg_size[2] - 1) / wg_size[2],
]
extent.group_by(self.get_workgroup_size())
}
}
5 changes: 3 additions & 2 deletions blade-helpers/src/hud.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@ impl ExposeHud for blade_render::RayConfig {
egui::widgets::Slider::new(&mut self.spatial_tap_history, 0..=50)
.text("Spatial tap history"),
);
ui.add(egui::widgets::Slider::new(&mut self.group_mixer, 1..=10).text("Group mixer"));
ui.add(
egui::widgets::Slider::new(&mut self.spatial_radius, 1..=50)
.text("Spatial radius (px)"),
egui::widgets::Slider::new(&mut self.spatial_min_distance, 1..=10)
.text("Spatial minimum distance (px)"),
);
ui.add(
egui::widgets::Slider::new(&mut self.t_start, 0.001..=0.5)
Expand Down
2 changes: 1 addition & 1 deletion blade-render/code/blur.wgsl
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#include "camera.inc.wgsl"
#include "gbuf.inc.wgsl"
#include "motion.inc.wgsl"
#include "quaternion.inc.wgsl"
#include "surface.inc.wgsl"

Expand Down
19 changes: 19 additions & 0 deletions blade-render/code/color.inc.wgsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
fn hsv_to_rgb(h: f32, s: f32, v: f32) -> vec3<f32> {
let c = v * s;
let x = c * (1.0 - abs((h / 60.0) % 2.0 - 1.0));
var q = vec3<f32>(v - c);
if (h < 60.0) {
q.r += c; q.g += x;
} else if (h < 120.0) {
q.g += c; q.r += x;
} else if (h < 180.0) {
q.g += c; q.b += x;
} else if (h < 240.0) {
q.b += c; q.g += x;
} else if (h < 300.0) {
q.b += c; q.r += x;
} else {
q.r += c; q.b += x;
}
return q;
}
204 changes: 0 additions & 204 deletions blade-render/code/fill-gbuf.wgsl

This file was deleted.

2 changes: 0 additions & 2 deletions blade-render/code/gbuf.inc.wgsl

This file was deleted.

Loading