split colormap
This commit is contained in:
parent
722e5d4b6e
commit
41579bbb5d
11
src/lib.rs
11
src/lib.rs
|
|
@ -373,17 +373,20 @@ impl Core {
|
|||
total_cd * args.accum_scale
|
||||
}
|
||||
};
|
||||
let colormap = |light: f32| {
|
||||
let brightness = 3. * (1. - (1. + light).recip());
|
||||
vec3(brightness, brightness - 1., brightness - 2.)
|
||||
.clamp(Vec3::splat(0.), Vec3::splat(1.))
|
||||
};
|
||||
let mut camera_ray_display: Vec<Vertex> = Vec::with_capacity(camera_rays.len());
|
||||
if args.show_light {
|
||||
let r = args.accum_sigma;
|
||||
for ray in camera_rays {
|
||||
let Some(hit) = scene.trace_ray(ray) else {
|
||||
continue;
|
||||
};
|
||||
let light = light_at(hit);
|
||||
let brightness = 3. * (1. - (1. + light).recip());
|
||||
let r = args.accum_sigma;
|
||||
let color = vec3(brightness, brightness - 1., brightness - 2.)
|
||||
.clamp(Vec3::splat(0.), Vec3::splat(1.));
|
||||
let color = colormap(light);
|
||||
let vertex = |off: Vec3| Vertex {
|
||||
pos: hit.incident.base + r * off,
|
||||
color,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user