BlackMojito Posted March 20, 2018 Share Posted March 20, 2018 How can I achieve the shadow effect like in the attached screenshot? I tried to use a directional light with the direction (0, -1, 0) and then played around with different kinds of blur parameters, but haven't successfully produced such effect. I supposed that it is possible by blurring the shadow texture right? Can someone point me out how to adjust the parameters? Quote Link to comment Share on other sites More sharing options...
V!nc3r Posted March 20, 2018 Share Posted March 20, 2018 This effect looks like Ambient Occlusion. You have (only?) two choices to handle this effect: bake your AO and use it as ambientTexture/lightmaptexture (this is the one I prefer) use SSAO Quote Link to comment Share on other sites More sharing options...
Guest Posted March 20, 2018 Share Posted March 20, 2018 You may also want to consider blurred shadows: http://doc.babylonjs.com/babylon101/shadows#soft-shadows Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted March 21, 2018 Author Share Posted March 21, 2018 8 hours ago, Deltakosh said: You may also want to consider blurred shadows: http://doc.babylonjs.com/babylon101/shadows#soft-shadows Thanks @Deltakosh, the soft shadow was what I tried first. Please look at the code snippet below. Basically I got two issues. The first one was that the blurred shadow was not "large" enough so we see very little shadow. The second one is I got some banding issues like the second screenshot shows. PS: I do not really want the shadow that big like the one in the initial post. I just want something a little bit larger so that we can see it. Any suggestion, big boss ? this._shadowGenerator = new BABYLON.ShadowGenerator(512, <BABYLON.IShadowLight>(this._lights.getValue(RenderScene._shadowLightName))); this._shadowGenerator.useBlurExponentialShadowMap = true; this._shadowGenerator.useKernelBlur = true; this._shadowGenerator.blurKernel = 32; this._shadowGenerator.bias = 0.01; this._shadowGenerator.setDarkness(0.25); Quote Link to comment Share on other sites More sharing options...
Guest Posted March 21, 2018 Share Posted March 21, 2018 Just move your light farther or closer to your building and you can control the size and the precision of the shadow If you can provide a playground we could update it together Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted March 22, 2018 Author Share Posted March 22, 2018 9 hours ago, Deltakosh said: Just move your light farther or closer to your building and you can control the size and the precision of the shadow If you can provide a playground we could update it together OK. So I might need to replace my directional light by a spot light? Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted March 22, 2018 Author Share Posted March 22, 2018 9 hours ago, Deltakosh said: Just move your light farther or closer to your building and you can control the size and the precision of the shadow If you can provide a playground we could update it together thanks boss, by using a spot light. I can get what I want now. Directional light use orthographic projection so that the distance does not affect anything, right? Quote Link to comment Share on other sites More sharing options...
Guest Posted March 22, 2018 Share Posted March 22, 2018 YOu still need a position to scope the size of the viewport Quote Link to comment Share on other sites More sharing options...
BlackMojito Posted March 23, 2018 Author Share Posted March 23, 2018 8 hours ago, Deltakosh said: YOu still need a position to scope the size of the viewport Yeah cool! Thanks! 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.