I want to implement a standard surface material similar to arnold

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

I want to implement a standard surface material similar to arnold

Post by BruceXu » Wed Sep 02, 2020 2:06 am

I want to implement a standard surface material similar to arnold, like https://autodesk.github.io/standard-surface/
However, when luxcore performs evaluation, only one of the reflection and transmission can be calculated at a time. How can I implement multiple lobes like a standard surface?

BruceXu
Posts: 17
Joined: Wed Apr 15, 2020 7:16 am

Re: I want to implement a standard surface material similar to arnold

Post by BruceXu » Wed Sep 02, 2020 9:26 am

BruceXu wrote:
Wed Sep 02, 2020 2:06 am
I want to implement a standard surface material similar to arnold, like https://autodesk.github.io/standard-surface/
However, when luxcore performs evaluation, only one of the reflection and transmission can be calculated at a time. How can I implement multiple lobes like a standard surface?
Or similar to the principled BSDF of cycles, adding a transmit to the Disney model

User avatar
B.Y.O.B.
Developer
Posts: 3768
Joined: Mon Dec 04, 2017 10:08 pm
Location: Germany
Contact:

Re: I want to implement a standard surface material similar to arnold

Post by B.Y.O.B. » Wed Sep 02, 2020 11:10 am

You could take a look at the disney material, especially https://github.com/LuxCoreRender/LuxCor ... y.cpp#L269

BruceXu
Posts: 17
Joined: Wed Apr 15, 2020 7:16 am

Re: I want to implement a standard surface material similar to arnold

Post by BruceXu » Wed Sep 02, 2020 11:43 am

B.Y.O.B. wrote:
Wed Sep 02, 2020 11:10 am
You could take a look at the disney material, especially https://github.com/LuxCoreRender/LuxCor ... y.cpp#L269
Yes, I'm actually learning the luxcore code, but the disney material in luxcore does not have the transmission effect.
I want to add the transmission effect to the luxcore disney material.
Currently, I add a transmit branch using localLightDir.z * localEyeDir.z in the evaluate function and add a transmit branch using passThroughEvent in the sample function.
I don't know if I'm doing it right.

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

Re: I want to implement a standard surface material similar to arnold

Post by Dade » Wed Sep 02, 2020 11:49 am

BruceXu wrote:
Wed Sep 02, 2020 2:06 am
I want to implement a standard surface material similar to arnold, like https://autodesk.github.io/standard-surface/
However, when luxcore performs evaluation, only one of the reflection and transmission can be calculated at a time. How can I implement multiple lobes like a standard surface?
Just check the glass code: https://github.com/LuxCoreRender/LuxCor ... s.cpp#L190

You decide if to transmit or reflect (https://github.com/LuxCoreRender/LuxCor ... s.cpp#L230) than adjust the PDF according what you are doing (https://github.com/LuxCoreRender/LuxCor ... s.cpp#L236 for reflect and https://github.com/LuxCoreRender/LuxCor ... s.cpp#L247 for transmit).
Support LuxCoreRender project with salts and bounties

BruceXu
Posts: 17
Joined: Wed Apr 15, 2020 7:16 am

Re: I want to implement a standard surface material similar to arnold

Post by BruceXu » Thu Sep 03, 2020 1:04 am

Dade wrote:
Wed Sep 02, 2020 11:49 am
BruceXu wrote:
Wed Sep 02, 2020 2:06 am
I want to implement a standard surface material similar to arnold, like https://autodesk.github.io/standard-surface/
However, when luxcore performs evaluation, only one of the reflection and transmission can be calculated at a time. How can I implement multiple lobes like a standard surface?
Just check the glass code: https://github.com/LuxCoreRender/LuxCor ... s.cpp#L190

You decide if to transmit or reflect (https://github.com/LuxCoreRender/LuxCor ... s.cpp#L230) than adjust the PDF according what you are doing (https://github.com/LuxCoreRender/LuxCor ... s.cpp#L236 for reflect and https://github.com/LuxCoreRender/LuxCor ... s.cpp#L247 for transmit).
OK,I'll try.

BruceXu
Posts: 17
Joined: Wed Apr 15, 2020 7:16 am

Re: I want to implement a standard surface material similar to arnold

Post by BruceXu » Thu Sep 03, 2020 2:14 am

Dade wrote:
Wed Sep 02, 2020 11:49 am
BruceXu wrote:
Wed Sep 02, 2020 2:06 am
I want to implement a standard surface material similar to arnold, like https://autodesk.github.io/standard-surface/
However, when luxcore performs evaluation, only one of the reflection and transmission can be calculated at a time. How can I implement multiple lobes like a standard surface?
Just check the glass code: https://github.com/LuxCoreRender/LuxCor ... s.cpp#L190

You decide if to transmit or reflect (https://github.com/LuxCoreRender/LuxCor ... s.cpp#L230) than adjust the PDF according what you are doing (https://github.com/LuxCoreRender/LuxCor ... s.cpp#L236 for reflect and https://github.com/LuxCoreRender/LuxCor ... s.cpp#L247 for transmit).
Emmm, in addition, is the wo and wi to determine whether to reflect or transmit in evaluate funtion?

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

Re: I want to implement a standard surface material similar to arnold

Post by Dade » Thu Sep 03, 2020 10:50 am

BruceXu wrote:
Thu Sep 03, 2020 2:14 am
Emmm, in addition, is the wo and wi to determine whether to reflect or transmit in evaluate funtion?
Glass is a specular material (i.e. a delta one) so GlassMaterial::Evaluate() always return "Black": https://github.com/LuxCoreRender/LuxCor ... ss.cpp#L41

In GlassMaterial::Sample(), the decision if to sample transmission or reflection is based on the random variable "passThroughEvent": https://github.com/LuxCoreRender/LuxCor ... s.cpp#L230
Support LuxCoreRender project with salts and bounties

Post Reply