Sign in to follow this  
tbgeorge

Transparent Loaded Mesh shadows

Recommended Posts

Hi, I'm trying to load a scene that has meshes with transparent textures on them (leaves). Though when I have those meshes cast shadows, it ignores the transparency and the shadow is incorrect. But when I do it with code, it seems to work as intended. Here is a link to my babylon playground: http://www.babylonjs-playground.com/#1JA4FW#5

Also, I was having a weird issue with the texture even causing shadows to cast at all, my solution was to put a single black pixel in the upper left and lower left corners of the texture and this caused shadows to show up.

Any help is appreciated.

Thanks

Share this post


Link to post
Share on other sites

Hello,

 

your code is correct because you are setting your texture to the diffuse channel and thus the engine will use it to do alpha testing. If the texture was set to opacity channel it would have triggered the alpha blending mode which is not compatible with shadows.

You should check with your DCC tool (blender? max?) and be sure to set your texture in the diffuse channel

Share this post


Link to post
Share on other sites

Well, that shouldn't be the issue here, unless I'm understanding you incorrectly, because if you look at line 59-65, I'm assigning the loaded meshes the same material I assigned to the Babylon created planes ( which is casting shadows correctly ). What I'm confused about is how they are using the exact same material, though their shadows are still different.

Share this post


Link to post
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...
Sign in to follow this  

  • Recently Browsing   0 members

    No registered users viewing this page.