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

Sprite3D depth rendering does not work as intended with multiple overlapping Sprite3Ds. #63182

Closed
SilencedPerson opened this issue Jul 19, 2022 · 4 comments

Comments

@SilencedPerson
Copy link

Godot version

3.5 rc6

System information

OpenGL ES 2.0 Renderer: Intel(R) HD Graphics 5500

Issue description

Sprite3Ds do not respect depth properly.

Steps to reproduce

  1. Put 2 Sprite3Ds into the scene.
  2. Set one of the Sprite3D's translation to (-1.5,0,2)
  3. move the Camera around. Reproducible inside the editor's 3D viewport.

image

Minimal reproduction project

minimal reproduction project.zip
Press Right On you Keyboard to see the issue.

@lawnjelly
Copy link
Member

lawnjelly commented Jul 19, 2022

Am guessing it is assuming that the Sprite3D has transparency (alpha). For alpha to work it has to sort the polys, rather than rely on z buffer. And sorting by poly / object for transparency often suffers from this sort of problem.

Maybe in this case it should be detecting there is no blending in the material and using z buffer instead of sorting, no idea whether this is supported in Sprite3D.

EDIT:
Ah yes, in the Sprite3D flags, disable the Transparent flag, and it should work.

Of course the problem does occur with transparency, but this is common in 3D, I'm not sure there are any plans to address this. So maybe this can be closed, not sure. Also see the alpha cut parameter, that may be useful with this kind of thing, I defer to the others on details of alpha cut.

@Zireael07
Copy link
Contributor

@lawnjelly: IIRC we already have an issue open for the transparency sorting problem and iirc it's unfixable

@SilencedPerson
Copy link
Author

That is bad...
I was planning to use it for user generated panoramas.
If i may, what are my alternatives? Would rendering it onto a plane help with this?

@Calinou
Copy link
Member

Calinou commented Jul 19, 2022

Duplicate of godotengine/godot-proposals#4099 (will be fixed by #63040 in 3.6). See also 3D rendering limitations.

If i may, what are my alternatives? Would rendering it onto a plane help with this?

Yes, you can use a custom shader. You don't necessarily need to use a Viewport projected onto a mesh depending on what you're doing.

In the meantime, enable alpha scissor on the materials if you want to avoid transparency sorting issues, or adjust render priority on the materials.

@Calinou Calinou closed this as not planned Won't fix, can't repro, duplicate, stale Jul 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants