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

Add support for glTF normalTextureInfo.scale #12018

Merged
merged 3 commits into from
Jun 6, 2024
Merged

Add support for glTF normalTextureInfo.scale #12018

merged 3 commits into from
Jun 6, 2024

Conversation

jjhembd
Copy link
Contributor

@jjhembd jjhembd commented Jun 4, 2024

Description

The glTF specification describes a scale that can be applied to the values read from a normal texture. This scalar applies to the .x and .y components only.

This PR adds a .scale property to ModelComponents.TextureReader, and adds code to process the scale in GltfLoaderUtil and MaterialPipelineStage. In the shader, the scalar is applied (if present) in MaterialStageFS.

Here is the Clearcoat Car Paint test model in CesiumJS 1.118:
image

With this PR:
image

Comparing to the glTF Sample Viewer
image

Issue number and link

Resolves #6948.

Testing plan

Load the glTF PBR Extensions Sandcastle and compare the Clearcoat Car Paint model to the rendering in the glTF Sample Viewer

Author checklist

  • I have submitted a Contributor License Agreement
  • I have added my name to CONTRIBUTORS.md
  • I have updated CHANGES.md with a short summary of my change
  • I have added or updated unit tests to ensure consistent code coverage
  • I have update the inline documentation, and included code examples where relevant
  • I have performed a self-review of my code

Copy link

github-actions bot commented Jun 4, 2024

Thank you for the pull request, @jjhembd!

✅ We can confirm we have a CLA on file for you.

Copy link
Contributor

@ggetz ggetz left a comment

Choose a reason for hiding this comment

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

Looks good to me @jjhembd! Should we add or update any unit tests?

@jjhembd
Copy link
Contributor Author

jjhembd commented Jun 6, 2024

Thanks @ggetz, I added/updated some specs. This is ready for another look.

@ggetz
Copy link
Contributor

ggetz commented Jun 6, 2024

Awesome, thanks @jjhembd!

@ggetz ggetz merged commit 0eff942 into main Jun 6, 2024
9 checks passed
@ggetz ggetz deleted the texture-scale branch June 6, 2024 19:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for glTF's normalTextureInfo.scale
2 participants