#material alpha sorting showing incorrect

7 messages · Page 1 of 1 (latest)

humble crown
#

Rendering a mesh with a custom material, right now the fragment shader always returns an alpha of 1., i would expect the mesh to render the same as if it had bevy::pbr::AlphaMode::Opaque;

#

The material has bevy::pbr::AlphaMode::Blend;

humble crown
#

bevy::pbr::AlphaMode::Mask(0.5) appears to have no effect on the mesh, it renders as opaque only, even if i have some fragments set to alpha zero

humble crown
humble crown
#

I really don't need ::Blend mode, i am trying to clip out all triangles at a given y-level. I tried a couple other solutions:

  1. moving the vertex clip_position to behind the camera in the vertex shader. This almost works, but it still occludes the underlying blocks
  2. I tried discarding any fragments above the given y, it had the same effect as modifying the vertex shader
  3. Recalculating mesh - this mostly works, except it is much slower than the gpu part.

vid shows what i'm trying to accomplish, but it does it the slow re-compute mesh way

humble crown
#

Okay, I was able to get this to work - am discarding the fragment in the shader, and also enabling AlphaMode::Mask