Hi There,
First off, thank you for creating such a wonderful engine!
I am trying to update a ShadowGenerator based on new assets and/or frame rate (SceneLoader.LoadAssetContainerAsync). However I’ve run in to two challenges I can’t seem to crack or find the answer to.
Q1. When I add meshes to the generator that are already being rendered I’m getting artefacts over the surfaces. I think it is that the blurCloseExponentialShadowMap is not being applied to the new meshes, and have been able to replicate this in a simple playground: https://www.babylonjs-playground.com/#R9G1C8#4.
I have exaggerated this for the sake of demonstration by making the shadow map size very small. You can see by uncommenting line 33 that if the meshes are added to the generator at the point of creation the blur will apply as expected. However if the mesh is added on a timeout — to illustrate staggered loading or similar — then the blur is not applied. Among many other things, I have tried disposing the shadow generator and creating a new one which didn’t seem to solve my problem either.
So the question is, is there a way to update the shadowGenerator in a way that would apply the blur filter on these meshes?
Q2. I am building a simple custom scene optimiser (Working in reverse to the built in one to improve resolution etc, as well as tailoring the LODS to cater for a clients older android device… It’s amazing how much less performant a non flagship phone from two to three years ago is) . With that in mind I was wondering if there is a way to update the shadow map size? No worries if not at the moment I am simply disposing and recreating the generator, however I could avoid a lot of array iterating if this is possible.
Any help would be much appreciated, and sorry if these questions are already answered somewhere.
Thanks for your time!
P.S
Whilst I’ve got you, I’d love to get some opinions on at what point Draco compression is unfavourable in terms of file size, etc. I have lots of small assets (ranging from 2kb to 60kb with a few 200kb+ assets) and from experimenting I’m seeing a small improvement in the loading times if all the assets are not compressed.
So I’m thinking I could save 600kb by removing the decoder (If I remember correctly) however:
A. The bulk of my testing is on a local host
B. The user has to use more data (not great for mobile)
C. Some of the highpoly LODs are actually 800kb+ uncompressed and these are lazy loaded so there is a benefit here to having it for these assets as there is no impact on the initial render/loading screen time.
Sorry for the essay, and sorry if I have put this in the wrong place.