text: [{"Owner":"Andrevv","Date":"2017-04-30T19:18:22Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHello everyone!_lt_br /_gt_\n\tThis is my first question about my first babylon.js project. It will be a strategy game with complex economics (similar to Caesar 3_co_ Knights and Merchants)._lt_br /_gt_\n\tThe framework is amazing_co_ I like it very much_co_ but I have some problems with shadows. Everything works fine_co_ until I add lots of instances of a mesh across a large ground. The shadow becomes just a blob_co_ almost invisible. I think the problem comes from DirectionalLight.prototype.setShadowProjectionMatrix where all mesh positions are checked to see how big the area is for casting shadows. The bigger the area_co_ the more detail will be lost.\n_lt_/p_gt_\n\n_lt_p_gt_\n\tCan someone give me some advice on how to handle this problem?_lt_br /_gt_\n\tI thought of the following_dd__lt_br /_gt_\n\t1. Increase the mapSize from 1024 to a much larger value_co_ but it doesn_t_t make much difference with 2048 and the fps drops very much._lt_br /_gt_\n\t2. Somehow force the shadow casting area to be smaller with the help of customProjectionMatrixBuilder_co_ and make it follow the camera_co_ but how?_lt_br /_gt_\n\t3. Make the shadow part of the model_co_ like an old-school circle shadow with transparency. Ugly_co_ but at least I get 60 fps _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_br /_gt_\n\tAny other idea may be helpful _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\tYou can take a look at it if it helps_dd_ _lt_a href_eq__qt_http_dd_//feszer.go.ro/babylon.js/1/_qt_ rel_eq__qt_external nofollow_qt__gt_http_dd_//feszer.go.ro/babylon.js/1/_lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\t_lt_a class_eq__qt_ipsAttachLink ipsAttachLink_image_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_2017_04/1.PNG.aeb9a384f19d45a59413267905766586.PNG_qt_ data-fileid_eq__qt_12795_qt_ rel_eq__qt__qt__gt__lt_img alt_eq__qt_1.PNG_qt_ class_eq__qt_ipsImage ipsImage_thumbnailed_qt_ data-fileid_eq__qt_12795_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_2017_04/1.PNG.aeb9a384f19d45a59413267905766586.PNG_qt_ /_gt__lt_/a_gt__lt_a class_eq__qt_ipsAttachLink ipsAttachLink_image_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_2017_04/2.PNG.3fc2c4696cf42b13113a9e39a168b306.PNG_qt_ data-fileid_eq__qt_12796_qt_ rel_eq__qt__qt__gt__lt_img alt_eq__qt_2.PNG_qt_ class_eq__qt_ipsImage ipsImage_thumbnailed_qt_ data-fileid_eq__qt_12796_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/monthly_2017_04/2.PNG.3fc2c4696cf42b13113a9e39a168b306.PNG_qt_ /_gt__lt_/a_gt_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tP.S. I know_co_ that instances can_t_t have different animations_co_ I will handle that with separate clones for every action_co_ I think _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__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-05-01T17:46:46Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHello this is exactly the right analysis _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_gt__lt_/p_gt_\n\n_lt_p_gt_\n\t1. This is an option. It could work to some extends.\n_lt_/p_gt_\n\n_lt_p_gt_\n\t2. This is my favorite. You can control the size of the shadowmap and not take in account all meshes if they are not visible. The center of the projection would be the camera area\n_lt_/p_gt_\n\n_lt_p_gt_\n\t3. Could work as a fallback _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\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":"Tomm Huth","Date":"2018-03-22T19:10:42Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\t_lt_a contenteditable_eq__qt_false_qt_ data-ipshover_eq__qt__qt_ data-ipshover-target_eq__qt_http_dd_//www.html5gamedevs.com/profile/4442-deltakosh/?do_eq_hovercard_qt_ data-mentionid_eq__qt_4442_qt_ href_eq__qt_http_dd_//www.html5gamedevs.com/profile/4442-deltakosh/_qt_ rel_eq__qt__qt__gt_@Deltakosh_lt_/a_gt_ I_t_m having the same problem_co_ and also though solution #2 would be good. But I have no idea how to calculate that. Any ideas on specifically how to do that? _lt_img alt_eq__qt__dd_)_qt_ data-emoticon_eq__qt__qt_ height_eq__qt_20_qt_ src_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/default_smile.png_qt_ srcset_eq__qt_http_dd_//www.html5gamedevs.com/uploads/emoticons/smile@2x.png 2x_qt_ title_eq__qt__dd_)_qt_ width_eq__qt_20_qt_ /_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":"Tomm Huth","Date":"2018-03-22T21:09:03Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tIf I do\n_lt_/p_gt_\n\n_lt_pre_gt_\n_lt_code_gt_light.setShadowProjectionMatrix(camera._projectionMatrix.clone())_lt_/code_gt__lt_/pre_gt_\n\n_lt_p_gt_\n\tI get_dd_\n_lt_/p_gt_\n\n_lt_p_gt_\n\tapp.js_dd_12432 Uncaught TypeError_dd_ Cannot read property _t_length_t_ of undefined_lt_br /_gt_\n\t    at i../node_modules/babylonjs/babylon.js.i._setDefaultAutoExtendShadowProjectionMatrix (app.js_dd_12432)_lt_br /_gt_\n\t    at i../node_modules/babylonjs/babylon.js.i._setDefaultShadowProjectionMatrix (app.js_dd_12432)_lt_br /_gt_\n\t    at i../node_modules/babylonjs/babylon.js.i.setShadowProjectionMatrix (app.js_dd_12432)\n_lt_/p_gt_\n\n_lt_p_gt_\n\t \n_lt_/p_gt_\n\n_lt_p_gt_\n\tBut I have absolutely no idea what I_t_m doing. Haha.\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":"2018-03-23T18:20:47Z","Content":"_lt_div class_eq__qt_mages_qt__gt_\n\t\t\t\n_lt_p_gt_\n\tHey!\n_lt_/p_gt_\n\n_lt_p_gt_\n\tcan you try to repro it in the playground?\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_"}]