-
Notifications
You must be signed in to change notification settings - Fork 32
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
Binocular zoom has almost no blur when using mousewheel #45
Comments
It is the call to Haven't found a clean way to improve this yet. Hmm. |
Looks like the value being tested in Could be that the time value is only being changed when controller is used, letting it countdown & stay active after it's released, while kb/m doesn't update it, so the effect is disabled almost instantly, not sure though. |
Seems part of the code that used The KB+M code also seems to change that 0xC63011 byte, but for some reason the byte only changes when scrollwheel is changed a lot, small changes don't seem to affect the byte, but do still zoom in the screen. Kinda seems like there might still be some deadzone applying to scrollwheel which makes it so that only large scrollwheel changes actually get used to calculate blur strength, but not sure how zoom still gets applied though. |
Added something that appears to be working pretty nicely in 04400fc. Let me know what you think. |
Hm, I think there's an improvement there, but it still doesn't seem to apply the blur in some cases, eg. I'd expect 1 click of the mouse-wheel to zoom it in & apply slight blur while it happens, but doesn't seem any blur is applied at all, only seems to apply blur when I move scrollwheel a bunch of clicks at once. Controller on the other hand seems to apply blur no matter how little you push it, the zoom factor on the side also goes up in smaller steps with controller, maybe related to it somehow: Here's an example with controller with very light stick movement: ctrl2.webm.mp4and with mouse, trying to move it at around the same speed (I messed up encoding so it might look like blur is applied here, but there wasn't any blur at all) mouse.webm.mp4You can also see there how the zoom count is increasing by 1 with controller there too, while mouse seems to be doubling it each time or something. |
Hmm, the sniper rifle has smaller zoom steps, so the fix does look better there, but a single scroll of the mouse wheel is indeed not triggering the effect. Hmm. |
Ohh I just realized your fix is E: oh nvm, looks like your hook is for |
Yeah, that's right. I assumed the result would end up looking similar for both of them, but the binocular one needs less "scrolls" to move faster. |
Added some extra structs & names around the |
The code around 0x9692AB seems to be what converts scroll-wheel into RS input, the Halving the values it pushes there makes the bino zoom in much smaller steps, but blur doesn't really seem affected... seems this is maybe only converting it to the RS input for a single frame, and maybe blur code wants it to have several frames of input, might explain why scrolling multiple clicks allows blur to be activated too, since those would let the RS input get changed for more than 1 frame. Maybe the focus animation works by fading in the blur over several frames, then fading it out when RS is released - since this is only setting RS for a single frame per wheel click, could be that blur never got faded in enough for it to be visible at all. Two ways I can think of to fix it, either see if FocusAnimation stuff can be changed so that it sets itself to full blur on every change (would probably need to make this KB/M only I'd guess), or change the wheel->RS code so that it changes RS over a number of frames instead of just once (if we're lucky maybe this could make the scope actually "zoom" in naturally when using wheel too, instead of snapping to each position) |
Ah, thank you! Hmm, I think I have an ugly workaround in mind. Let me see if it works properly. Edit: okay, seems to be working fine with both CameraBinocular and CameraScope now. My workaround is basically making the game play the focus animation for at least X ammount of time, so it doesn't end too soon. Let me know if 96d176d solves this once and for all :p |
Wow that works great, excellent work! Pretty much how I hoped it would be. I do still wonder about making the wheel->RS work over multiple frames though, instead of snapping to each position, might try looking into that some time, for now I guess this issue is fixed though :) |
I also have another of my ugly hack ideas to smoothen the zoom with the mouse. |
Some reason using mouse scrollwheel to zoom the binoculars only results in very minor blurring, while controller has a much stronger effect, must be something to do with how the mousewheel zoom was implemented - seems mousewheel makes it snap to different zoom levels, while controller stick lets it go smoothly between them.
I guess blurring effect is kept active while controller is going between them until controller stick is released, while with mousewheel maybe it's being treated as "released" as soon as it's snapped to a level, not really sure how much could be done to improve this, if anyone has any ideas please let me know.
The text was updated successfully, but these errors were encountered: