diff --git a/ref_vk/shaders/ray.rgen b/ref_vk/shaders/ray.rgen index 2c41c1bb..063e7e73 100644 --- a/ref_vk/shaders/ray.rgen +++ b/ref_vk/shaders/ray.rgen @@ -12,6 +12,7 @@ const float shadow_offset_fudge = .1; const float pdf_culling_threshold = 100.; const float color_factor = 600.; const float color_culling_threshold = 600./color_factor; +const float throughput_threshold = 1e-3; layout (constant_id = 4) const float LIGHT_GRID_CELL_SIZE = 256.; layout (constant_id = 5) const uint MAX_LIGHT_CLUSTERS = 32768; @@ -404,6 +405,7 @@ void main() { material.baseColor = payload_opaque.base_color; material.metalness = 0.f; // TODO material.emissive = payload_opaque.emissive; + //material.roughness = uintToFloat01(xxhash32(uvec3(floor(payload_opaque.hit_pos_t.xyz/64.)))); //payload_opaque.roughness; material.roughness = payload_opaque.roughness; if (bounce == 0) { //brdfType == SPECULAR_TYPE) @@ -475,7 +477,7 @@ void main() { } throughput *= brdfWeight; - if (dot(throughput, throughput) < color_culling_threshold) + if (dot(throughput, throughput) < throughput_threshold) break; origin = payload_opaque.hit_pos_t.xyz;