Teardown-Issue-Tracker-Maintainers / Teardown-Issue-Tracker

A public repo for the community to track issues/bugs/feature requests in Teardown.
12 stars 5 forks source link

[Bug] Camera following my vehicle's movement no longer works properly, badly affected by motion blur and strange position shifting #448

Open MexicanHulkHogan42069 opened 1 year ago

MexicanHulkHogan42069 commented 1 year ago

Describe the bug

(reposting on alt acc because other one's issues don't show up to anyone else)

i'm making a cutscene and i have a camera that follows a vehicle by using a location and SetCameraTransform() that follows the vehicle as it moves through the tick() function, but now on the newest version of the game the camera constantly glides left and right and there's unwanted motion blur.

Steps to reproduce the behavior

SetCameraTransform(Transform(VecAdd(location transform.pos,vehicle transform.pos),location transform.rot)) the location is positioned relative to the world origin rather than the vehicle origin, the location transform is only additioned to the vehicle position, it's a cheap trick but it worked

Expected behavior

desired outcome (pre-1.5) https://github.com/Teardown-Issue-Tracker-Maintainers/Teardown-Issue-Tracker/assets/56771507/39b2f546-5322-4fbe-a5f2-06345d3a0e89

what i'm getting (1.5.1) https://github.com/Teardown-Issue-Tracker-Maintainers/Teardown-Issue-Tracker/assets/56771507/6b3e06ef-f9c0-48a1-a8e6-0c94e606c86f

Environment

Additional context

No response

dannyTuxedoLabs commented 1 year ago

Hi there! Can you please try to use "Update" instead of "Tick" and see if it works better.

MexicanHulkHogan42069 commented 1 year ago

still doesn't work :( both tick() and update() glitch out identically

dannyTuxedoLabs commented 1 year ago

Okay, thanks for lettings us know. If it's fine with you, could you please archive your mod and send it back to us and we'll have a closer look at what seems to go wrong.

YuLun-bili commented 11 months ago

I think the latest version (1.5.2) patched this issue and solved some of it, but camera still flickers sometimes (as shown in video)

This function is what I have for controlling camera movement

camDirVec = VecNormalize(Vec(1, 1, 0.6))
camDist = 60
camFov = 30

function handleGameCamera(terminate)
    if terminate then return end
    local vehiPos = GetVehicleTransform(GetPlayerVehicle()).pos
    local camPos = VecAdd(vehiPos, VecScale(camDirVec, camDist))
    local camRot = QuatLookAt(camPos, vehiPos)
    SetCameraTransform(Transform(camPos, camRot), camFov)
end

Video is recorded when calling in both tick() and update(), v-sync set to "every frame". Only calling in update() would have one or two frames using player camera position therefore is much worse. Only calling in tick() have no significant difference from calling in both. Change v-sync to "every other frame" makes flickering more regularly (about once per second) but each would only cause one or two frames of camera jumping. Change v-sync to "disabled" makes camera flicker more and is worse.

https://github.com/Teardown-Issue-Tracker-Maintainers/Teardown-Issue-Tracker/assets/70589524/a677c50f-8df0-4e17-9f3d-54c1fdb11a7b

YuLun-bili commented 10 months ago

Introduction of AttachCameraTo() partially solved this issue but attaching to a vehicle body/shape uses vehicle's orbital camera transform as origin (rather than body's/shape's origin) thus makes it difficult to calculate desired transform

Gregory-Gregory commented 9 months ago

@YuLun-bili thank you for the clarification.

The team has investigated the original issue and mentioned that AttachCameraTo() should resolve it. I have forwarded your comment as feedback to this function for the team's future consideration.

MexicanHulkHogan42069 commented 8 months ago

i tried implementing AttachCameraTo(), but the janky motion blur still persists just as much

https://github.com/Teardown-Issue-Tracker-Maintainers/Teardown-Issue-Tracker/assets/94859623/c81ac1b2-68eb-4526-835e-41b77aafef47

MexicanHulkHogan42069 commented 7 months ago

@Gregory-Gregory the problem still persists, camera continues to act janky :(