kotegaeshi Posted July 17, 2018 Share Posted July 17, 2018 Hello. Is there any possibility to have nice shadow of a transparent object? With .setTransparencyShadow(true) the shadow of a transparent mesh is just as "dark" as for a non transparent mesh. We tried to make 2 lights and 2 shadowgenerators, one for transparent meshes and an other for the non transparent meshes, setting the transparent generator to show lighter shadow (by setDarkness(0.5), or with light.intensity = 0.5), but the result is not good, because the 2 shadows are added together at the intersection. Is there any possibility to show not added shadows at the intersections? The non transparent darkness (full dark) should not be even more darker with a lighter shadow on it. https://www.babylonjs-playground.com/#WTHS5J#1 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 17, 2018 Share Posted July 17, 2018 Well this is because shadows are computed as light removal. They remove light intensity where they are applied. So where the 2 shadows combine you receive no light at all hence the dark Your best option would be to use the ShadowOnlyMaterial: https://github.com/BabylonJS/Babylon.js/blob/master/materialsLibrary/src/shadowOnly/babylon.shadowOnlyMaterial.ts and probably update the shader to add color instead of blocking light Amarth2Estel 1 Quote Link to comment Share on other sites More sharing options...
kotegaeshi Posted July 18, 2018 Author Share Posted July 18, 2018 Shader modification is well above our capabilities yet, but thank you for showing the direction. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2018 Share Posted July 18, 2018 Well I guess I can help you then:) Stay tuned! Quote Link to comment Share on other sites More sharing options...
Guest Posted July 18, 2018 Share Posted July 18, 2018 Here we are: https://www.babylonjs-playground.com/#1KF7V1#19 Amarth2Estel 1 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.