Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Shaders: decouple light probe irradiance from other indirect light sources #17359

Merged
merged 1 commit into from
Aug 27, 2019

Conversation

WestLangley
Copy link
Collaborator

Fixes #17253.

As suggested in #17102 (comment) and #17253 (comment).

This also fixes an unreported bug. The multi-scattering, energy-preservation model introduced in #15644 should only have been applied to irradiance from IBLs, but it was applied to all indirect diffuse light sources.

/ping @jsantell
/ping @elalish
/ping @sunag
/ping @bhouston

@WestLangley WestLangley added this to the r108 milestone Aug 27, 2019
@@ -15,9 +15,11 @@ export default /* glsl */`

#endif

vec3 iblIrradiance = vec3( 0.0 );
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can move this to lights_fragment_begin.glsl.js maybe here?

vec3 irradiance = getAmbientLightIrradiance( ambientLightColor );

Probably this breaks compatibility with NodeMaterial.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you will have to decide where it is best to declare it. I do not understand the Node restrictions very well...

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that bellow of irradiance is better

vec3 irradiance
vec3 iblIrradiance

No ..._maps chunk is added in node-material

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunag I'll merge and do that change 👌

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mrdoob mrdoob merged commit cc942a7 into mrdoob:dev Aug 27, 2019
@mrdoob
Copy link
Owner

mrdoob commented Aug 27, 2019

Thanks!

@sunag
Copy link
Collaborator

sunag commented Aug 27, 2019

@WestLangley Thanks!

sunag added a commit to sunag/three.js that referenced this pull request Aug 27, 2019
@WestLangley WestLangley deleted the dev_ibl_irradiance branch August 28, 2019 15:36
@sunag
Copy link
Collaborator

sunag commented Aug 30, 2019

@WestLangley Is not necessary create an iblRadiance property too?

@WestLangley
Copy link
Collaborator Author

You could, but this was the minimal change. radiance is only used in one place.

The entire shader probably needs to be rewritten at some point.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ambient light brightes metal materials with high roughness
3 participants