matdav Posted May 12, 2018 Share Posted May 12, 2018 Hi everybody, I'm looking for a way to get a ground in my scene with the same exact color of the background (scene.clearColor), that reflects the meshes above it and that displays shadows casted by a light on receiving objects. I tried to use EnvironmentHelper to get this result but I always have a halo on the ground, see the following playground: https://www.babylonjs-playground.com/#10D6YT#122 Is there a way to avoid that halo so that the color of the ground is the same as the background? I don't want the user see the ground at all, I only want shadows and mirroring. I tried also to use the BackgroundMaterial directly but without success (see playground) https://www.babylonjs-playground.com/#G3HSAW#15 I tried then to create the ground and the materials by hand but as in the following playground, but I have a problem to show shadows and reflections at the same time. Also, to get the same color of the background I set gammaSpace to true on the MirrorTexture but I get a reflection too dark (and no shadows). https://playground.babylonjs.com/#QUXPMR I saw that exists ShadowOnly material that shows only shadows. Is there a similar material with mirroring too? Any suggestions are welcome, thanks, Matteo Quote Link to comment Share on other sites More sharing options...
Amarth2Estel Posted May 14, 2018 Share Posted May 14, 2018 Hi Matdav ! One solution could be to use 2 different meshes as ground : -> 1 to display shadow only, using the shadowOnlyMaterial. -> 1 to display reflection only, using a material with mirrorTexture and without diffuse or specular attributes You can see a PB of this solution here : https://www.babylonjs-playground.com/#QHN8ZT Of course, there may be a more efficient way, perhaps by using a single one couple mesh and material... Have fun ! Quote Link to comment Share on other sites More sharing options...
matdav Posted May 14, 2018 Author Share Posted May 14, 2018 Hi @Amarth2Estel, I'll try to follow your solution. Thanks a lot, Matteo 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.