Closed TravisThomp closed 3 months ago
@TravisThomp after setting model.rotation
you should invoke model.applyRotation()
. Also, there is no point in increasing your tick
- just set how much you want to rotate (but this value should be scaled to time from last render).
var rotation = SPLAT.Quaternion.FromEuler(new SPLAT.Vector3(0, 0.1, 0));
const frame = () => {
model.rotation = rotation;
model.applyRotation();
renderer.render(scene, camera);
requestAnimationFrame(frame);
};
btw, I think that moving camera instead of rotating splat is better idea.
yeah that is the cause, was trying to get around it bc it's extremely slow. Will work on making it more efficent
@TravisThomp The problem is that after second look it should work without apply* call. It looks like glitches are caused by sortrer loop lagging behind rendering loop. Calling ApplyRotation slows down rendering loop, so thread with sorter has "more" time to do its job. And there is definitely a leak or at least accumulation of "timeouted" closures.
Woah! fascinating, I manually added the latency that applyRotation adds and the issue and the leak goes away. This is definitely seems like the cause.
Do you think that Applying the Parallel Radix sort in #11 would fix this issue?
@mateusz-malicki
@TravisThomp Thanks! Thats interesting, cuz on my machine rendering via offscreencanvas from worker (chrome version) sucks really bad on firefox...
@mateusz-malicki I forgot to ask yesterday, are you working on a fix for the concurrency issue? I was gonna spend time on this today, if so I'll look into something else :p
@TravisThomp Im on it already ;) But what i have now is rather workaround, not proper solution :/ And... for larger models there is issue with writing DepthIndex to GL buffer. For Garden-7k it can take up to 90ms on my machine (vertex count is around 4.5M if i remember correctly) Its price we have to pay for sorting on CPU i think...
Any update on this? If not I'm gonna take a crack at it.
@TravisThomp after setting
model.rotation
you should invokemodel.applyRotation()
. Also, there is no point in increasing yourtick
- just set how much you want to rotate (but this value should be scaled to time from last render).var rotation = SPLAT.Quaternion.FromEuler(new SPLAT.Vector3(0, 0.1, 0)); const frame = () => { model.rotation = rotation; model.applyRotation(); renderer.render(scene, camera); requestAnimationFrame(frame); };
btw, I think that moving camera instead of rotating splat is better idea.
But how to moving camera around the center, and how to reset the position of the splat?
I've been having this issue when applying a rotation to an object, It works fine on smaller scenes, but once the scene consists of a large amount of gaussians. The scene begins to distort, inverse rotation at times and clip on itself, and consumes all of the ram available (tldr its a shit show lol).
Example Video
https://github.com/huggingface/gsplat.js/assets/50000930/8b2b89bd-c758-4f27-be0c-4fb9428c44e7
Ram Usage Video
https://github.com/huggingface/gsplat.js/assets/50000930/cf96640c-79ec-4211-b495-d1b1ced06917
This only occurs on firefox browsers (Tested on Version 122.0)
Notes
Current Theory
There is an overflow that occurs in the translation of the gaussians since this only occurs when the scene is large. I'm assuming that the other browsers(chrome, edge) are cleaning this up automatically causing it to work fine with them, but firefox doesn't do this?
Code to recreate (pretty much any scene with a lot of gaussians rotating)