mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-24 13:09:16 +01:00
fix(render): the free camera blurs with its own movement, the grass racing under it no longer strobes in rings (#441)
The motion blur took the movement of the vehicle the camera sits in and nothing else, so in freefly (and the debug camera) the world got no blur from the camera at all. Low over grass the texture under the camera then moved tens of pixels a frame and strobed: rings around the camera, at the distances its pattern repeats, stronger with shift and ctrl, gone above about 20 m, worst on a 165 Hz screen. * the camera with no vehicle of its own blurs the world with its movement since the frame before, as a vehicle does with get_future_movement(); a jump of 50 m or more (a camera preset) is no movement * that movement is held to half a metre a frame: the blur takes the scene where the camera will be, and a camera faster than that passes the ground at the bottom of the screen within a frame, where its motion turned over into a bright band. with the shutter of the blur it still smears metres * the blur shader skips samples off the picture instead of reading its edge row again and again
This commit is contained in:
@@ -469,6 +469,8 @@ class opengl33_renderer : public gfx_renderer {
|
||||
GLuint64 m_gllasttime = 0;
|
||||
|
||||
double m_precipitationrotation;
|
||||
// where the camera with no vehicle of its own was at the frame before, for the motion blur of its movement
|
||||
std::optional<glm::dvec3> m_freecameraposition;
|
||||
|
||||
glm::mat4 perspective_projection_raw(float fovy, float aspect, float znear, float zfar);
|
||||
glm::mat4 perspective_projection(const viewport_proj_config &c, float n, float f, glm::mat4 &frustum);
|
||||
|
||||
Reference in New Issue
Block a user