Hello there,
Something weird is going on with the shadows. It looks like its quality goes to 0 over time.
It looks like it has something to do with the moving objects, as if you comment out the lines #271
But with this rigidVehicle doing it’s thing (flying to the edge of the universe - I don’t know what is going on, I think it’s because of the differences between cannon and cannon-es, it works locally with my cannon-es) after few seconds it’s easy to see that’s it getting worse and worse
That’s because the light frustum used for shadow computation is based on meshes that can cast shadows. You have a mesh that is going away as time is passing, so this frustum is always expanding, lowering the shadow quality.
You should either remove this mesh from the shadow caster list or use a cascaded shadow generator. Using the latest:
@RaananW I have w hunch that you didn’t get it
The flying rigidVehicle is not intentional! It shouldn’t fly!
The same code works well with cannon-es as you can witness here https://neu5.github.io/cannon-es-debugger-babylonjs/
And cannon makes rigidVehicle fly into the space
Was away for a week, just came back. I’ll see if I can see why things fly into space
Just wanted to note, that a simple solution would be to change the car into a space rocket, and then you get exactly what you wanted to achieve!!!
It might be related to the fact that the original cannon’s up vector is z, which was changed in cannon-es. The Rigid Vehicle might have some references to the up vector internally