Jump to content

alpha blending for 3 cylinders


Hanesu
 Share

Recommended Posts

I need 3 cylinders in a geometry like the one here

https://www.babylonjs-playground.com/#FFZ9HL#1

with transparency. But once the alpha value is below 1 (change line 14 in PG) the alpha blending doesn't work properly, the cylinder on the right goes in front of the cylinder in front. I know that there are some artifacts for alpha blending, but from the initial view direction the center of the bounding sphere of the cylinder in front (which should coincide with the center of this cylinder) should be closer to the observer than the centers of the two other cylinders. Am I missing something?

In general, I figured out that for this specific problem the depth test and alpha blending should work perfect if I divide each cylinder in half and place the center of the bounding sphere at the middle of the end cap for each of the 6 half cylinders. But how can I do this?

Link to comment
Share on other sites

Oh, thank you, it's good to know that instances are not depth tested.

To remove the remaining artifacts which are caused by the nontrivial geometry of the three cylinders, I split up each cylinder into two, like here

https://www.babylonjs-playground.com/#FFZ9HL#3

Is it possible to move the center of the bounding sphere of each half cylinder to the outer cap? Then all the overlap problems at the three touch points should be gone.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...