mirror of
https://github.com/storytold/materialcraft.git
synced 2026-11-28 17:19:17 +01:00
Preserve uncovered pixels and honor authored stamp opacity
This commit is contained in:
1 parent
080beca6d1
commit
0cef90320b
5 files changed
+140
-71
No files matched your search
@@ -75,14 +75,18 @@ pub(super) fn render(context: &CookContext, stamps: &[PatternStamp], max_depth:
|
||||
return Err("pattern roughness overflowed its depth opacity".into());
|
||||
}
|
||||
|
||||
let [red, green, blue, alpha] = stamp.color.map(flush_subnormal);
|
||||
let [red, green, blue, authored_alpha] = stamp.color.map(flush_subnormal);
|
||||
// Flush the stored alpha before a large tint could amplify a subnormal product.
|
||||
let alpha = flush_subnormal(alpha * flush_subnormal(opacity));
|
||||
let alpha = flush_subnormal(authored_alpha * flush_subnormal(opacity));
|
||||
let channel_tint = [red * alpha, green * alpha, blue * alpha, alpha].map(flush_subnormal);
|
||||
let tinted_offset = matches!(stamp.pattern, 17 | 18);
|
||||
let sample_shape = shape::prepare(stamp.pattern, stamp.variation);
|
||||
|
||||
let frame = Footprint::new(stamp)?;
|
||||
// The horizontal offset ramp can still contribute its variation at zero stamp opacity.
|
||||
if authored_alpha == 0.0 && matches!(stamp.pattern, 2..=16 | 18) {
|
||||
continue;
|
||||
}
|
||||
let texture = if stamp.pattern >= 256 {
|
||||
let index = (stamp.pattern - 256) as usize + 1;
|
||||
let Some(input) = context.input(index).filter(|image| image.kind() == kind) else { continue };
|
||||
@@ -137,7 +141,7 @@ pub(super) fn render(context: &CookContext, stamps: &[PatternStamp], max_depth:
|
||||
(color, coverage)
|
||||
}
|
||||
} else {
|
||||
let (coverage, offset) = sample_shape(local[0], local[1])?;
|
||||
let Some((coverage, offset)) = sample_shape(local[0], local[1])? else { continue };
|
||||
let coverage = flush_subnormal(coverage);
|
||||
let offset = flush_subnormal(offset);
|
||||
let color = channel_tint.map(|tint| if tinted_offset { coverage.mul_add(tint, offset) } else { coverage * tint });
|
||||
|
||||
@@ -1,37 +1,36 @@
|
||||
/// Prepare the per-stamp constants once, then sample coverage and the signed channel offset.
|
||||
pub(super) fn prepare(pattern: i32, variation: f32) -> impl Fn(f32, f32) -> Result<(f32, f32), String> {
|
||||
pub(super) fn prepare(pattern: i32, variation: f32) -> impl Fn(f32, f32) -> Result<Option<(f32, f32)>, String> {
|
||||
let width = match pattern {
|
||||
9 if variation > 0.0 => variation.max(f32::MIN_POSITIVE),
|
||||
12 | 14 => 1.0 - variation.max(0.0),
|
||||
_ => 0.0,
|
||||
};
|
||||
let inverse_width = if width == 0.0 { 0.0 } else { crate::function::pixel_divide(1.0, width) };
|
||||
move |x, y| profile(pattern, x, y, variation, inverse_width)
|
||||
let circular = matches!(pattern, 3..=7 | 11..=14 | 16 | 18);
|
||||
move |x: f32, y: f32| {
|
||||
let radius_squared = y.mul_add(y, x * x);
|
||||
// An uncovered pixel preserves the background even when the blend selects the maximum.
|
||||
if circular && radius_squared > 1.0 {
|
||||
return Ok(None);
|
||||
}
|
||||
profile(pattern, x, y, radius_squared, variation, inverse_width).map(Some)
|
||||
}
|
||||
}
|
||||
|
||||
fn profile(pattern: i32, x: f32, y: f32, variation: f32, inverse_width: f32) -> Result<(f32, f32), String> {
|
||||
let radius_squared = y.mul_add(y, x * x);
|
||||
fn profile(pattern: i32, x: f32, y: f32, radius_squared: f32, variation: f32, inverse_width: f32) -> Result<(f32, f32), String> {
|
||||
let radial = (1.0 - radius_squared).max(0.0);
|
||||
let value = match pattern - 1 {
|
||||
1 => 1.0,
|
||||
2 => {
|
||||
if radius_squared <= 1.0 {
|
||||
1.0
|
||||
} else {
|
||||
0.0
|
||||
}
|
||||
}
|
||||
3 => radial,
|
||||
4 => quartic_bell(radius_squared),
|
||||
5 if radius_squared > 1.0 => 0.0,
|
||||
5 => {
|
||||
let value = match pattern {
|
||||
2 | 3 => 1.0,
|
||||
4 => radial,
|
||||
5 => quartic_bell(radius_squared),
|
||||
6 => {
|
||||
const FALLOFF: f32 = 11.1 * std::f32::consts::LOG2_E;
|
||||
(crate::function::pixel_exp2(-FALLOFF * radius_squared) - 0.000_015_1).max(0.0)
|
||||
}
|
||||
6 => (1.0 - crate::function::pixel_sqrt(radius_squared)).max(0.0).powi(4),
|
||||
7 => (1.0 - x.abs().max(y.abs())).max(0.0),
|
||||
8 if variation <= 0.0 => 1.0,
|
||||
8 => {
|
||||
7 => (1.0 - crate::function::pixel_sqrt(radius_squared)).max(0.0).powi(4),
|
||||
8 => (1.0 - x.abs().max(y.abs())).max(0.0),
|
||||
9 if variation <= 0.0 => 1.0,
|
||||
9 => {
|
||||
// Each edge fades independently, including at a corner.
|
||||
let fade = |coordinate: f32| {
|
||||
let t = ((1.0 - coordinate.abs()) * inverse_width).clamp(0.0, 1.0);
|
||||
@@ -40,8 +39,8 @@ fn profile(pattern: i32, x: f32, y: f32, variation: f32, inverse_width: f32) ->
|
||||
};
|
||||
fade(x) * fade(y)
|
||||
}
|
||||
9 => (x + 1.0) * 0.5 * (1.0 - variation.max(0.0)),
|
||||
10 => {
|
||||
10 => (x + 1.0) * 0.5 * (1.0 - variation.max(0.0)),
|
||||
11 => {
|
||||
let cycles = 1.5 + 6.0 * f64::from(variation.max(0.0));
|
||||
let phase = f64::from(x) * cycles;
|
||||
let triangle = (1.0 - 4.0 * (phase - phase.round()).abs()) as f32;
|
||||
@@ -51,23 +50,22 @@ fn profile(pattern: i32, x: f32, y: f32, variation: f32, inverse_width: f32) ->
|
||||
let wave = parabola * CORRECTION.mul_add(parabola.abs(), 1.0 - CORRECTION);
|
||||
radial * (0.5 * wave + 0.5)
|
||||
}
|
||||
11 => quartic_bell(radius_squared) * descending_fade(x, inverse_width),
|
||||
12 => quartic_bell(radius_squared) * (1.0 - x.abs()).powi(2),
|
||||
13 => {
|
||||
12 => quartic_bell(radius_squared) * descending_fade(x, inverse_width),
|
||||
13 => quartic_bell(radius_squared) * (1.0 - x.abs()).powi(2),
|
||||
14 => {
|
||||
let t = radius_squared.min(1.0);
|
||||
// Normalize t(1-t)² to one at t=1/3.
|
||||
let ring = 6.75_f32.mul_add(t, -13.5).mul_add(t, 6.75) * t;
|
||||
ring * descending_fade((x + 1.0) * 0.5, inverse_width)
|
||||
}
|
||||
14 => {
|
||||
15 => {
|
||||
let tip = (x.abs() - 0.77 * variation.max(0.0)).max(0.0);
|
||||
let distance_squared = y.mul_add(y, tip * tip);
|
||||
(-20.0_f32).mul_add(distance_squared, 1.0).max(0.0)
|
||||
}
|
||||
15 => (1.0 - crate::function::pixel_sqrt(radius_squared)).max(0.0),
|
||||
16 => return Ok(((x + 1.0) * 0.5, variation)),
|
||||
17 if radius_squared <= 1.0 => return Ok((crate::function::pixel_sqrt(radial), variation)),
|
||||
17 => 0.0,
|
||||
16 => (1.0 - crate::function::pixel_sqrt(radius_squared)).max(0.0),
|
||||
17 => return Ok(((x + 1.0) * 0.5, variation)),
|
||||
18 => return Ok((crate::function::pixel_sqrt(radial), variation)),
|
||||
_ => return Err(format!("unknown built-in pattern {pattern}")),
|
||||
};
|
||||
|
||||
|
||||
@@ -4,8 +4,7 @@ use std::collections::BTreeMap;
|
||||
|
||||
fn coverage(shape: i32, x: f32, y: f32, variation: f32) -> f32 {
|
||||
let sample = super::shape::prepare(shape, variation);
|
||||
let (base, offset) = sample(x, y).unwrap();
|
||||
base + offset
|
||||
sample(x, y).unwrap().map_or(0.0, |(base, offset)| base + offset)
|
||||
}
|
||||
|
||||
#[test]
|
||||
@@ -46,6 +45,25 @@ fn bell_stamps_keep_signed_samples_until_blending() {
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn radial_stamp_draws_its_boundary_and_leaves_the_corners_of_its_quad_clear() {
|
||||
let variables = BTreeMap::from([("$tiling".into(), Value::Int(0))]);
|
||||
for (shape, variation, corner, edge) in
|
||||
[(3, 0.25, -0.25, 1.0), (4, 0.25, -0.25, 0.0), (5, 0.25, -0.25, 0.0), (10, 1.0, 0.0, 0.0), (15, 1.0, 0.0, 0.0), (18, 0.25, -0.25, 0.25)]
|
||||
{
|
||||
let mut graph = PatternGraph::with_root(PatternNodeKind::Quadrant);
|
||||
graph.nodes[0].parameters = BTreeMap::from([
|
||||
("patterntype".into(), Value::Int(shape)),
|
||||
("patternsuppl".into(), Value::Float(variation)),
|
||||
("blendingmode".into(), Value::Int(1)),
|
||||
("frameoffset".into(), Value::Float2([1.0 / 128.0; 2])),
|
||||
("patternsize".into(), Value::Float2([0.5; 2])),
|
||||
]);
|
||||
let image = cook_in_regions(graph, &variables, 322224, [64; 2], [[0.0, 1.0, 0.0, 1.0]; 2], -0.25).unwrap().remove(0);
|
||||
assert_eq!([image.get_gray(20, 20, false), image.get_gray(48, 32, false)], [corner, edge], "shape {shape}");
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn beveled_square_multiplies_the_two_edge_profiles() {
|
||||
for (x, y, variation, expected) in [
|
||||
@@ -164,10 +182,8 @@ fn solid_stamps_round_the_alpha_blend_at_accumulator_precision() {
|
||||
}
|
||||
}
|
||||
|
||||
fn assert_stamp_pixel(shape: i32, color: bool, tint: Value, gain: f32, background: f32, expected: [u32; 4]) {
|
||||
fn stamp_on_background(graph: PatternGraph, color: bool, gain: f32, background: [f32; 4], seed: u32) -> craft_texture::Image {
|
||||
let definition = find("fx_map").unwrap();
|
||||
let mut graph = PatternGraph::with_root(PatternNodeKind::Quadrant);
|
||||
graph.nodes[0].parameters = BTreeMap::from([("patterntype".into(), Value::Int(shape)), ("opacity".into(), tint), ("blendingmode".into(), Value::Int(0))]);
|
||||
let params = resolve_params(
|
||||
definition,
|
||||
&BTreeMap::from([
|
||||
@@ -175,7 +191,7 @@ fn assert_stamp_pixel(shape: i32, color: bool, tint: Value, gain: f32, backgroun
|
||||
("roughness".into(), Value::Float(0.0)),
|
||||
("color_mode".into(), Value::Bool(color)),
|
||||
("opacity".into(), Value::Float(gain)),
|
||||
("background".into(), Value::Color([background; 4])),
|
||||
("background".into(), Value::Color(background)),
|
||||
]),
|
||||
);
|
||||
let context = CookContext {
|
||||
@@ -183,18 +199,52 @@ fn assert_stamp_pixel(shape: i32, color: bool, tint: Value, gain: f32, backgroun
|
||||
format: materialcraft_core::OutputFormat::F32,
|
||||
w: 32,
|
||||
h: 32,
|
||||
seed: 7,
|
||||
seed,
|
||||
tile: true,
|
||||
inputs: &[],
|
||||
params: ¶ms,
|
||||
resource: &|_| None,
|
||||
vars: &BTreeMap::new(),
|
||||
};
|
||||
let image = (definition.cook)(&context).unwrap().remove(0);
|
||||
(definition.cook)(&context).unwrap().remove(0)
|
||||
}
|
||||
|
||||
fn assert_stamp_pixel(shape: i32, color: bool, tint: Value, gain: f32, background: f32, expected: [u32; 4]) {
|
||||
let mut graph = PatternGraph::with_root(PatternNodeKind::Quadrant);
|
||||
graph.nodes[0].parameters = BTreeMap::from([("patterntype".into(), Value::Int(shape)), ("opacity".into(), tint), ("blendingmode".into(), Value::Int(0))]);
|
||||
let image = stamp_on_background(graph, color, gain, [background; 4], 7);
|
||||
let pixel = image.get(16, 16, false).map(f32::to_bits);
|
||||
assert_eq!(&pixel[..image.channels()], &expected[..image.channels()], "shape {shape}, color {color}, opacity {gain}");
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn zero_authored_stamp_opacity_is_distinct_from_zero_graph_opacity() {
|
||||
let linked = |value| Value::Function(Box::new(FunctionGraph::constant(Value::Float(value))));
|
||||
let tiny = f32::from_bits(1 << 19);
|
||||
for (shape, tint, gain, gray, red) in [
|
||||
(2, Value::Float4([0.0; 4]), 1.0, -0.25, -0.25),
|
||||
(2, Value::Float4([1.0; 4]), 0.0, 0.0, -0.25),
|
||||
(17, Value::Float4([0.0; 4]), 1.0, 0.25, 0.0625),
|
||||
(18, Value::Float4([0.0; 4]), 1.0, -0.25, -0.25),
|
||||
(18, Value::Float4([1.0; 4]), 0.0, 0.25, 0.0625),
|
||||
(18, linked(tiny), 1.0, -0.25, -0.25),
|
||||
(18, linked(-tiny), 1.0, -0.25, -0.25),
|
||||
(18, linked(f32::MIN_POSITIVE), 1.0, 0.25, 0.0625),
|
||||
] {
|
||||
for (color, expected) in [(false, gray), (true, red)] {
|
||||
let mut graph = PatternGraph::with_root(PatternNodeKind::Quadrant);
|
||||
graph.nodes[0].parameters = BTreeMap::from([
|
||||
("patterntype".into(), Value::Int(shape)),
|
||||
("opacity".into(), tint.clone()),
|
||||
("blendingmode".into(), Value::Int(1)),
|
||||
("patternsuppl".into(), Value::Float(0.25)),
|
||||
]);
|
||||
let image = stamp_on_background(graph, color, gain, [-0.25; 4], 328019);
|
||||
assert_eq!(image.get(16, 16, false)[0], expected, "shape {shape}, color {color}, gain {gain}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn gradient_stamp_offsets_apply_to_the_tinted_channels() {
|
||||
let background = [0.5, 0.375, 0.75, 0.875];
|
||||
@@ -212,30 +262,7 @@ fn gradient_stamp_offsets_apply_to_the_tinted_channels() {
|
||||
("opacity".into(), Value::Float4([0.75, 0.375, 1.0, 0.625])),
|
||||
("blendingmode".into(), Value::Int(blend)),
|
||||
]);
|
||||
let definition = find("fx_map").unwrap();
|
||||
let parameters = resolve_params(
|
||||
definition,
|
||||
&BTreeMap::from([
|
||||
("pattern".into(), Value::PatternGraph(Box::new(graph))),
|
||||
("color_mode".into(), Value::Bool(true)),
|
||||
("roughness".into(), Value::Float(0.0)),
|
||||
("opacity".into(), Value::Float(0.5)),
|
||||
("background".into(), Value::Color(background)),
|
||||
]),
|
||||
);
|
||||
let context = CookContext {
|
||||
input_formats: &[],
|
||||
format: materialcraft_core::OutputFormat::F32,
|
||||
w: 32,
|
||||
h: 32,
|
||||
seed: 468,
|
||||
tile: true,
|
||||
inputs: &[],
|
||||
params: ¶meters,
|
||||
resource: &|_| None,
|
||||
vars: &BTreeMap::new(),
|
||||
};
|
||||
let image = (definition.cook)(&context).unwrap().remove(0);
|
||||
let image = stamp_on_background(graph, true, 0.5, background, 468);
|
||||
assert_eq!(image.get(position, position, false).map(f32::to_bits), expected);
|
||||
}
|
||||
}
|
||||
@@ -249,7 +276,7 @@ fn cook_at_size(graph: PatternGraph, variables: &BTreeMap<String, Value>, seed:
|
||||
}
|
||||
|
||||
fn cook_at_dimensions(graph: PatternGraph, variables: &BTreeMap<String, Value>, seed: u32, width: u32, height: u32) -> crate::CookResult {
|
||||
cook_in_regions(graph, variables, seed, [width, height], [[0.0, 1.0, 0.0, 1.0]; 2])
|
||||
cook_in_regions(graph, variables, seed, [width, height], [[0.0, 1.0, 0.0, 1.0]; 2], 0.0)
|
||||
}
|
||||
|
||||
fn cook_in_regions(
|
||||
@@ -258,6 +285,7 @@ fn cook_in_regions(
|
||||
seed: u32,
|
||||
[width, height]: [u32; 2],
|
||||
[render, tiling]: [[f32; 4]; 2],
|
||||
background: f32,
|
||||
) -> crate::CookResult {
|
||||
let definition = find("fx_map").unwrap();
|
||||
|
||||
@@ -268,6 +296,7 @@ fn cook_in_regions(
|
||||
("pattern".into(), Value::PatternGraph(Box::new(graph))),
|
||||
("roughness".into(), Value::Float(0.0)),
|
||||
("color_mode".into(), Value::Bool(false)),
|
||||
("background".into(), Value::Color([background; 4])),
|
||||
("render_region".into(), Value::Float4(render)),
|
||||
("tiling_region".into(), Value::Float4(tiling)),
|
||||
]),
|
||||
@@ -432,7 +461,7 @@ fn shifted_region_keeps_the_original_center_for_tiled_copies() {
|
||||
("frameoffset".into(), Value::Float2(center)),
|
||||
("patternsize".into(), Value::Float2(size)),
|
||||
]);
|
||||
let image = cook_in_regions(graph, &BTreeMap::new(), 319091, canvas, regions).unwrap().remove(0);
|
||||
let image = cook_in_regions(graph, &BTreeMap::new(), 319091, canvas, regions, 0.0).unwrap().remove(0);
|
||||
assert_eq!(image.get_gray(x, y, false).to_bits(), expected, "center {center:?}");
|
||||
}
|
||||
}
|
||||
@@ -449,7 +478,7 @@ fn shifted_region_stores_the_snap_offset_in_pattern_space() {
|
||||
("patternrotation".into(), Value::Float(0.25)),
|
||||
]);
|
||||
let regions = [[-0.173, 0.369, 0.096, 0.869], [0.019, 0.631, -0.073, 0.689]];
|
||||
let image = cook_in_regions(graph, &BTreeMap::new(), 319613, [32, 64], regions).unwrap().remove(0);
|
||||
let image = cook_in_regions(graph, &BTreeMap::new(), 319613, [32, 64], regions, 0.0).unwrap().remove(0);
|
||||
assert_eq!(image.get_gray(0, 2, false).to_bits(), 0x3cd4_7660);
|
||||
}
|
||||
|
||||
|
||||
@@ -534,6 +534,44 @@ For each root’s 25 follow-up renders, the 5,120 U8, 553,728 U16, 78,336 F16 an
|
||||
|
||||
In a single-worker release run, four interleaved measurements of the 128² default, 256² default and 512² filled cases gave median whole-graph cook times of 46, 259 and 1,138 ms for Alveolus (previously 45, 247 and 1,068 ms). Pattern Alveolus took 45, 253 and 1,083 ms (previously 43, 238 and 1,045 ms).
|
||||
|
||||
### Circular stamp coverage and zero stamp opacity
|
||||
|
||||
A circular stamp preserves its background outside the unit disc. Samples exactly on the circumference still enter the blend, including a zero-valued sample. On a 64² F32 canvas, draw a white stamp centered at (32.5,32.5) pixels with size (32,32) pixels and maximum blending over −.25. At (20,20) a disc, paraboloid and bell each leave −.25. At (48,32) their values are 1, 0 and 0. A fully attenuated horizontal ramp and the capsule both write zero at (20,20). The circular selectors are 3–7, 11–14, 16 and 18.
|
||||
|
||||
Authored opacity is tested after flushing subnormal values and before multiplying by graph opacity. With zero authored opacity all built-in selectors except the horizontal offset ramp preserve the background. The horizontal offset ramp still contributes its variation. At graph opacity zero, a hemisphere with nonzero authored opacity still contributes its variation inside the disc. For variation .25 over gray −.25 and maximum blending the center pixel is .25 at graph opacity zero and −.25 at authored opacity zero. The smallest normal F32 value and two signed subnormal values distinguish the two stages. [Earlier opacity and accumulator controls](#pattern-opacity-near-zero-and-color-accumulation)
|
||||
|
||||
| F32 comparison | Renders | Previously exact | Now exact / compared | Maximum absolute error |
|
||||
|---|---:|---:|---:|---:|
|
||||
| Grayscale selectors and blend modes | 312 | 770,731 | 877,555/878,592 | 5.960464477539063e-08 |
|
||||
| All selectors on signed backgrounds | 84 | 263,102 | 302,307/311,808 | 3.0994415283203125e-06 |
|
||||
| Gray swatches and global gain | 204 | 655,067 | 833,852/835,584 | 5.960464477539063e-08 |
|
||||
| RGBA swatches and global gain | 204 | 826,976 | 834,227/835,584 | 1.1920928955078125e-07 |
|
||||
| Linked scalar and vector, gray | 56 | 35,520 | 57,344/57,344 | 0 |
|
||||
| Linked scalar and vector, RGBA | 56 | 52,472 | 57,344/57,344 | 0 |
|
||||
|
||||
For the 312 selector and blend controls use a single unwrapped stamp over −.25. In order, use these (output, normalized center, normalized size, turns) settings.
|
||||
|
||||
| Index | Output | Center | Size | Turns |
|
||||
|---:|---|---|---|---:|
|
||||
| 0 | 64² | .5, .5 | 1, 1 | 0 |
|
||||
| 1 | 64² | 32.5/64, 32.5/64 | .5, .5 | 0 |
|
||||
| 2 | 32×64 | 15.5/32, 28.5/64 | .75, .5 | 0 |
|
||||
| 3 | 64×32 | 28.5/64, 15.5/32 | .5, .75 | .25 |
|
||||
| 4 | 64² | .5, .5 | 1, 1 | .125 |
|
||||
| 5 | 32×16 | .4375, .375 | 1.25, .75 | .5 |
|
||||
|
||||
First use selectors (3,4,5,6,7,11,12,13,14,16,18) with variation .25, white tint and mode 1. Then use (9,10,12,14,15) with variation 1 and the same tint and mode. Finally use (2,5,17,18) with variation .25, grayscale tints (0,−.125,.0001) and blend modes (0,1,2) in that order, with mode varying fastest. Set the seed to 322193 + 31 × geometry index + control index, starting both at zero. The 72 zero-tint renders match 202,752/202,752 pixels.
|
||||
|
||||
For the 84-render selector comparison use the negative-background, maximum-blend bell geometries 0, 1, 4 and 5 (seeds 316166, 316203, 316314 and 316351). Use all 17 selectors with white tint and variation .25, selectors 2, 3 and 5 with black tint and variation .25, and selector 10 with white tint and variation 1. [Bell geometries](#image-inputs-and-bell-stamps-in-brick-generator-tile)
|
||||
|
||||
For the two 204-render swatch matrices, use every selector from 2 through 18, variation .25, mode 1 and geometries 0, 1 and 4. Use black with alpha 1, white with alpha 0, then (.75,.375,1,.625) at graph opacities 0 and 1. The first two swatches have graph opacity 1. Use gray −.25 or RGBA (−.25,.375,−.125,.5) as background. Set the seed to 328019 + 37 × geometry index + selector + swatch index. For the linked controls use a 32² unit stamp on those backgrounds with selectors 2, 5, 17 and 18. Drive opacity with a scalar or a vector (.625,.375,1,alpha). Use −.125, 0, .0001, 2⁻¹²⁶, 2⁻¹³⁰, −2⁻¹³⁰ and .375 as scalar or alpha. The seed is 329691 + value index.
|
||||
|
||||
Gray bell controls at the earlier settings match 57,344/57,344, 57,331/57,344, 57,091/57,344, 124,189/126,976 pixels in U8, U16, F16 and F32 respectively. The maximum errors in the same order are 0, 1, 0.0001220703125, 4.166056442045374e-07. RGBA bell controls at the earlier settings match 57,344/57,344, 57,313/57,344, 57,138/57,344, 124,172/126,976 pixels in U8, U16, F16 and F32 respectively. The maximum errors in the same order are 0, 1, 0.000244140625, 2.8312206268310547e-07. [Bell geometry, formats and seeds](#image-inputs-and-bell-stamps-in-brick-generator-tile)
|
||||
|
||||
The intact BNW Spots 1 and BNW Spots 3 outputs still match 197,377/204,288 and 180,975/185,856 pixels across 34 and 27 renders. The largest errors remain 3 and 2 levels in U16, and .0000431537628 and .0000305175781 in F32. The two Tile helpers and Gradient Linear 1 continue to match in all four formats and on their recorded saved-file settings. [Intact roots and remaining rotation differences](#rotated-stamp-coordinates-in-gradient-linear-1-and-bnw-spots)
|
||||
|
||||
The median single-worker release cook across four alternating measurements per version was 173.8 to 170.6 ms for 64² Spots 1 (seed 8855) and 150.1 to 146.5 ms for 64² Spots 3 (seed 8868). Both used disorder .84375 and F32 output.
|
||||
|
||||
### Rotated stamp coordinates in Gradient Linear 1 and BNW Spots
|
||||
|
||||
Gradient Linear 1 matches 958,208/958,208 pixels across 79 renders, with zero maximum error in U8, U16, F16 and F32. The earlier 47 renders differed on 16 U8, 16 U16, 16 F16 and 176 F32 pixels. Maximum errors were one integer level, .000244140625 F16 and .0000152587890625 F32. All 32 additional settings match after reopening the MaterialCraft save in both apps. The reference also reproduces every original output from the saved file. [Earlier root settings and phase measurements](#pattern-rotation-phase) · [Rectangular gradient controls](#linear-gradient-sampling-on-rectangular-targets)
|
||||
|
||||
@@ -138,8 +138,8 @@ The reference app reopened both intact Alveolus graphs saved with the corrected
|
||||
| [blend_switch.sbs/switch_grayscale](../assets/sbs/blend_switch.sbs) | 2 | No | [Parity: 6 cases](parity-fixes.md#verified-cases) |
|
||||
| [blur_hq.sbs/blur_hq](../assets/sbs/blur_hq.sbs) | 1 | No | [Parity · 18 renders, 171,264 exact pixels across four formats](parity-fixes.md#integer-and-oblique-directional-blur) |
|
||||
| [blur_hq.sbs/blur_hq_grayscale](../assets/sbs/blur_hq.sbs) | 1 | No | [Parity · 18 renders, 171,264 exact pixels across four formats](parity-fixes.md#integer-and-oblique-directional-blur) |
|
||||
| [bnw_spots_1.sbs/bnw_spots_1](../assets/sbs/bnw_spots_1.sbs) | 0 | Yes | [In progress · 197,377/204,288 pixels across 34 renders](parity-fixes.md#rotated-stamp-coordinates-in-gradient-linear-1-and-bnw-spots) · [64,000/64,000 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) |
|
||||
| [bnw_spots_3.sbs/bnw_spots_3](../assets/sbs/bnw_spots_3.sbs) | 0 | Yes | [In progress · 180,975/185,856 pixels across 27 renders](parity-fixes.md#rotated-stamp-coordinates-in-gradient-linear-1-and-bnw-spots) · [27,136/27,136 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) |
|
||||
| [bnw_spots_1.sbs/bnw_spots_1](../assets/sbs/bnw_spots_1.sbs) | 0 | Yes | [In progress · 197,377/204,288 pixels across 34 renders](parity-fixes.md#rotated-stamp-coordinates-in-gradient-linear-1-and-bnw-spots) · [64,000/64,000 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) · [Circular stamp and opacity controls](parity-fixes.md#circular-stamp-coverage-and-zero-stamp-opacity) |
|
||||
| [bnw_spots_3.sbs/bnw_spots_3](../assets/sbs/bnw_spots_3.sbs) | 0 | Yes | [In progress · 180,975/185,856 pixels across 27 renders](parity-fixes.md#rotated-stamp-coordinates-in-gradient-linear-1-and-bnw-spots) · [27,136/27,136 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) · [Circular stamp and opacity controls](parity-fixes.md#circular-stamp-coverage-and-zero-stamp-opacity) |
|
||||
| [brick_1.sbs/brick_1](../assets/sbs/brick_1.sbs) | 0 | Yes | [Parity · 131 renders, 3,194,368/3,194,368 pixels](parity-fixes.md#fractional-stamp-vertices-and-the-last-covered-pixel) · [64,000/64,000 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) · [Earlier generator settings](parity-fixes.md#square-and-rectangular-pattern-generators) |
|
||||
| [brick_2.sbs/brick_2](../assets/sbs/brick_2.sbs) | 0 | Yes | [Parity · 124 renders, 3,175,936/3,175,936 pixels](parity-fixes.md#fractional-stamp-vertices-and-the-last-covered-pixel) · [27,136/27,136 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) · [Earlier generator settings](parity-fixes.md#square-and-rectangular-pattern-generators) |
|
||||
| [brick_3.sbs/brick_3](../assets/sbs/brick_3.sbs) | 0 | Yes | [Parity · 100 renders, 1,295,872/1,295,872 pixels](parity-fixes.md#wrapped-stamp-centers-in-brick-3) · [64,000/64,000 downstream pixels](parity-fixes.md#isolating-the-generators-in-spots-bricks-and-cells) · [Depth opacity measurements](parity-fixes.md#stored-opacity-across-pattern-depths) |
|
||||
|
||||
Reference in new issue
Block a user