MaterialX icon indicating copy to clipboard operation
MaterialX copied to clipboard

Coat is partially unaffected by Emission in MaterialXView

Open DADA246c opened this issue 3 years ago • 2 comments

SurfaceNodeGlsl::emitFunctionCall adds Emission after direct lighting calculation, so Coat is not taking partial effect of Emission.

At Standard Surface, Emission is affected by Coat. image

I think the current implementation is shown below. image

MaterialXView Indirect Lighting OFF Render Environment OFF Specular 0

Coat 0 , Base 0.5 , Emission 0 image

Coat 1 , Base 0.5 , Emission 0 Coat darkens the mesh outlines. image

Coat 0 , Emission 0.5 , Base 0 image

Coat 1 , Emission 0.5 , Base 0 The mesh outlines are not darkened. image

DADA246c avatar Aug 22 '22 07:08 DADA246c

Thanks for the report @DADA246c. You are right that the current standard surface implementation in MaterialX does not support the directionally varying attenuation of emission under coat.

In a previous version of the implementation we did have support for this. It was done by using a fresnel node in the attenuation calculations of emission, which takes the angle of the incident ray and normal into account.

However we decided to remove the fresnel node from the MaterialX PBR library in 2021, because it was not possible to support this in MDL. Directional dependencies in the light integration is very restricted there in order to support bidirectional rendering methods. So in early 2021 the fresnel node was removed and the standard surface implementation was stripped from this effect. (in this PR: https://github.com/AcademySoftwareFoundation/MaterialX/pull/590)

However, in MDL 1.7 there has been an introduction of a new directional_factor modifier for EDF's. And with this we should probably be able to fix this missing support again. We need to decide on how to best introduce this back into the MaterialX PBR library, to make it supported by all targets.

Let's keep this issue open for now to track this progress.

niklasharrysson avatar Sep 01 '22 14:09 niklasharrysson

Thanks for the reply. I understood the reasons.

DADA246c avatar Sep 13 '22 10:09 DADA246c

Thanks for this original report, @DADA246c, and this has been addressed by @niklasharrysson in #1262.

jstone-lucasfilm avatar Mar 10 '23 00:03 jstone-lucasfilm