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

Rendering glitches with directional light and more complex geometry #374

Open
AlbinSjoegren opened this issue Feb 28, 2022 · 6 comments
Open

Comments

@AlbinSjoegren
Copy link
Contributor

Been posting about this issue in the matrix room for a while but it seems to be a problem for most of the meshes I try so I will make it an issue here so that we hopefully can resolve it.
To be clear this issue only affects meshes lit by directional light or with an opacity value of above ca 30%.
It not only shows something that looks a lot like clipping issues but the depth and occlusion are both totally wack.
Here are some examples:
1
Same mesh but with a solidify modifier at 0.01 going inward:
2
Mesh 2 with directional light:
Screenshot from 2022-02-16 13-57-32
Mesh 2 with only ambient light:
Screenshot from 2022-02-16 14-03-13

@cwfitzgerald
Copy link
Member

Could you provide a gltf or something that I would be able to test this with?

@AlbinSjoegren
Copy link
Contributor Author

Could you provide a gltf or something that I would be able to test this with?

https://github.com/Jovian-Entertainment-Studios/Project-Heaven-Code/tree/main/Project%20Heaven%2Fsrc%2Fdata%2F3d
The model called Heaven 1 here is the model used in the first two examples. This codebase is also where these issues occur so feel free to look around if you need to.
Haven't tried to replicate these issues outside of my code yet because some models work and some don't.

@AlbinSjoegren
Copy link
Contributor Author

@cwfitzgerald

@John-Nagle
Copy link
Contributor

I've seen this too. I reported it back at Issue #208, but double-sided rendering confused the issue.
I understand it better now. Curved surfaces in blend mode, where parts of both the front and back of the same object face the camera, have a sorting order problem. I've seen this in several places with curved translucent surfaces.

In some cases, there is no one Z-order that will work. Sometimes it's wrong for cases which ought to be sortable. It's as if sorting chose some triangle pointing away from the camera to guide sort order. But that's just a guess.

Order-independent transparency would probably fix this.

This ought to be reproduceable in GLTF.

@AlbinSjoegren
Copy link
Contributor Author

Just weird that I now have had this problem on every single model I have ever imported...

@John-Nagle
Copy link
Contributor

I get it in my program, but haven't tried to reproduce it in scene-viewer. Try making a simple U-shaped transparent object in GLTF, and I think it will happen. The stuff I'm having trouble with is more complex than that.

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

3 participants