TOPIC: Make mousedelta ignore screen borders
Make mousedelta ignore screen borders 1 year 8 months ago #1
| || |
There's one thing that impedes me from making mouse-based motion blur really work and that's the fact that some games (most in my experience) don't keep moving the mouse to the middle of the screen and simply confine it to the game's window's borders, or they just outright center it all the time and use raw input or DirectInput. This makes it unfeasible to use mousedelta properly in those games, as the mouse will eventually hit the window border and stop one or both of the mousedelta axis, or in the case of a centered cursor it won't move at all.
I have dabbed with this before in ReShade and was able to capture the mouse delta using Win32 Raw Input, it's relatively straight forward once you get over the usual horrible Win32 implementation (though confusing for me to implement within ReShade's source code because I'm a dumbass), so I wonder if this could be officially implemented in ReShade?
Here's an example of this problem:
Notice how the horizontal blur stops after a while, this is because the mouse has hit the window border and this stops the X axis of mousedelta.
Well I went ahead and "fixed" it myself, I've also made a pull request: github.com/crosire/reshade/pull/42
You can test it using this shader I made: github.com/luluco250/FXShaders/blob/master/Shaders/MBMB.fx
Without my fix, the shader will stop blurring in certain directions at a certain point, or it won't blur at all in some games.
With my fix, it's completely independent of the cursor position.
Here's a demonstration:
Following some discussion on the pull request (which I have closed), I've modified the code to work by using the raw input delta only when it's working, otherwise it uses ReShade's regular method. I've also created a separate branch to work on this: github.com/luluco250/reshade/tree/mousedelta
Likes to reinvent the wheel.
My shaders repository: www.github.com/luluco250/FXShaders
Last Edit: 1 year 8 months ago by luluco250.
The administrator has disabled public write access.