shouldn’t webGLrenderer.compile do that automatically ?
the freeze is this
but haven’t experienced anything like this in drei, so im guessing it might be a bug somewhere, perhaps you’re rendering 100 frames at once by accident or something like that. a few console.logs will surely clear this up quick.
is that the best way or it’s better to do compute one shadow frame per in each req animation frame ?
imo everything has to execute on a single threaded cpu anyway and one RAF is better than two. i would execute it in the animation loop, one render per frame until it reaches 100 frames and then it stays idle.
in vanilla i guess you have some kind of class, and it should probably expose an update(frames) method which the user has to throw into the ticker function.
Yeah, i’m planning to convert it into a class which extends object3d/Group like transformControls so you can just add it into the scene and expose lightOrigin , size of the plane , the shaderMaterial & methods to add mesh etc
then as you said i’ll expose a function “class.update()” which can just be left running in the animate loop and compute shadows on each frame when necessary , hope that resolves the issue
Current setup of using a timeout with promise to delay each forloop iteration seems dangerous
adding it to the raf loop did the trick !
performance is very stable and consistent now
since it’s on the render loop the compile stutter is taken care of in the first frame too
https://vis-prime.github.io/progressive-shadows/
@drcmda how does the blendWindow value work ? should it be same as the frame count ? is there any point in having it greater than or less than the frames value ?
blendwindow is for runtime shadows. you can have x seconds of frames, or infinite, and blend is how many it must accumulate before clearing, see:
but in hinsight runtime shadows seem useless and just cause complexity, i brought this over from prog LM but you would never want to have 8 lights causing a ton of extra renders and flickery shadows in a real project. i would recommend to completely remove it. and then yes, blend would be the same as frames.
one version done for now