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

Fix material thickness and texture transforms #4578

Merged
merged 2 commits into from Aug 23, 2022

Conversation

GSterbrant
Copy link
Contributor

Description

Our extensions implementation were not extracting texture transforms for the textures. This would cause issues importing assets with for example gltf pack where texture transforms would be applied automatically.

Thickness was wrongfully not tinted if it was below 1, but in fact thickness is a scale factor meant to scale the texture input. As a result, the DragonAttenuation glTF looks much better.

image

Also, IOR would default to 0.667 in the shader if 1.5 was used, which is incorrect as it should be 1.0 / 1.5. This should be indeed VERY hard to reproduce for a user, so very unlikely anyone encountered this as an issue.

Refraction index is default 1.0 / 1.5, so should only be skipped if that's the case.
Thickness is only relevant if bigger than 1, since the texture can only encode 0-1.
@GSterbrant GSterbrant added bug area: graphics Graphics related issue labels Aug 23, 2022
@GSterbrant GSterbrant self-assigned this Aug 23, 2022
@GSterbrant GSterbrant merged commit ffbd722 into main Aug 23, 2022
@GSterbrant GSterbrant deleted the gsterbrant_extension_transforms_thickness_fix branch August 23, 2022 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants