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

Use correct default for glTF occlusion texture. #1102

Merged
merged 6 commits into from May 24, 2023

Conversation

kring
Copy link
Member

@kring kring commented May 22, 2023

The CesiumGlTFFunction material function has an incorrect default for the occlusionTexture. As a result, a glTF model without an explicit occlusion texture (which is most of them) will have an Ambient Occlusion value of 0.0, rather than 1.0 as expected. Under certain lighting setups, this can make shadows cast onto the model extremely dark (basically pure black).

This PR fixes it by changing the default texture to one that has the value 1.0 in the red channel. Specifically, from this (NoMetallicRoughnessTexture):
image

To this (NoColorTexture):
image

(Thanks @AlbanBERGERET-Epic for reporting this!)

The red channel must have a value of 1.0, not 0.0.
@cesium-concierge
Copy link

Thanks for the pull request @kring!

  • ✔️ Signed CLA found.

Reviewers, don't forget to make sure that:

@j9liu
Copy link
Contributor

j9liu commented May 23, 2023

@kring did you save the material with Unreal Engine 5.1? I'm viewing this in UE 5.0 and I'm getting this message:

 Error: Package C:/Dev/cesium-unreal-samples/Plugins/cesium-unreal/Content/Materials/MaterialFunctions/CesiumGlTFFunction.uasset is too new. Engine Version: 1004  Package Version: 1008

It's preventing anything in the scene from rendering with the material. Let me see if I can recreate the change in Unreal 5...

@kring
Copy link
Member Author

kring commented May 23, 2023

Oh yeah I probably did @j9liu. Sorry about that, and thanks for fixing it!

@j9liu
Copy link
Contributor

j9liu commented May 24, 2023

Thanks @kring !

@j9liu j9liu merged commit 2e54291 into ue5-main May 24, 2023
12 checks passed
@j9liu j9liu deleted the fix-default-occlusion-texture branch May 24, 2023 13:56
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.

None yet

3 participants