Jump to content

Shadow on PNG image


pichou
 Share

Recommended Posts

Hi everybody,

I have a plane with material and diffuseTexture. The image used for the texture is a png with transparent background. In order to keep the transparent background in babylon, I set useAlphaFromDiffuseTexture  = true; on the material. 

But now I want to see the shadow of the image. But I cant because of the useAlphaFromDiffuseTexture parameter. 
So my question is : Is there a way to have the shadow of my png image following the transparent and not transparent part?

Thanks for your help! Pichou

Link to comment
Share on other sites

Ha, I know why I haven't used the hasAlpha property before.


It is because I also play with the visibility of the mesh. And with hasAlpha, when you change the visibility different to 1, the transparent background becomes black. 
But with the useAlphaFromDiffuseTexture property, the visibility is change correctly and the background stays transparent.

So I am stuck with using the useAlphaFromDiffuseTexture to have the correct visibility and transparent background or with using hasAlpha to have the correct shadow.

Is there a way to have both? Thanks

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