Avokadoen / zig_vulkan

Toying with vulkan and zig
45 stars 1 forks source link

Find a good color blending scheme for ray color #135

Closed Avokadoen closed 2 years ago

Avokadoen commented 2 years ago

Currently the color formula is very straight forward:

// ray init
current_ray.color = vec3(1);

// in loop
current_ray.color *= (attenuation * luminosity);

This is fine until repeated bounces are inspected. What we should see in the image is the lit side being the egg white color of the surface, and most of the shadowed area should be lit by the lit side since bounces are set to 3 here image

Avokadoen commented 2 years ago

Ray tracing the next weekend has a concept of emit: https://github.com/RayTracing/TheNextWeek/tree/master/src But the recursive nature of the code makes it harder than a copy paste :sweat_smile:

Avokadoen commented 2 years ago

related branch https://github.com/Avokadoen/zig_vulkan/tree/color_blend