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) {
73 accumulated_weight += weight;
74 accumulated_color += sample_color * weight;
77 accumulated_color /= accumulated_weight != 0.0f ? accumulated_weight : 1.0f;
MINLINE void copy_v4_v4(float r[4], const float a[4])
Read Guarded memory(de)allocation.
a MemoryBuffer contains access to the data
const int get_width() const
get the width of this MemoryBuffer
const int get_height() const
get the height of this MemoryBuffer
float * get_elem(int x, int y)
float4 texture_bilinear_extend(float2 coordinates) const
void add_output_socket(DataType datatype)
void add_input_socket(DataType datatype, ResizeMode resize_mode=ResizeMode::Center)
void set_canvas_input_index(unsigned int index)
set the index of the input socket that will determine the canvas of this operation
void update_memory_buffer_partial(MemoryBuffer *output, const rcti &area, Span< MemoryBuffer * > inputs) override
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
T distance(const T &a, const T &b)
T length(const VecBase< T, Size > &a)
T min(const T &a, const T &b)
T max(const T &a, const T &b)
VecBase< float, 4 > float4
VecBase< float, 2 > float2
static blender::bke::bNodeSocketTemplate inputs[]