text: [{"Owner":"IIerpos","Date":"2017-07-04T11:16:10Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tI am having trouble with my shadows.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tEverything that receives shadows but is not occluded is covered with what I think is elsewhere referred to as _qt_shadow acne_qt_.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t1 blender exported ESM shadows do not work at all. Why? Are they for a later version of Babylon?\n_lt_/p_gt_\n\n_lt_p_gt_\n\t2 I am not clear on how the shadows are being mapped. My first approach was to try to minimize field of illumination to increase the apparent resolution by pointing spot lights at my model and setting the camera clipping plane (which apparently is mapped in the blender exporter to the shadowMinZ/MaxZ) to conservative levels. I have had inconsistent results with this_co_ so I really would like to understand clearly what it does. Is there in fact a Z axis resolution of the shadow map?\n_lt_/p_gt_\n\n_lt_p_gt_\n\t3 Of course I toyed with the shadow bias settings as well. However_co_ when I set the map resolution to 512_co_ by the time I get rid of the problems_co_ the shadows begin well_co_ well below the overhangs that create them. Much further than the apparent resolution of the shadow map would suggest is necessary. Then I decided to turn up the shadow map resolution to 4096_co_ but then_co_ even adding .00001 to the default bias setting offsets the shadow map by a huge amount_co_ rendering the setting essentially useless. This makes no sense to me.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tAlso_co_ what does the shadow map _qt_resolution_qt_ mean for the directional lights_co_ which have an infinite projection field? Is it somehow using the camera_t_s FOV?\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIn my use case_co_ I don_t_t actually need the shadows to be dynamic_co_ so I can set their resolution high and their refresh rate to 0.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tClearly I do not understand the shadows system_co_ and am sorry to load so many questions at once. Any help is welcome! I can_t_t give you the actual file I am working on due to non-disclosure issues_co_ but I tried to recreate it with a simple model that has similar scale_co_ thickness_co_ light position_co_ etc.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tThanks!\n_lt_/p_gt_\n\n_lt_p_gt__lt_a class_eq__qt_ipsAttachLink_qt_ href_eq__qt_//www.html5gamedevs.com/applications/core/interface/file/attachment.php?id_eq_13717_qt__gt_experiments.babylon_lt_/a_gt__lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-07-04T16:05:43Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHello I improved the doc with the new options we added for Shadows on v3_dd_ _lt_a href_eq__qt_http_dd_//doc.babylonjs.com/tutorials/shadows_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//doc.babylonjs.com/tutorials/shadows_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t1. They are in bjs 3.0\n_lt_/p_gt_\n\n_lt_p_gt_\n\t2. Shadow maps uses camera min and max Z if light.shadowMinZ and light.shadowMaxZ are not setup\n_lt_/p_gt_\n\n_lt_p_gt_\n\t3. You have several examples in the doc regarding bias and self shadowing\n_lt_/p_gt_\n\n_lt_p_gt_\n\t4. Directional uses orthographic projection_dd_  _lt_a href_eq__qt_https_dd_//github.com/BabylonJS/Babylon.js/blob/master/src/Lights/babylon.directionalLight.ts#L141_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//github.com/BabylonJS/Babylon.js/blob/master/src/Lights/babylon.directionalLight.ts#L141_lt_/a_gt_. Spot lights and points lights use perspective projection_dd_ _lt_a href_eq__qt_https_dd_//github.com/BabylonJS/Babylon.js/blob/master/src/Lights/babylon.spotLight.ts#L75_qt_ rel_eq__qt_external nofollow_qt__gt_https_dd_//github.com/BabylonJS/Babylon.js/blob/master/src/Lights/babylon.spotLight.ts#L75_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tIf you still have issues_co_ the best option would be to try to reproduce it in the PG. I could help more then _lt_img alt_eq__qt__sm_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_wink.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/wink@2x.png 2x_qt_ title_eq__qt__sm_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tNote_dd_ If you really want to understand how shadows work_co_ I recommend installing Spector.js (which is our webgl debugger). I can debug a frame for you and display the content of the shadow maps which helps A LOT to understand how shadows work_dd_ _lt_a href_eq__qt_http_dd_//spector.babylonjs.com/_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//spector.babylonjs.com/_lt_/a_gt_\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"IIerpos","Date":"2017-07-05T15:10:37Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tThanks!  I will look at Spector.js.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tWhat I was wondering about the orthographically projected shadows was what defines their X and Y limits_co_ where there is obviously a limited X and Y resolution. In the case of a spot light it is obviously the projection angle_co_ but looking at the source filled me in on where the  _qt__orthoLeft_qt__co_ _qt_orthoTop_qt_ etc. values come from.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tFor anyone reading this_co_ it looks to me like the directional light adds finds the min and max boundaries of the meshes in the shadow render list_co_ and then sets the width_co_ height and offset for the shadow map according to that.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tAlso_co_ The the Close Exponential Shadow map feature solved all my problems_co_ just so you know!\n_lt_/p_gt_\n\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"},{"Owner":"Deltakosh","Date":"2017-07-06T04:38:03Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t_lt_p_gt_\n\tif you are happy and satisfied then my goal is reached _lt_img alt_eq__qt__dd_D_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_biggrin.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/biggrin@2x.png 2x_qt_ title_eq__qt__dd_D_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n\t\t\t\n\t\t_lt_/div_gt_\n\n\t\t_lt_div class_eq__qt_ipsI_qt__gt__lt_/div_gt__lt_/div_gt_"}]