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

account for IOR when computing f0 #250

Merged
1 commit merged into from
Apr 27, 2020
Merged

account for IOR when computing f0 #250

1 commit merged into from
Apr 27, 2020

Conversation

ghost
Copy link

@ghost ghost commented Apr 3, 2020

No description provided.

// For an index of refraction of 1.5, this results the known default value of 0.04 reflectivity for dielectrics.
float f0_ior(float ior)
{
float f0 = sq((ior - 1.0) / (ior + 1.0));
Copy link
Member

Choose a reason for hiding this comment

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

Since IOR is uniform, this per-fragment computation seems expensive. Could the app compute this value and pass it in as uniform?

Copy link
Contributor

Choose a reason for hiding this comment

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

Yes ... and this is the reason why I do not want this extension for reflection, as this information is already available in the Metallic-Roughness material - or for more control - in the specular one. This would be the third(!) possibility to define F0.

Copy link
Contributor

Choose a reason for hiding this comment

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

But please compare to KhronosGroup/glTF#1718 and KhronosGroup/glTF#1719 as well.

@ghost ghost merged commit a594f9b into pbr-next Apr 27, 2020
@ghost ghost deleted the fix/ior_fresnel branch April 27, 2020 13:25
This pull request was closed.
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.

3 participants