Jump to content

[Bug?] mesh.hasVertexAlpha causes "x-ray" effect in concave meshes


Stephen Andrews
 Share

Recommended Posts

I'm not sure whether or not this is intended, but when viewing a concave mesh with hasVertexAlpha enabled, faces with normals that face the camera become visible through the rest of the mesh, resulting in a sort of 'x-ray' effect. (The depth buffer is being handled incorrectly?)

Backface culling has no real effect on this, as far as I can tell.

 

No alpha (control) [http://s17.postimg.org/sdsv8fqn1/Screenshot_from_2014_12_01_14_07_46.png]
Screenshot_from_2014_12_01_14_07_46.png


X-Ray effect with partially-transparent voxels [http://s17.postimg.org/5mf78ag7x/Screenshot_from_2014_12_01_14_07_20.png]
Screenshot_from_2014_12_01_14_07_20.png


X-Ray effect with empty voxels [http://s17.postimg.org/p2zwutbbx/Screenshot_from_2014_12_01_14_06_13.png]
Screenshot_from_2014_12_01_14_06_13.png


Close up of X-ray effect with empty voxels [http://s17.postimg.org/pehd7krrx/Screenshot_from_2014_12_01_14_06_02.png]

Screenshot_from_2014_12_01_14_06_02.png

Link to comment
Share on other sites

Unfortunately this is "expected".

Because we are dealing with transparent objects, we have to disable depth write. And for performance reasons we do not sort faces ending with this weird rendering :(

Drat, that's what I was afraid of. I'll try to think of another way around it. (Perhaps creating another mesh for transparent objects?)

 

Thanks!

Link to comment
Share on other sites

Drat, that's what I was afraid of. I'll try to think of another way around it. (Perhaps creating another mesh for transparent objects?)

 

Thanks!

Using another mesh seems to remove the depth issues, thankfully, but now comes the issue of making sure all properties are synced between two meshes, which is a pain.

 

Also I forgot what my algorithm was for separating the transparent voxels from the non-transparent ones, so now my stuff is all screwed up. x[

 

EDIT: In @Deltakosh we trust. (Still has syncing issues, but transparency works fine  :D)

Screenshot_from_2014_12_02_16_12_54.png

 

EDIT2: Mostly resolved, CEWBS updated to version 0.2.42. Demo #1 uses transparency for some voxels. :D 

Link to comment
Share on other sites

Hey that's great, excellent idea btw!

 

and I really love your lightsaber ;D

Unfortunately, it kind of hurts performance a bit, since the mesher has to run twice, but it should be okay for smaller meshes.

 

I suck at art. It's supposed to be a *shiny* sword, indicating that it can be picked up. xD

 

I suppose this thread should be marked as answered. :3

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...