29 const float2 input_size =
float2(input->get_width(), input->get_height());
33 for (
int y = area.ymin; y < area.ymax; y++) {
34 for (
int x = area.xmin; x < area.xmax; x++) {
36 copy_v4_v4(output->get_elem(x, y), input->get_elem(x, y));
52 const float2 coordinates = (texel +
float2(0.5f)) / input_size;
53 const float2 vector_to_source = source - coordinates;
54 const float2 step_vector = vector_to_source / unbounded_steps;
56 float accumulated_weight = 0.0f;
58 for (
int i = 0; i <=
steps; i++) {
59 float2 position = coordinates + i * step_vector;
63 if (position.x < 0.0f || position.y < 0.0f || position.x > 1.0f || position.y > 1.0f) {
67 const float4 sample_color = input->texture_bilinear_extend(position);
73 accumulated_weight += weight;
74 accumulated_color += sample_color * weight;
77 accumulated_color /= accumulated_weight != 0.0f ? accumulated_weight : 1.0f;
78 copy_v4_v4(output->get_elem(x, y), accumulated_color);
draw_view push_constant(Type::INT, "radiance_src") .push_constant(Type capture_info_buf storage_buf(1, Qualifier::READ, "ObjectBounds", "bounds_buf[]") .push_constant(Type draw_view int