Istran Posted July 19, 2018 Share Posted July 19, 2018 The object is added to the list to create a shadow (.renderList.push (obj)). To display the shadow on the object itself from other elements - (.receiveShadows = true). As a result, the object creates a shadow on itself. How to fix it? example : https://playground.babylonjs.com/#D516RY Also, if there is a surface between the light source and the object, then there is a shadow on it. How to solve this problem? example: https://playground.babylonjs.com/#1RVN7H PS: I'm sorry, if you already have a theme. I find it difficult to focus on foreign language resource. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 19, 2018 Share Posted July 19, 2018 Hello! Self shadowing is a pain in the heck Here is a complete doc on all techniques we have in babylon.js so far: http://doc.babylonjs.com/babylon101/shadows#troubleshooting The best idea is to avoid selfshadowing by having multiple light and multiple shadow generators (if it works for you). Lights have a list of included/excluded meshes so you can easily control which light affects which mesh Quote Link to comment Share on other sites More sharing options...
Istran Posted July 19, 2018 Author Share Posted July 19, 2018 21 hours ago, Deltakosh said: Hello! Self shadowing is a pain in the heck Here is a complete doc on all techniques we have in babylon.js so far: http://doc.babylonjs.com/babylon101/shadows#troubleshooting The best idea is to avoid selfshadowing by having multiple light and multiple shadow generators (if it works for you). Lights have a list of included/excluded meshes so you can easily control which light affects which mesh Hello! Thanks for the answer! In my project, the earth is generated as blocks. It turns out that I should create a personal "ShadowGenerator" for each block and exclude this block in it? On the screenshot 10x10 blocks. I want to make up to 100x100. Is there a function to merge meshes into one? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 19, 2018 Share Posted July 19, 2018 Yes definitely: Mesh.MergeMeshes() http://doc.babylonjs.com/how_to/how_to_merge_meshes Istran 1 Quote Link to comment Share on other sites More sharing options...
Istran Posted July 19, 2018 Author Share Posted July 19, 2018 2 hours ago, Deltakosh said: Yes definitely: Mesh.MergeMeshes() http://doc.babylonjs.com/how_to/how_to_merge_meshes Thanks, I solved the main problem. In the process, I discovered one more unpleasant effect. From the point light there are such shadows (screenshot after). To eliminate the effect, I tried to increase light.shadowMaxZ and shadowGenerator.bias, but then the shadow gets worse and lumens appear through the mesh. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 20, 2018 Share Posted July 20, 2018 Can you use spot instead of point light? (point light is expensive as it generate a cubemap) Quote Link to comment Share on other sites More sharing options...
Istran Posted July 20, 2018 Author Share Posted July 20, 2018 17 minutes ago, Deltakosh said: Can you use spot instead of point light? (point light is expensive as it generate a cubemap) As far as I understand, SpotLight has the shape of a cone and simulates a searchlight (flashlight, car headlight). I need lighting in all directions at low altitude (torch, fire). Quote Link to comment Share on other sites More sharing options...
Guest Posted July 20, 2018 Share Posted July 20, 2018 You are correct. If you need a PointLight, you can't use Blurred shadows unfortunately. Can you repro the issue you have on the PG? Quote Link to comment Share on other sites More sharing options...
Istran Posted July 21, 2018 Author Share Posted July 21, 2018 8 hours ago, Deltakosh said: You are correct. If you need a PointLight, you can't use Blurred shadows unfortunately. Can you repro the issue you have on the PG? Yes. https://playground.babylonjs.com/#XIAGN4 I tried different kinds of shadows. Without blurring, the black bars on the four sides become even more prominent. Shadow settings at the very bottom. Balls in the scene are dragged. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 23, 2018 Share Posted July 23, 2018 Well for some reasons I cannot load your PG, there must be something wrong in the code. Can you load it? Quote Link to comment Share on other sites More sharing options...
Istran Posted July 24, 2018 Author Share Posted July 24, 2018 15 hours ago, Deltakosh said: Well for some reasons I cannot load your PG, there must be something wrong in the code. Can you load it? reload, https://playground.babylonjs.com/#FB6P4I#5 Quote Link to comment Share on other sites More sharing options...
Guest Posted July 24, 2018 Share Posted July 24, 2018 Well as I mentioned earlier, the point light cannot be blurred. And as you are dealing with self shadow issue, I would recommend to try to use a directional light (even for the torch) Quote Link to comment Share on other sites More sharing options...
Istran Posted July 24, 2018 Author Share Posted July 24, 2018 5 hours ago, Deltakosh said: Well as I mentioned earlier, the point light cannot be blurred. And as you are dealing with self shadow issue, I would recommend to try to use a directional light (even for the torch) How can you apply directional light so that it does not look like a spotlight? Quote Link to comment Share on other sites More sharing options...
Guest Posted July 25, 2018 Share Posted July 25, 2018 well it will look like a directional light for sure Point light work well when the source on this demo: https://www.babylonjs-playground.com/#4MC650#0 but as you can see we avoid the self shadow problem as it implies too much precision for a webgl demo Do you think you could separate ground and walls perhaps? So ground cast on no one, walls cast on ground and there is no self shadowing questions Quote Link to comment Share on other sites More sharing options...
Istran Posted July 25, 2018 Author Share Posted July 25, 2018 On 7/25/2018 at 7:31 PM, Deltakosh said: well it will look like a directional light for sure Point light work well when the source on this demo: https://www.babylonjs-playground.com/#4MC650#0 but as you can see we avoid the self shadow problem as it implies too much precision for a webgl demo Do you think you could separate ground and walls perhaps? So ground cast on no one, walls cast on ground and there is no self shadowing questions Are you talking about horizontal and vertical polygons? In theory, this can be done, but shadows on vertical surfaces should also receive a shadow from other vertical polygons. Quote Link to comment Share on other sites More sharing options...
Guest Posted July 26, 2018 Share Posted July 26, 2018 yes, but you are in a real complex case and I'm not sure there is a good solution Other idea: have 4 directional lights oriented north, south, west and east Quote Link to comment Share on other sites More sharing options...
Istran Posted July 26, 2018 Author Share Posted July 26, 2018 4 hours ago, Deltakosh said: yes, but you are in a real complex case and I'm not sure there is a good solution Other idea: have 4 directional lights oriented north, south, west and east I immediately thought about it. Worth a try. Later I will show that it was working. 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.