tbgeorge Posted June 30, 2016 Share Posted June 30, 2016 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 Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 1, 2016 Share Posted July 1, 2016 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 Quote Link to comment Share on other sites More sharing options...
tbgeorge Posted July 5, 2016 Author Share Posted July 5, 2016 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. Quote Link to comment Share on other sites More sharing options...
GameMonetize Posted July 5, 2016 Share Posted July 5, 2016 Actually It was me the one who misunderstood It was a bug, now fixed: http://www.babylonjs-playground.com/debug.html#1JA4FW#6 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.