Skip to content

Commit

Permalink
better defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
arcadeperfect committed Dec 7, 2024
1 parent d28b447 commit 8ff7ee7
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/gui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ fn ui_system(
ui.label("radius");
ui.add(egui::Slider::new(&mut params.radius, 0.0..=1.).text("radius"));
ui.add(egui::Slider::new(&mut params.noise_amplitude, 0.0..=5.).text("amplitude"));
ui.add(egui::Slider::new(&mut params.noise_scale, 0.0..=1.).text("frequency"));
ui.add(egui::Slider::new(&mut params.noise_freq, 0.0..=1.).text("frequency"));
ui.add(egui::Slider::new(&mut params.noise_offset, 0.0..=20.).text("offset"));
ui.add(egui::Slider::new(&mut params.power_bias, 0.0..=6.).text("power bias"));
ui.add(egui::Slider::new(&mut params.flatness, 0.0..=6.).text("flatness"));
Expand All @@ -60,7 +60,7 @@ fn ui_system(
.range(0..=100),
);
});
ui.add(egui::Slider::new(&mut params.ca_thresh, 0.0..=1.).text("thresh"));
ui.add(egui::Slider::new(&mut params.ca_thresh, 0.0..=0.25).text("thresh"));
ui.add(egui::Slider::new(&mut params.ca_search_radius, 0.1..=6.).text("search radius"));

});
Expand Down
9 changes: 5 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ struct ParamsUniform {
dimensions: u32,
radius: f32,
noise_seed: u32,
noise_scale: f32,
noise_freq: f32,
noise_amplitude: f32,
noise_offset: f32,
power_bias: f32,
Expand All @@ -49,13 +49,14 @@ struct ParamsUniform {
}

impl Default for ParamsUniform {

fn default() -> Self {
Self {
dimensions: BUFFER_LEN as u32,
radius: 0.5,
radius: 0.75,
noise_seed: 0,
noise_scale: 1.0,
noise_amplitude: 1.0,
noise_freq: 0.3,
noise_amplitude: 1.55,
noise_offset: 0.0,
power_bias: 1.8,
flatness: 1.5,
Expand Down
2 changes: 1 addition & 1 deletion src/shaders/ca.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
// Create an exponential edge falloff factor
// pow(x, n) where n > 1 creates exponential curve
// Higher power = sharper falloff
let edge_power = n * 5.; // Adjust this to control falloff sharpness
let edge_power = n * 51.; // Adjust this to control falloff sharpness
let edge_scale = n; // Adjust this to control where falloff starts
let edge_factor = pow(clamp(edge_dist / edge_scale, 0.0, 1.0), edge_power);

Expand Down
2 changes: 1 addition & 1 deletion src/shaders/extract.wgsl
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ fn main(@builtin(global_invocation_id) global_id: vec3<u32>) {
r = clamp(r, 0., 1.);

// textureStore(output_texture, upos, vec4f(r,r,r,1.));
textureStore(output_texture, upos, vec4f(r, 0., 0., 1.0));
textureStore(output_texture, upos, vec4f(r, current.g, current.b, 1.0));
}

0 comments on commit 8ff7ee7

Please sign in to comment.