diff --git a/Cargo.lock b/Cargo.lock index 2d18223b06..e5a4413ffa 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8084,7 +8084,7 @@ dependencies = [ [[package]] name = "vello_common" version = "0.3.0" -source = "git+https://github.com/Keavon/vello.git?rev=a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c#a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c" +source = "git+https://github.com/Keavon/vello.git?rev=4b584f7f16f00c155c47d3980deea419d5c89f0a#4b584f7f16f00c155c47d3980deea419d5c89f0a" dependencies = [ "bytemuck", "fearless_simd", @@ -8099,7 +8099,7 @@ dependencies = [ [[package]] name = "vello_gpu" version = "0.3.0" -source = "git+https://github.com/Keavon/vello.git?rev=a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c#a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c" +source = "git+https://github.com/Keavon/vello.git?rev=4b584f7f16f00c155c47d3980deea419d5c89f0a#4b584f7f16f00c155c47d3980deea419d5c89f0a" dependencies = [ "bytemuck", "hashbrown 0.17.1", @@ -8113,7 +8113,7 @@ dependencies = [ [[package]] name = "vello_gpu_shaders" version = "0.3.0" -source = "git+https://github.com/Keavon/vello.git?rev=a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c#a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c" +source = "git+https://github.com/Keavon/vello.git?rev=4b584f7f16f00c155c47d3980deea419d5c89f0a#4b584f7f16f00c155c47d3980deea419d5c89f0a" dependencies = [ "naga", "wesl", diff --git a/Cargo.toml b/Cargo.toml index 63229b3555..7c0bd90327 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -315,6 +315,6 @@ debug = true rfd = { git = "https://github.com/timon-schelling/rfd.git", branch = "graphite" } # TODO: Remove this once https://github.com/PolyMeilex/rfd/pull/317 is merged and released fastnoise-lite = { git = "https://github.com/Keavon/FastNoiseLite.git", rev = "26c1ac62e124d68ff970c2423dcda2ef24344060" } # TODO: Remove this once the WGSL port is upstreamed and released in version 1.2 # TODO: Remove these once the fork's fixes are upstreamed and released -vello_gpu = { git = "https://github.com/Keavon/vello.git", rev = "a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c" } -vello_common = { git = "https://github.com/Keavon/vello.git", rev = "a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c" } -vello_gpu_shaders = { git = "https://github.com/Keavon/vello.git", rev = "a1ba4a9512b65015d16cb81b0ae0f1dc651b5f1c" } +vello_gpu = { git = "https://github.com/Keavon/vello.git", rev = "4b584f7f16f00c155c47d3980deea419d5c89f0a" } +vello_common = { git = "https://github.com/Keavon/vello.git", rev = "4b584f7f16f00c155c47d3980deea419d5c89f0a" } +vello_gpu_shaders = { git = "https://github.com/Keavon/vello.git", rev = "4b584f7f16f00c155c47d3980deea419d5c89f0a" } diff --git a/node-graph/libraries/rendering/src/renderer.rs b/node-graph/libraries/rendering/src/renderer.rs index 1a8d351612..cbd82794a9 100644 --- a/node-graph/libraries/rendering/src/renderer.rs +++ b/node-graph/libraries/rendering/src/renderer.rs @@ -3440,7 +3440,9 @@ fn peniko_extend(gradient_spread: GradientSpread) -> peniko::Extend { enum GradientBrush { Peniko(peniko::Brush), /// Apollonian circles, which only Vello GPU's fork draws. - Apollonian(vello_gpu::PencilGradient), + Apollonian(vello_gpu::ApollonianGradient), + /// A position running around the contours, which only Vello GPU's fork draws. + Polar(vello_gpu::PolarGradient), } impl<'b> From<&'b GradientBrush> for SceneBrush<'b> { @@ -3448,6 +3450,7 @@ impl<'b> From<&'b GradientBrush> for SceneBrush<'b> { match brush { GradientBrush::Peniko(brush) => brush.into(), GradientBrush::Apollonian(gradient) => gradient.into(), + GradientBrush::Polar(gradient) => gradient.into(), } } } @@ -3492,30 +3495,7 @@ fn vello_gradient_paint(shape: GradientShape, samples: &[(f64, Color, Option return Some(VelloGradientPaint(vec![((ramp(unit_gradient_kind(GradientForm::Linear)), gradient_placement(placement, shape)), None)])), - GradientShape::Radial => return Some(VelloGradientPaint(vec![((ramp(unit_gradient_kind(GradientForm::Radial)), placement), None)])), - // Its contours come from its own geometry, so its ramp takes the linear kind, which goes unused - GradientShape::Apollonian(parameters) => { - let ramp = gradient(unit_gradient_kind(GradientForm::Linear), peniko_color_stops(samples), peniko_extend(spread)); - let apollonian = vello_gpu::PencilGradient { - ramp, - geometry: apollonian_geometry(¶meters), - }; - return Some(VelloGradientPaint(vec![((GradientBrush::Apollonian(apollonian), placement), None)])); - } - GradientShape::Across(GradientAcross { chart, .. }) => { - let kind = match chart { - AcrossChart::Nothing => return None, - AcrossChart::Concentric { center } => peniko::SweepGradientPosition::new(kurbo::Point::new(center, 0.), 0., std::f32::consts::TAU).into(), - AcrossChart::Linear | AcrossChart::Cone { .. } | AcrossChart::Mobius { .. } | AcrossChart::Bipolar { .. } => across_linear_kind(), - }; - return Some(VelloGradientPaint(vec![((ramp(kind), placement), None)])); - } - GradientShape::Standard(gradient) => gradient, - }; - - // Ramps along the gradient line are placed like the linear form, and circles by the full placement + // Ramps along the gradient line, and steps across it, are placed like the linear form let desheared = desheared_placement(placement); let linear = |[start, end]: [f64; 2]| -> peniko::GradientKind { peniko::LinearGradientPosition { @@ -3524,15 +3504,6 @@ fn vello_gradient_paint(shape: GradientShape, samples: &[(f64, Color, Option peniko::GradientKind { - peniko::RadialGradientPosition { - start_center: kurbo::Point::new(cone.start_center, 0.), - start_radius: cone.start_radius as f32, - end_center: kurbo::Point::new(cone.end_center, 0.), - end_radius: cone.end_radius as f32, - } - .into() - }; let stops = |colors: &[(f32, Color)]| { let stop = |&(offset, color): &(f32, Color)| peniko::ColorStop { offset, @@ -3540,7 +3511,6 @@ fn vello_gradient_paint(shape: GradientShape, samples: &[(f64, Color, Option