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

GLTFLoader: Modified Spec Gloss shader to match the glTF spec #20226

Merged
merged 1 commit into from
Aug 31, 2020

Conversation

WestLangley
Copy link
Collaborator

@WestLangley WestLangley commented Aug 30, 2020

This PR modifies the shader to match the glTFSpec.

The shader previously matched the spec, but it was changed in 8360b53. /ping @takahirox

The model in the spec is an approximation, but it is far superior to what is currently implemented here. For example, if specular is [1, 1, 1], there can be no light reflected diffusely.

/ping @donmccurdy

@WestLangley WestLangley added this to the r121 milestone Aug 30, 2020
@WestLangley WestLangley changed the title GLTF Loader: Modified Spec Gloss shader to match the glTF spec GLTFLoader: Modified Spec Gloss shader to match the glTF spec Aug 30, 2020
@mrdoob
Copy link
Owner

mrdoob commented Aug 30, 2020

/cc @elalish

@takahirox
Copy link
Collaborator

Hi @WestLangley, Thanks for the fix! I don't remember why I changed so... I guess I have misread your comment? #10985 (comment)

@WestLangley
Copy link
Collaborator Author

@takahirox I think I see the confusion... The diffuse reflectance of the material does not change, but the amount of light available to be diffusely reflected is reduced. Rather than scaling the irradiance, the reflectance is scaled instead. That is a bit confusing, but it seems to be done that way a lot.

@elalish
Copy link
Contributor

elalish commented Aug 31, 2020

Thanks @WestLangley!

@mrdoob mrdoob merged commit 98149b2 into mrdoob:dev Aug 31, 2020
@mrdoob
Copy link
Owner

mrdoob commented Aug 31, 2020

Thanks!

@WestLangley WestLangley deleted the dev_gltf_loader_sg branch August 31, 2020 21:02
@WestLangley
Copy link
Collaborator Author

@donmccurdy Just a heads-up that this has been merged...

I am aware there has been a lot of discussion about this approximation. This PR is just adhering to the current spec.

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.

4 participants