uncomment line 220, run the PG.
wait for the dude to load, then pivot the camera until you see the cloned dudes. You should see artifacts on the surface of the water as you pivot until the cloned dudes are in view frustrum.
In addition, if you clone the dudes within the camera frustrum, ie const zrand = 20;, no artifacts are generated in the refraction texture, irregardless of skeleton.
This took a while to find (it was showing up in seedborn savefiles). Consistent and reproducible on my hardware and browser (chrome+firefox). Its not version related, running on 4.2.1 also shows the same.
Meshes behind the camera are culled and therefore not taken into account in the main management loop. In particular, this means that their skeletons are not updated (they donāt need to be, as they canāt be seen).
However, as you explicitly push them into the refraction/reflection texture, they will be rendered in an RTT. But since their skeletons havenāt been updated properly, you get rendering artifacts.
The simplest solution is to simply call skeleton.prepare() when you clone the skeletons :
It would be nice if the RTT noticed that some skeletons werenāt up to date when rendering a mesh, but I donāt think thatās an easy fixā¦ So, for now, itās the userās responsibility to call prepare in the case.
Awesome! Single line solution, I love it! I think your entire answer should be in the doc, I was looking at the skeleton api for ages and would never have figured out prepare was the solution. Thanks, marking as solved and closing!
Happy to confirm that its working in v6.16.0, the artifacts are gone! Loading is fractionally longer (for 100+ cloned skeletons, only <20 with high bone count) but not excessive. Thanks very much!