I'm trying to get accustomed to how baking works in LuxCoreRender, however there are a few points I'm a little confused about:
1) I've tried baking the lightmaps for the bake demo scene (https://github.com/LuxCoreRender/LuxCor ... r-bake.cfg) using luxcoreconsole.
The scene has both a film output and a bake output defined:
Code: Select all
film.outputs.0.type = "RGBA_IMAGEPIPELINE"
film.outputs.0.filename = "RGBA_IMAGEPIPELINE_0.png"
film.outputs.0.index = "0"
bake.maps.0.type = "LIGHTMAP"
bake.maps.0.filename = "1398588469529680.exr"
But what exactly is the purpose of the film output in this case? It looks completely different and it places everything weirdly into a corner of the image:
2) I want the lightmaps with the original, unmodified HDR colors, i.e. no gamma correction, no tone-mapping, etc. So, I've tried this configuration with just NOP in the image pipeline:
Code: Select all
renderengine.type = "BAKECPU"
sampler.type = "SOBOL"
film.filter.type = "BLACKMANHARRIS"
film.filter.width = 4
film.width = 1024
film.height = 1024
batch.haltspp = 512
batch.haltnoisethreshold = 0.03
film.outputs.0.type = "RGBA"
film.outputs.0.filename = "RGBA_0.exr"
film.outputs.0.index = "0"
film.imagepipelines.0.0.type = "NOP"
bake.minmapautosize = 256
bake.maxmapautosize = 512
bake.powerof2autosize.enable = 1
bake.maps.0.type = "LIGHTMAP"
bake.maps.0.filename = "1398588469529680.exr"
bake.maps.0.imagepipelineindex = 0
bake.maps.0.autosize.enabled = 1
bake.maps.0.uvindex = 0
bake.maps.0.objectnames = "1398588469529680"
scene.file = "scene.scn"
If I also add a linear tonemap with a scale of 1 (which should be equivalent to NOP if I'm understanding it correctly), it works:
Code: Select all
renderengine.type = "BAKECPU"
sampler.type = "SOBOL"
film.filter.type = "BLACKMANHARRIS"
film.filter.width = 4
film.width = 1024
film.height = 1024
batch.haltspp = 512
batch.haltnoisethreshold = 0.03
film.outputs.0.type = "RGBA"
film.outputs.0.filename = "RGBA_0.exr"
film.outputs.0.index = "0"
film.imagepipelines.0.0.type = "NOP"
film.imagepipelines.0.1.type = "TONEMAP_LINEAR"
film.imagepipelines.0.1.scale = "1"
bake.minmapautosize = 256
bake.maxmapautosize = 512
bake.powerof2autosize.enable = 1
bake.maps.0.type = "LIGHTMAP"
bake.maps.0.filename = "1398588469529680.exr"
bake.maps.0.imagepipelineindex = 0
bake.maps.0.autosize.enabled = 1
bake.maps.0.uvindex = 0
bake.maps.0.objectnames = "1398588469529680"
scene.file = "scene.scn"
3) I want to do my own post-processing, so instead of saving the image data to a file, I'd just like to copy it to a buffer instead. For regular non-bake renders, I can just use film.GetOutput<float>(...) (instead of film.SaveOutputs()) and it works just fine:
Code: Select all
// Save the rendered image
// session->GetFilm().SaveOutputs();
auto &film = session->GetFilm();
std::vector<float> data {};
data.resize(film.GetWidth() *film.GetHeight() *4);
session->GetFilm().GetOutput<float>(luxcore::Film::FilmOutputType::OUTPUT_RGBA,data.data());
stbi_write_hdr("bake.hdr",film.GetWidth(),film.GetHeight(),4,data.data());
Is there some way to get the same data that is used for the actual bake outputs without having to save it to a file and then re-reading it?