Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MotionBlur #9

Open
martin951 opened this issue Aug 3, 2021 · 9 comments
Open

MotionBlur #9

martin951 opened this issue Aug 3, 2021 · 9 comments

Comments

@martin951
Copy link

Not an issue rather a question..

Is it possible to render a custom vehicle camera with motion blur?

@Rbn3D
Copy link
Owner

Rbn3D commented Aug 3, 2021

I tried to add motion blur in the past, but seems like it's not possible, at least not without modify timecycle files.

I'm trying things like this with no luck:

image

However, it may be possible with mods like this:

https://gta5-mods.com/misc/motion-blur-mod

I need to figure out how to set desired ammount of blur and direction.

@martin951
Copy link
Author

I tried to add motion blur in the past, but seems like it's not possible, at least not without modify timecycle files.

I'm trying things like this with no luck:

image

However, it may be possible with mods like this:

https://gta5-mods.com/misc/motion-blur-mod

I need to figure out how to set desired ammount of blur and direction.

Motionblur works only when I don't update camera position. Meaning if the cam is purely attached to an entity it works.
This is however quite useless for a custom dynamic camera with movement :/

@Rbn3D
Copy link
Owner

Rbn3D commented Aug 3, 2021

I tried to add motion blur in the past, but seems like it's not possible, at least not without modify timecycle files.
I'm trying things like this with no luck:
image
However, it may be possible with mods like this:
https://gta5-mods.com/misc/motion-blur-mod
I need to figure out how to set desired ammount of blur and direction.

Motionblur works only when I don't update camera position. Meaning if the cam is purely attached to an entity it works.
This is however quite useless for a custom dynamic camera with movement :/

So probably it can't be done only by script or modified timecycle files. It will most likely require some reversing (find the address of motion blur on memory and force it to be enabled and set strength/direction).

But I'm not good at reversing (yet)...

Any help is welcome.

Meaning if the cam is purely attached to an entity it works.

Do you have an example of this? Does that also require modded game files?

@martin951
Copy link
Author

Iam using natural visions enhanced motion blur. I believe it does the same as the mod you linked.
Just attach the cam to players current vehicle once and it should have blur

@Rbn3D
Copy link
Owner

Rbn3D commented Aug 3, 2021

Not sure if it would work in my mod by calculating camera's position and rotation just like now, but instead of setting position and rotation on each frame, attach the cam to the car and set the relative offset between camera and car to match the global position and rotation I calculated on each frame...

I hope setting the offset doesn't disable motion blur...

@Rbn3D
Copy link
Owner

Rbn3D commented Aug 3, 2021

Not sure if it would work in my mod by calculating camera's position and rotation just like now, but instead of setting position and rotation on each frame, attach the cam to the car and set the relative offset between camera and car to match the global position and rotation I calculated on each frame...

I hope setting the offset doesn't disable motion blur...

Doesn't work (no motion blur)

image

@martin951
Copy link
Author

Not sure if it would work in my mod by calculating camera's position and rotation just like now, but instead of setting position and rotation on each frame, attach the cam to the car and set the relative offset between camera and car to match the global position and rotation I calculated on each frame...
I hope setting the offset doesn't disable motion blur...

Doesn't work (no motion blur)

image

I believe you are not allowed to change rot either.

@martin951
Copy link
Author

I mean every time you update the camera pos or rot or attachment, motion blur resets. Since you call it every frame > no motion blur.

Only solution I can think of would be spline cam.. Constantly adding new points to the spline path and interpolate the cam.

@Rbn3D
Copy link
Owner

Rbn3D commented Aug 4, 2021

Surprisingly, it worked out on first person, but only when vehicle speed is between 0 and 1, when is 0 there is no motion blur, and it increases as the value gets closer to 1. As soon as the speed exceeds 1, the effect disappear. I've tried every single native related to motion blur to try to fix it, I even tried to scale cam spline velocity.

Tomorrow I will post the code used, and also will commit this stuff to a separate btanch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants