Transparent shape behind transparent sprite issue

Recommended Posts

Hello guys,

I have troubles with showing shapes that have an opacity < 1 and which are behind a sprite that also has an opacity < 1.

I attach a screenshot and here the playground

As you can see the shapes behind the sprite disappear

I tried differents options with material's shape such as :

  • forceDepthWrite
  • needDepthPrePass
  • separateCullingPass
  • zOffset

But nothing works, and on the Sprite side we don't have a lot of parameters to play with. I wonder if it's not due to a kind of optimization of babylon to not drop down the render.



Share this post

Link to post
Share on other sites

Ok I found how to fix it by using renderingGroupId parameter from the meshes and the sprite manager.

set 0 to meshes and 1 to sprite manager.

But it's not perfect, if we set the camera position under the plane (grass) we have the sprite drawn before the plane.

Share this post

Link to post
Share on other sites

Hi Deltakosh,

Thanks for your reply.

Do you mean something like using a mesh instead of a sprite like a plane, then set my texture to this plane and set plane.billboardMode to  BILLBOARDMODE_ALL?

I have a lot of sprites. My project is a Map in 3D of a building let's say a shopping center and each shop is represented by a mesh in 3D and floating above a sprite which is the shop's logo.

I'm affraid that using meshes instead of sprites will drop down the rendering.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.