better colors for the show

This commit is contained in:
numzero 2025-11-26 11:47:31 +03:00
parent 13fb710dc7
commit a98eda1616
2 changed files with 5 additions and 5 deletions

View File

@ -234,7 +234,7 @@ impl Core {
const BASE: Sphere = Sphere { const BASE: Sphere = Sphere {
position: vec3(0., 0., -BASE_R), position: vec3(0., 0., -BASE_R),
radius: BASE_R, radius: BASE_R,
color: vec3(0.1, 0.5, 0.0), color: vec3(0.01, 0.03, 0.30),
}; };
fn sphere(pos: Vec3, color: Vec3) -> Sphere { fn sphere(pos: Vec3, color: Vec3) -> Sphere {
Sphere { Sphere {
@ -246,9 +246,9 @@ impl Core {
let scene = Scene { let scene = Scene {
objects: vec![ objects: vec![
BASE, BASE,
sphere(vec3(0., 0., 0.1), vec3(1., 0.3, 0.0)), sphere(vec3(0., 0., 0.1), vec3(1., 1., 1.)),
sphere(vec3(0.3, 0., 0.1), vec3(0.3, 1., 0.0)), sphere(vec3(0.3, 0., 0.1), vec3(1., 1., 1.)),
sphere(vec3(0.1, 0.3, 0.1), vec3(0.3, 0.0, 1.)), sphere(vec3(0.1, 0.3, 0.1), vec3(0.5, 0.03, 0.01)),
], ],
}; };

View File

@ -15,7 +15,7 @@ struct Varying {
@group(0) @binding(0) var<uniform> look: LookParams; @group(0) @binding(0) var<uniform> look: LookParams;
fn colormap(light: vec3f) -> vec3f { fn colormap(light: vec3f) -> vec3f {
let avg = dot(light, vec3f(1. / 3.)); let avg = dot(light, vec3f(0.2126, 0.7152, 0.0722));
let scale = 1. / (1. + avg); let scale = 1. / (1. + avg);
return scale * light; return scale * light;
} }