39 if (
image->is_a_single_elem()) {
44 const int width =
image->get_width();
45 const int height =
image->get_height();
48 const int x_start = (it.x / pixel_size_) * pixel_size_;
49 const int y_start = (it.y / pixel_size_) * pixel_size_;
51 const int x_end = std::min(x_start + pixel_size_, width);
52 const int y_end = std::min(y_start + pixel_size_, height);
54 float4 color_accum(0, 0, 0, 0);
56 for (
int y = y_start;
y < y_end; ++
y) {
57 for (
int x = x_start;
x < x_end; ++
x) {
65 const int scale = (x_end - x_start) * (y_end - y_start);
67 copy_v4_v4(it.out, color_accum /
float(scale));
input_tx image(0, GPU_RGBA16F, Qualifier::WRITE, ImageType::FLOAT_2D, "preview_img") .compute_source("compositor_compute_preview.glsl") .do_static_compilation(true)
static blender::bke::bNodeSocketTemplate inputs[]