Variation #3

Open
bspeice wants to merge 4 commits from variation into main
4 changed files with 29 additions and 30 deletions
Showing only changes of commit c3224fadd8 - Show all commits
Generated
+20 -20
View File
@@ -354,7 +354,7 @@ dependencies = [
"glam",
"image",
"libm",
"rand 0.8.6",
"rand 0.10.1",
"rand_xoshiro",
"spirv-std",
"tempfile",
@@ -1038,15 +1038,6 @@ version = "5.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f"
[[package]]
name = "rand"
version = "0.8.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5ca0ecfa931c29007047d1bc58e623ab12e5590e8c7cc53200d5202b69266d8a"
dependencies = [
"rand_core 0.6.4",
]
[[package]]
name = "rand"
version = "0.9.4"
@@ -1057,6 +1048,15 @@ dependencies = [
"rand_core 0.9.5",
]
[[package]]
name = "rand"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "d2e8e8bcc7961af1fdac401278c6a831614941f6164ee3bf4ce61b7edb162207"
dependencies = [
"rand_core 0.10.1",
]
[[package]]
name = "rand_chacha"
version = "0.9.0"
@@ -1067,12 +1067,6 @@ dependencies = [
"rand_core 0.9.5",
]
[[package]]
name = "rand_core"
version = "0.6.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
[[package]]
name = "rand_core"
version = "0.9.5"
@@ -1083,12 +1077,18 @@ dependencies = [
]
[[package]]
name = "rand_xoshiro"
version = "0.6.0"
name = "rand_core"
version = "0.10.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "6f97cdb2a36ed4183de61b2f824cc45c9f1037f28afe0a322e9fff4c108b5aaa"
checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69"
[[package]]
name = "rand_xoshiro"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "662effc7698e08ea324d3acccf8d9d7f7bf79b9785e270a174ea36e56900c91d"
dependencies = [
"rand_core 0.6.4",
"rand_core 0.10.1",
]
[[package]]
+2 -3
View File
@@ -24,8 +24,7 @@ bytemuck = { version = "1.25.0", features = ["derive"] }
glam = { version = "0.33.1", default-features = false, features = ["bytemuck", "scalar-math"] }
image = { version = "0.25.10", default-features = false, features = ["default-formats"]}
libm = "0.2.16"
rand = { version = "0.10.1", default-features = false }
rand_xoshiro = "0.8.1"
rspirv = "0.13.0"
tempfile = "3.27.0"
rand = { version = "0.8.6", default-features = false }
rand_xoshiro = "0.6.0"
+4 -4
View File
@@ -15,14 +15,14 @@
use crate::transform::Transform;
use crate::variation::Variation;
use rand::Rng;
use rand::distributions::{Distribution, Standard};
use rand::distr::{Distribution, StandardUniform};
use rand::{Rng, RngExt};
use spirv_std::glam::{Vec2, vec2};
struct BiUnit;
impl Distribution<f32> for BiUnit {
fn sample<R: Rng + ?Sized>(&self, rng: &mut R) -> f32 {
rng.sample::<f32, _>(Standard) * 2.0 - 1.0
rng.sample::<f32, _>(StandardUniform) * 2.0 - 1.0
}
}
@@ -41,7 +41,7 @@ pub fn step_chaos_game<R: Rng>(
weights: &[f32],
variations: &[Variation],
) -> (Vec2, u32) {
let mut choice_weight = rng.sample::<f32, _>(Standard);
let mut choice_weight = rng.sample::<f32, _>(StandardUniform);
let mut transform_index: u32 = 0;
for i in 0..weights.len() {
+3 -3
View File
@@ -4,8 +4,8 @@ use bytemuck::{Pod, Zeroable};
use core::f32::consts::PI;
use glam::{Affine2, Vec2, vec2};
use libm::{atan2f, cosf, powf, sinf, sqrtf, tanf};
use rand::Rng;
use rand::distributions::Standard;
use rand::distr::StandardUniform;
use rand::{Rng, RngExt};
#[derive(Copy, Clone, Pod, Zeroable)]
#[repr(C)]
@@ -73,7 +73,7 @@ fn transform_point_julia<R: Rng>(point: Vec2, rng: &mut R) -> Vec2 {
let r = sqrtf(x2 + y2);
let theta = atan2f(point.x, point.y);
let omega = if rng.sample::<f32, _>(Standard) > 0.5 {
let omega = if rng.sample::<f32, _>(StandardUniform) > 0.5 {
PI
} else {
0.0