beyond-all-reason / beyond-all-reason/RecoilEngine

Camera rotation is applied 1 (?) render frame before translation

Open
#710 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C++
Stars
679
Forks
290
Avg merge
3d 1h
Merged PRs (30d)
38

Description

I discussed this with @lhog already, but now reproduced with a minimal widget.
If programmatically setting the camera in mode 4, with both translation and rotation, the rotation is applied before the translation occurs. I suspect it's 1 frame ahead.

(Note there's also an issue with shadows not appearing for a frame after translating, in this version of the engine (ZK current), but @lhog already fixed that)

Recording a video at sufficient frame rate with the following widget should show the problem, or watch the attached example.

![vlcsnap-2023-03-22-09h27m21s769](https://user-images.githubusercontent.com/1387874/226859261-fd09637f-4e6d-4017-91e4-e5564ad76b12.png)
![vlcsnap-2023-03-22-09h27m31s880](https://user-images.githubusercontent.com/1387874/226859270-7fbe3f6b-dbb5-45e5-901e-31a9646ff6bf.png)
![vlcsnap-2023-03-22-09h27m36s930](https://user-images.githubusercontent.com/1387874/226859273-cacdb5bb-439d-4ebe-ae91-f1f973ab06a0.png)

[camerarot.zip](https://github.com/beyond-all-reason/spring/files/11038379/camerarot.zip)

[2023-03-22 09-18-50.zip](https://github.com/beyond-all-reason/spring/files/11038410/2023-03-22.09-18-50.zip)

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the camera update with the attached camerarot.zip minimal widget and compare translation and rotation across render frames. Trace the camera update and render timing until the ordering is clear; done means programmatic translation and rotation are applied in the same frame without the reported one-frame mismatch.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.