Transparent objects change render order depending on the camera angle
Hi,
Both objects use Transparent Material. It looks like it's in front of you depending on the angle. But why does the rendering result of the object behind come out differently depending on the angle?
Thanks!
This is because objects are sorted for rendering order:
by their volume (
AABB
to be exact i.e. "Axis Aligned Bounding Box")by pixel depth
Transparent shaders do not write to (pixel) depth buffer, hence #2 wont help in proper sorting. So, what the renderer is left with here is AABB
s to guesstimate the sorting order with. This results in sorting, more or less, by mesh distance to camera.
this applies to every 3d engine out there
To fix this, change box's shader to opaque one.
Thank you for your answer.
I want to use the box in the back as a Transparent Material, but is there no way?
Opaque shaders allow for "cutout" / "alpha clipping" (binary pixel visibility), it's solves sorting issue, but not sure this is the kind of transparency you are after for this box here.
In emergency situations you can change shader sorting priority with a script
Your answer

Follow this Question
Related Questions
Is it possible to create a texture that hides a specific texture? 0 Answers
How can I add alpha channel to this shader and how can I make the object to be transparent ? 1 Answer
Why doesn't this specific shader work on Mobile? 0 Answers
Do you know how to create this wall 2 Answers
A problem with a shader to make a window transparent 0 Answers