Setting camera position every frame causing significant lag #7912
Replies: 1 comment
-
I figured out the issue with what I was having. Apparently the bounding box was not set correctly which was causing culling and objects not to render. Changing the parameters for the bounding box when creating the renderable for the entity fixed the issue. However, I don't understand why it would eventually continue to render after what appeared to be a lag when nothing changed as far as the positioning of the objects. It seems that if the bounding box was indeed culling the objects, it should always have been culling them. Anyway, I'm closing this discussion as I seemed to have found the source of the issue. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm developing an application where I need the camera to move every frame. Basically, I have an object that is moving within the scene and I need the camera to move with it (like a birds-eye view). The updates on the object's position and rotation come at 30-Hz. And with each update, I call the lookAt function for the camera to set the position and rotation based on the updated data. During portions of a playback (pre-recorded position/rotation data for the object), the camera moves sufficiently and the rendering is fine; however, during other portions of the playback, the rendering appears to freeze, and after a couple of seconds, the rendering resumes at the new camera position resulting in a "jump" in the viewing.
I created logs and I see that the object's data gets updated, the camera's position is continually updated, and the renderer's render function is continually called without any skipped frames. But, even though the render function is called, occasionally nothing will change in the actual view for a few seconds.
In lieu of using the lookAt function, I also tried setting the camera's model matrix each frame. Same result.
I don't have any issues setting the camera's view and model matrix every frame when doing an OpenGL implementation of the same application (no Filament). So I would assume that Filament is capable of handling updates to the camera position every frame (at 30-Hz).
My questions then are ... Is this the proper way to move/position the camera? Or is there a more preferred method? If what I'm doing is preferred or an acceptable method, any idea on what could be causing the lag?
Beta Was this translation helpful? Give feedback.
All reactions