Make mousedelta ignore screen borders

4 years 7 months ago - 4 years 7 months ago #1 by luluco250 Make mousedelta ignore screen borders was created by luluco250
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:
You can test it using this shader I made:

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:
Last edit: 4 years 7 months ago by luluco250.

Please Log in or Create an account to join the conversation.

We use cookies

We use cookies on our website. Some of them are essential for the operation of the site, while others help us to improve this site and the user experience (tracking cookies). You can decide for yourself whether you want to allow cookies or not. Please note that if you reject them, you may not be able to use all the functionalities of the site.