Better motionblur shader
- NoMansReshade
- Topic Author
Drunk Example
Motionblur Example
Sorry for the poor examples, but hopefully you get what I am trying to say! This happens because of either the lack of resources reshade has access to, or because of the shader implementation. Any info is greatly appreciated!
Please Log in or Create an account to join the conversation.
- Insomnia
Please Log in or Create an account to join the conversation.
- GP-Unity
Please Log in or Create an account to join the conversation.
- Insomnia
Screen based depth dependant motion blur, so to say. Not object based.
Please Log in or Create an account to join the conversation.
- crosire
That's not true. It's possible to get access to previous frames. The current "Motion Blur" shaders does exactly that, or else it wouldn't work at all. But that is not what you need for true motion blur. True motion blur only applies to objects that actually move and does not apply to objects that are static. This information is not available. Some games store it in some form of a velocity buffer and therefore can do proper motion blur. But as said, ReShade does not have access to that data.GP-Unity wrote: Many of us would like to see a great motion blur shader. Reshade however, doesn't have access to the previous frame(s). It's the same reason temporal anti-aliasing can't be implemented. Remember, Reshade in its current state can only work with the current frame, which means it doesn't know where to apply blur.
Please Log in or Create an account to join the conversation.
- GP-Unity
Please Log in or Create an account to join the conversation.
- Ederer
Compositing software like Nuke or AfterEffects can do that with any video or image sequence.
Here is an example on youtube of how the (commercial) After Effects plugin "ReelSmart Motion Blur" looks on recorded game footage:
(go to 1min20s)
It's not as accurate as using the velocity buffer the game engine would provide, e.g. there will probably be some artifacts, but it's usually quite convincing.
This is just a 2d post effect, there is no need to access the objects or cameras 3d-position.
So i guess in theory it would be possible to write such a shader for reshade, not sure about the fps hit though....
I'm not a coder, but maybe this helps:
opencv-python-tutroals.readthedocs.io/en...py_lucas_kanade.html
Please Log in or Create an account to join the conversation.
- Insomnia
Please Log in or Create an account to join the conversation.
- GP-Unity
Please Log in or Create an account to join the conversation.
- Elimina
Please Log in or Create an account to join the conversation.
- NoMansReshade
- Topic Author
Elimina wrote: One thing you guys aren't thinking about: RSMB is a post processing effect that is way too demanding to be used on any game, no matter how powerful your PC is. Using this effect already takes lot longer to render 60 frames than seeing 60 fps in a game, so I wouldn't imagine the in-game effect to be pleasant to use.
But surely we could at least get a better motion blur than the "Drunk" frame blending shader we have now, right? Like the one seen in this example?
Please Log in or Create an account to join the conversation.
- Elimina
NoMansReshade wrote:
But surely we could at least get a better motion blur than the "Drunk" frame blending shader we have now, right? Like the one seen in this example?
Anything is better than the one we have currently I'm not certain on this, but I think that this code uses the object's velocity/speed & distance to determine the amount of motion blur that is applied, which if I remember correctly, ReShade's depth buffer provides distance calculations but is unable to detect velocity.
There is one method that Ganossa was working on that could fix half of the problem, but recognizing an objects velocity is usually handled through methods that ReShade cannot access. I do know that Ganossa was working on a motion blur based in mouse movements (to simulate camera rotation), but I don't know what happened to that project.
Please Log in or Create an account to join the conversation.
- Insomnia
Elimina wrote:
NoMansReshade wrote:
But surely we could at least get a better motion blur than the "Drunk" frame blending shader we have now, right? Like the one seen in this example?
Anything is better than the one we have currently I'm not certain on this, but I think that this code uses the object's velocity/speed & distance to determine the amount of motion blur that is applied, which if I remember correctly, ReShade's depth buffer provides distance calculations but is unable to detect velocity.
There is one method that Ganossa was working on that could fix half of the problem, but recognizing an objects velocity is usually handled through methods that ReShade cannot access. I do know that Ganossa was working on a motion blur based in mouse movements (to simulate camera rotation), but I don't know what happened to that project.
Depth based motion blur is what I would like. Blur close to camera and not the whole screen like it is today.
Please Log in or Create an account to join the conversation.
- NoMansReshade
- Topic Author
Elimina wrote:
NoMansReshade wrote:
But surely we could at least get a better motion blur than the "Drunk" frame blending shader we have now, right? Like the one seen in this example?
Anything is better than the one we have currently I'm not certain on this, but I think that this code uses the object's velocity/speed & distance to determine the amount of motion blur that is applied, which if I remember correctly, ReShade's depth buffer provides distance calculations but is unable to detect velocity.
There is one method that Ganossa was working on that could fix half of the problem, but recognizing an objects velocity is usually handled through methods that ReShade cannot access. I do know that Ganossa was working on a motion blur based in mouse movements (to simulate camera rotation), but I don't know what happened to that project.
Couldn't you just capture the depth buffer from the current frame, store it until the next frame is done and then use that to determine velocity (which would add delay but who cares) ??
EDIT:
Because my understanding is that the current motion blur shader captures the current frame and stores it, then uses that to determine velocity; blurring the entire screen as a whole (effectively creating the "drunk" effect we see now.)
Please Log in or Create an account to join the conversation.
- magicart87
Please Log in or Create an account to join the conversation.
- luluco250
You need two separate 1x1 RG32F (32-bit float2) textures, one fire saving the velocity and one for saving the last mouse position (from the last frame), you then get the speed using:
vel = (last - curr) * sensitivity;
The problem with this is that motion blur stops working when the mouse hits the screen edges, the velocity is simply calculated to 0 if the cursor doesn't actually move.
My suggestion would be to add a new uniform to ReShade that gets the input directly from the mouse driver, not from Windows, so we could save a true mouse velocity uniform (and not even have to deal with it inside the shader itself).
Another thing you could improve upon is using some sort of distortion on the edges of the screen blur to simulate that spherical-looking motion blur you seen in games like Crysis.
Oh and you can get the mouse position with:
float2 f2Mouse <source="mousepoint";>;
Please Log in or Create an account to join the conversation.