bake engine

Discussion related to the LuxCore functionality, implementations and API.
Post Reply
BruceXu
Posts: 35
Joined: Wed Apr 15, 2020 7:16 am

bake engine

Post by BruceXu »

In the code of bakecpu/lightmap, when calculating the next ray, why does the sampling direction not need to be adjusted based on the sign of calculation result about dot(sampledDir, geometryN)?
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bake engine

Post by Dade »

BruceXu wrote: Mon Mar 29, 2021 12:35 pm In the code of bakecpu/lightmap, when calculating the next ray, why does the sampling direction not need to be adjusted based on the sign of calculation result about dot(sampledDir, geometryN)?
Where exactly, do you mean the BSDF::Evaluate() ?
Support LuxCoreRender project with salts and bounties
BruceXu
Posts: 35
Joined: Wed Apr 15, 2020 7:16 am

Re: bake engine

Post by BruceXu »

Dade wrote: Mon Mar 29, 2021 12:51 pm
BruceXu wrote: Mon Mar 29, 2021 12:35 pm In the code of bakecpu/lightmap, when calculating the next ray, why does the sampling direction not need to be adjusted based on the sign of calculation result about dot(sampledDir, geometryN)?
Where exactly, do you mean the BSDF::Evaluate() ?
Here it is.
https://github.com/LuxCoreRender/LuxCor ... thread.cpp +279~285
User avatar
Dade
Developer
Developer
Posts: 5672
Joined: Mon Dec 04, 2017 8:36 pm
Location: Italy

Re: bake engine

Post by Dade »

BruceXu wrote: Mon Mar 29, 2021 12:59 pm Here it is.
https://github.com/LuxCoreRender/LuxCor ... thread.cpp +279~285
Notice the:

Code: Select all

const Vector sampledDir = bsdf.GetFrame().ToWorld(localSampledDir);
It works in local frame and, in the local frame, Z+ is always geometryN.
Support LuxCoreRender project with salts and bounties
BruceXu
Posts: 35
Joined: Wed Apr 15, 2020 7:16 am

Re: bake engine

Post by BruceXu »

Dade wrote: Mon Mar 29, 2021 1:27 pm
BruceXu wrote: Mon Mar 29, 2021 12:59 pm Here it is.
https://github.com/LuxCoreRender/LuxCor ... thread.cpp +279~285
Notice the:

Code: Select all

const Vector sampledDir = bsdf.GetFrame().ToWorld(localSampledDir);
It works in local frame and, in the local frame, Z+ is always geometryN.
:D :D :D
I see, thank you.
Post Reply