some more experiments toward a better palette

This commit is contained in:
2021-11-21 13:35:39 +01:00
parent 640c7fff52
commit 788a5657b5

View File

@@ -36,16 +36,17 @@ start fn gen_palette() {
let avg: f32;
loop gradients {
let lazy scale = (i % 48) as f32 / 48 as f32;
let inline angle = i as f32 * (3.1416 / 1.5) - i as f32 * (3.1416 / (11.0 * 16.0 * 1.5));
let c = sin(angle) * 1.0 + 0.7;
let limit = avg + 0.8;
avg = avg + (c - avg) * 0.5;
let lazy a = min(c, limit) * scale;
let lazy b = scale * scale * 0.6;
let inline angle = i as f32 * (3.1416 / 1.5 - 3.1416 / (11.0 * 16.0 * 1.5));
let lazy c = 0.4 - cos(angle);
let inline ulimit = avg + 0.8;
let inline llimit = avg - 0.8;
let lazy a = max(llimit, min(ulimit, c)) * (scale + 0.05);
let lazy b = scale * scale * 0.8;
let inline v = (select(i < 11*16*3, max(0 as f32, min(a + b - a * b, 1 as f32)), scale) * 255 as f32) as i32;
(i%3 + i/3*4)?(120+320*240) = v;
avg = (avg + c) * 0.5;
branch_if (i := i - 1) >= 0: gradients;
branch_if i := i - 1: gradients;
}
i = 255;