Make object visibility and instancing creation to be calculated via depsgraph #57

Merged
Bogdan Nagirniak merged 16 commits from BLEN-442 into hydra-render 2023-07-08 10:09:53 +02:00
3 changed files with 5 additions and 7 deletions
Showing only changes of commit 01f072063b - Show all commits

View File

@ -39,7 +39,9 @@ void PreviewEngine::update_render_result(std::vector<float> &pixels)
RenderLayer *layer = (RenderLayer *)result->layers.first;
RenderPass *pass = (RenderPass *)layer->passes.first;
memcpy(pass->buffer.data, pixels.data(), sizeof(float) * pass->rectx * pass->recty * pass->channels);
memcpy(pass->buffer.data,
pixels.data(),
sizeof(float) * pass->rectx * pass->recty * pass->channels);
RE_engine_end_result(bl_engine_, result, false, false, false);
}

View File

@ -60,8 +60,6 @@ static std::string cache_image_file(Image *image,
}
}
BKE_image_save_options_free(&opts);
CLOG_INFO(LOG_RENDER_HYDRA_SCENE, 2, "%s -> %s", image->id.name, file_path.c_str());
return file_path;
}
@ -94,7 +92,7 @@ std::string cache_image_color(float color[4])
char name[128];
snprintf(name,
sizeof(name),
"color_%02x-%02x-%02x.hdr",
"color_%02x%02x%02x.hdr",
int(color[0] * 255),
int(color[1] * 255),
int(color[2] * 255));

View File

@ -270,9 +270,7 @@ void InstancerData::write_instances()
for (auto &l_inst : light_instances_.values()) {
update_light_instance(l_inst);
}
light_instances_.remove_if([&](auto item) {
return item.value.transforms.empty();
});
light_instances_.remove_if([&](auto item) { return item.value.transforms.empty(); });
}
void InstancerData::update_light_instance(LightInstance &inst)