A baking test scene

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: A baking test scene

Post by Dade »

Racleborg wrote: Tue Dec 03, 2019 10:54 pm A great feature!!! :D :D :D Awesome!
Be-aware that there is some stuff that may not yet work correctly, for instance, I have the feeling the baked map is shifted by half-pixel (something I have still to check), baking not diffuse materials is still an uncharted territory, etc.
Support LuxCoreRender project with salts and bounties
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: A baking test scene

Post by Racleborg »

Thanks for the warning. I was having issues with the baked texture not appearing in the correct place, so maybe that is due to the shift.
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: A baking test scene

Post by Racleborg »

I think I now have the texture 'size' working. Thanks

In Cycles, the baked texture is attached to an Emission shader which is then connected directly to the Material Output. I can't see how this is possible to do in Lux. Is the method in the attached image correct?
Thank you
Attachments
MIX BAKE OR NOT BAKE.jpg
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: A baking test scene

Post by Dade »

Racleborg wrote: Tue Dec 03, 2019 11:58 pm Thanks for the warning. I was having issues with the baked texture not appearing in the correct place, so maybe that is due to the shift.
The problem is quite small (see the black border on the white cube ?):

border.jpg

You may have a different problem caused the UV mapping. For instance, this is a default UV unwrapped cube:

unwrap-wrong.jpg

This is bad because you will have color bleeding between faces. It is like normal interpolation and auto-split: you need to have space in the UV map between faces or the color will be interpolated. This is an exampled of fixed UV mapping:

unwrap-ok.jpg

See how faces, in UV space, aren't anymore adjacent so color isn't interpolated anymore ?

To recap: you faces side by side if you want a smooth surface (like with normals) or you sperate them if you want and hard edge.
Support LuxCoreRender project with salts and bounties
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: A baking test scene

Post by Dade »

Racleborg wrote: Wed Dec 04, 2019 10:56 am I think I now have the texture 'size' working. Thanks

In Cycles, the baked texture is attached to an Emission shader which is then connected directly to the Material Output. I can't see how this is possible to do in Lux. Is the method in the attached image correct?
No, it can not be done with the current version of BlendLuxCore, it requires an explicit support. LuxCore has already what is required but BlendLuxCore must be extended.

It can be done working with .cfg files (and the very latest binaries when they are ready):

1) load the "render.cfg" in luxcoreui;
2) use the "Bake All" menu command;
3) it will generate 2 additional scene "render-bakeallobjects.cfg" and "render-bakedallobjects.cfg" (notice the "bake" and "baked" difference).
4) load "render-bakeallobjects.cfg" in luxcoreui to render all the maps;
5) once you have all maps, you can load "render-bakedallobjects.cfg" in luxcoreui to do the rendering with the created bake maps (i.e. with only one ray per sample).

You can also use in Cycles, the maps baked with LuxCore :idea:
Support LuxCoreRender project with salts and bounties
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: A baking test scene

Post by Racleborg »

It can be done working with .cfg files (and the very latest binaries when they are ready):

1) load the "render.cfg" in luxcoreui;
2) use the "Bake All" menu command;
3) it will generate 2 additional scene "render-bakeallobjects.cfg" and "render-bakedallobjects.cfg" (notice the "bake" and "baked" difference).
4) load "render-bakeallobjects.cfg" in luxcoreui to render all the maps;
5) once you have all maps, you can load "render-bakedallobjects.cfg" in luxcoreui to do the rendering with the created bake maps (i.e. with only one ray per sample).

You can also use in Cycles, the maps baked with LuxCore :idea:
Thank you again for all the help. I was wondering about rendering the baked textures in Cycles for animation and will probably give that a go as well as using the luxcoreUi. :)
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: A baking test scene

Post by Racleborg »

Dade
(and the very latest binaries when they are ready):
I've now got those and have managed to bake a few objects (such as a chess table top) which worked. :D

So, I could now possibly bake the Guru scene if that could be of help? (or just carry on testing it on other scenes)

Also, in Blender I'm using filmic, but when rendering in Luxcorerui is it using something else?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: A baking test scene

Post by Dade »

Racleborg wrote: Wed Dec 04, 2019 10:38 pm So, I could now possibly bake the Guru scene if that could be of help? (or just carry on testing it on other scenes)
Sure, the idea, at the end, is to include that scene in https://github.com/LuxCoreRender/LuxCoreTestScenes as bake demo.
Racleborg wrote: Wed Dec 04, 2019 10:38 pm Also, in Blender I'm using filmic, but when rendering in Luxcorerui is it using something else?
LuxCore has it is own image pipeline while BlendLuxCore does its own post-processing inside Blender (that part can not be exported and replicated by luxcoreui).
Support LuxCoreRender project with salts and bounties
Racleborg
Posts: 621
Joined: Sat Apr 07, 2018 10:31 am
Location: UK

Re: A baking test scene

Post by Racleborg »

LuxCore has it is own image pipeline while BlendLuxCore does its own post-processing inside Blender (that part can not be exported and replicated by luxcoreui).
Is there a correct way to set up the image pipeline in Blender so that it matches Luxcoreui?

Thank you
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: A baking test scene

Post by Dade »

Racleborg wrote: Thu Dec 05, 2019 8:44 am
LuxCore has it is own image pipeline while BlendLuxCore does its own post-processing inside Blender (that part can not be exported and replicated by luxcoreui).
Is there a correct way to set up the image pipeline in Blender so that it matches Luxcoreui?
This is a question for B.Y.O.B. :idea:
Support LuxCoreRender project with salts and bounties
Post Reply