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

Issue displaying a 3D Tiles, tileset with a gltf that have two sided material #1532

Open
HouleAdrien opened this issue Oct 25, 2024 · 2 comments

Comments

@HouleAdrien
Copy link

HouleAdrien commented Oct 25, 2024

Hi! I’m working on a project with Cesium for Unreal (tag 2.7.0), where I’m trying to load a tileset containing a glTF model with double-sided materials.

Since double-sided materials aren’t enabled by default in the glTF layer material (ML_CesiumGltf) within the plugin, I created a custom material. This material takes all output from the "CesiumGlTFFunction" material function, and just have two-sided rendering enabled. I then applied this custom material to my tileset.

However, now I’m seeing an issue where one side appears very dark, and I’m not sure what’s causing it.

If anyone has suggestions on how to resolve this, I’d greatly appreciate the help!

Here’s a screenshot of what it looks like in CesiumJS:
frontjs
backjs

And here’s how it looks in Unreal:

front
back

I’ve also attached one of the tilesets exhibiting this issue:

testtileset.zip

Thanks in advance!

@HouleAdrien
Copy link
Author

Okay I figured a fix, if I make my material unlit, and use color as emissive it works, but I think there might be an issues on how the shadow of the gltf is computed, cause this is really weird and haven't got this issues with other models.

@kring
Copy link
Member

kring commented Nov 1, 2024

@HouleAdrien see this bit in the glTF spec:

When this value is true, back-face culling is disabled and double sided lighting is enabled. The back-face MUST have its normals reversed before the lighting equation is evaluated.

I think this is most likely what your custom material is missing.

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

No branches or pull requests

2 participants