i was a able to add a global toggle button and an indicator dot for when the zooming function is working with copilot AI. I use Q as a toggle button and holding right mouse for zooming.
佬,下载reshade以后并没有自动创建reshade-shader这个文件夹,我直接手动创建放进去以后黄字告诉我没有在以下搜索路径中找到效果文件D:\SteamLibrary\steamapps\common\Helldivers 2\bin,然后我把搜索路径改成D:\SteamLibrary\steamapps\common\Helldivers 2\bin\reshade-s ders\Shaders又显示红字“编译失败,could not opened included file”reshade.fxh",带附加功能和不带附加功能的reshade我都试过了T_T求教
Can someone explain this to me because I am dumb just wondering if there is a way I can toggle it on and off with a keybind so in fights where I get ran up on I am not zoomed in to the point where I cant tell whats going on
You can switch between hold or toggle mode just as the desc said. However I provided no global switch that disables it entirely. If you want one then go to Javermore's post, apparently he add a global toggle button and an indicator.
Amazing for high FOV players, especially on super wide screen.
Since it's not possible to detect what weapon you have, would it be possible to enable the use of the mouse's scroll wheel while zoom is active, to cycle through a cvs list (2.0,2.5,3.2,4.2,etc) of zoom levels so we can manually try to match certain weapons and their wildly varying scope sizes? AMR scope is still fairly usable at an FOV of 90, but the railgun, stalwart, smgs, etc are so tiny.
i am unable to make it work, or at least, i can't notice any difference. I tried both in toggle and hold modes, no mouse key seems to work, am i missing anything? I've changed the settings by using the game UI. Any help? Do i have to edit it via notepad? I'm using the night vision reshader too, could that be causing issues? That one works.
Using in-game UI should be ok, and I don't think shaders have incompatibility issues between them. Could it be a ReShade version problem? I'm on ReShade 6.3.3 A screenshot just now so you can see that it's working on my side: https://imgur.la/images/2024/12/24/2024-12-24_11-10-05.png
p.s. don't forget to add quotation marks. Should be "hold" or "toggle", not hold or toggle.
If you really want to make it work you can check out previous projects that I based on. https://github.com/mhgar/ReShade-Magnifier (Which has the magnifier function, but no key binds) and https://github.com/luluco250/FXShaders/commit/982a96c6b5bda14cd7da3eeec5902af1bbca91b4 (A simple full-screen zoom shader that have key binding function, but its code is too old and only hold mode works)
If you can make the first one work, you should be able to use mine.
i'm forced to add quotation marks because else it gives me an error and resets it to the original bind. I just downloaded Reshade today so i doubt it's a version problem. I will try and see if Keyboard works rather than mouse. Here's my screenshot. https://i.imgur.com/CswJwL3.png The noticeable difference is that yours is called magnifier.fx and mine is called magnifier+.fx I'm using Reshade 6.3.3 with full addons support.
EDIT: nevermind, apparently this cannot be used with the night vision shader because i have to manually enable and disable the effects, and if they are disabled, the zoom will not work, and on top of this, it doesn't work with 3 out of the 4 presets of that mod, sorry for bothering and thank you for your time and reply!
31 comments
#include "ReShade.fxh"
i was a able to add a global toggle button and an indicator dot for when the zooming function is working with copilot AI. I use Q as a toggle button and holding right mouse for zooming.#ifndef TOGGLE_KEY
#define TOGGLE_KEY 81 // Q key
#endif
#ifndef MOUSE_BUTTON
#define MOUSE_BUTTON 1 // Right-click
#endif
uniform bool EnableMagnifier <source = "key"; keycode = TOGGLE_KEY; mode = "toggle"; ui_label = "Enable Magnifier Toggle (Q)"; ui_tooltip = "Enable or disable the right-click magnifier.";> = false;
uniform bool EnableRightClickMagnifier <source = "mousebutton"; keycode = MOUSE_BUTTON; mode = "hold"; ui_label = "Enable Right-Click Magnifier (Right-Click)"; ui_tooltip = "Enable the magnifier with right-click.";> = false;
uniform float2 DrawPosition <ui_type = "drag"; ui_min = 0.0; ui_max = 1.0; ui_step = 0.001; ui_tooltip = "The position on your screen where the magnifier will draw (does not work when the magnifier is set to fullscreen).";> = float2(0.5, 0.5);
uniform float2 MagnifyPosition <ui_type = "drag"; ui_min = 0.0; ui_max = 1.0; ui_step = 0.001; ui_tooltip = "The position on your screen that the magnifier will magnify.";> = float2(0.5, 0.5);
uniform float2 DotPosition <ui_type = "drag"; ui_min = 0.0; ui_max = 1.0; ui_step = 0.001; ui_label = "Dot Position"; ui_tooltip = "The position on the screen where the indicator dot will be drawn.";> = float2(0.95, 0.95);
uniform int Shape <ui_type = "combo"; ui_items = "Circle\0Rectangle\0Fullscreen\0"; ui_tooltip = "Choose the shape of the magnifier.";> = 0;
uniform int Filtering <ui_type = "combo"; ui_items = "Linear\0Point\0"; ui_tooltip = "Choose either linear or no filtering for the output image.";> = 0;
uniform float CircleRadius <ui_type = "drag"; ui_min = 0.0; ui_max = 1000.0; ui_step = 1.0; ui_tooltip = "The radius in pixels of the magnifier when it is drawn as a circle.";> = 260.0;
uniform float2 RectangleHalfExtent <ui_type = "drag"; ui_min = 0.0; ui_max = 1000.0; ui_step = 1.0; ui_tooltip = "The half size of the magnifier in pixels when it is drawn as a rectangle.";> = float2(300.0, 200.0);
uniform float ZoomLevel <ui_type = "drag"; ui_min = 1.0; ui_max = 10.0; ui_step = 0.01; ui_tooltip = "How much the magnifier will scale things.";> = 2;
uniform float CircleFeathering <ui_type = "drag"; ui_min = 0.0; ui_max = 1000.0; ui_step = 1.0; ui_tooltip = "Size of feathered edges in pixels, only works for the circle setting right now.";> = 10;
uniform float MagnifierOpacity <ui_type = "drag"; ui_min = 0.0; ui_max = 1.0; ui_step = 0.001; ui_tooltip = "How much opacity the magnifier has.";> = 1.0;
uniform float DotOpacity <ui_type = "drag"; ui_min = 0.0; ui_max = 1.0; ui_step = 0.001; ui_tooltip = "How much opacity the red/green dot has.";> = 1.0;
#define MODE_CIRCLE 0
#define MODE_RECTANGLE 1
#define MODE_FULLSCREEN 2
#define FILTER_LINEAR 0
#define FILTER_POINT 1
sampler2D pointBuffer {Texture = ReShade::BackBufferTex; MinFilter = POINT; MagFilter = POINT; MipFilter = POINT; AddressU = BORDER; AddressV = BORDER;};
float2 uv_to_screen(float2 uv) { return float2(uv.x * ReShade::ScreenSize.x, uv.y * ReShade::ScreenSize.y); }
bool outside_bounds(float2 p) { return p.x < 0.0 || p.x > 1.0 || p.y < 0.0; }
float circle_feathering_amt(float feather_size, float2 offset, float circle_radius) {
float magnitude = sqrt(offset.x * offset.x + offset.y * offset.y);
float startRadius = circle_radius - feather_size;
if (magnitude >= circle_radius) return 1.0;
if (magnitude <= startRadius) return 0.0;
float falloff = (magnitude - startRadius) / feather_size;
return falloff * falloff; // Squared falloff instead of linear
}
bool is_in_circle(float2 p, float2 centre, float radius) { return (p.x - centre.x) * (p.x - centre.x) + (p.y - centre.y) * (p.y - centre.y) <= radius * radius; }
bool is_in_rect(float2 p, float2 centre, float2 half_extent) { return abs(p.x - centre.x) <= half_extent.x && abs(p.y - centre.y) <= half_extent.y; }
float4 PS_Magnifier(float4 pos : SV_POSITION, float2 uv : TEXCOORD) : SV_TARGET {
bool enableRightClickMagnifier = EnableMagnifier && EnableRightClickMagnifier;
float4 final_pixel = tex2D(ReShade::BackBuffer, uv);
if (!enableRightClickMagnifier) {
float dot_radius = 0.02;
float distance = length((uv - DotPosition) * float2(ReShade::ScreenSize.x / ReShade::ScreenSize.y, 1.0));
float4 dot_color = EnableMagnifier ? float4(0.0, 1.0, 0.0, DotOpacity) : float4(1.0, 0.0, 0.0, DotOpacity);
if (distance < dot_radius) final_pixel = lerp(final_pixel, dot_color, DotOpacity);
return final_pixel;
}
float scale = 1.0 / ZoomLevel;
float2 draw_pos = Shape == MODE_FULLSCREEN ? float2(0.5, 0.5) : DrawPosition;
bool magnify = (Shape == MODE_CIRCLE && is_in_circle(uv_to_screen(uv), uv_to_screen(draw_pos), CircleRadius)) || (Shape == MODE_RECTANGLE && is_in_rect(uv_to_screen(uv), uv_to_screen(draw_pos), RectangleHalfExtent)) || (Shape == MODE_FULLSCREEN);
if (magnify) {
float2 offset = uv - draw_pos;
float2 take_pos = MagnifyPosition + offset * scale;
if (outside_bounds(take_pos)) final_pixel = float4(0.0, 0.0, 0.0, 1.0);
else {
float4 behind_pixel = tex2D(ReShade::BackBuffer, uv);
float opacity = (Shape == MODE_CIRCLE ? circle_feathering_amt(CircleFeathering, uv_to_screen(offset), CircleRadius) : 0.0);
float4 magnified_pixel = Filtering == FILTER_LINEAR ? tex2D(ReShade::BackBuffer, take_pos) : tex2D(pointBuffer, take_pos);
final_pixel = lerp(behind_pixel, lerp(magnified_pixel, behind_pixel, opacity), MagnifierOpacity);
}
}
float dot_radius = 0.02;
float distance = length((uv - DotPosition) * float2(ReShade::ScreenSize.x / ReShade::ScreenSize.y, 1.0));
float4 dot_color = EnableMagnifier ? float4(0.0, 1.0, 0.0, DotOpacity) : float4(1.0, 0.0, 0.0, DotOpacity);
if (distance < dot_radius) final_pixel = lerp(final_pixel, dot_color, DotOpacity);
return final_pixel;
}
technique Magnifier { pass { VertexShader = PostProcessVS; PixelShader = PS_Magnifier; } }
Since it's not possible to detect what weapon you have, would it be possible to enable the use of the mouse's scroll wheel while zoom is active, to cycle through a cvs list (2.0,2.5,3.2,4.2,etc) of zoom levels so we can manually try to match certain weapons and their wildly varying scope sizes? AMR scope is still fairly usable at an FOV of 90, but the railgun, stalwart, smgs, etc are so tiny.
I'm using the night vision reshader too, could that be causing issues? That one works.
A screenshot just now so you can see that it's working on my side: https://imgur.la/images/2024/12/24/2024-12-24_11-10-05.png
p.s. don't forget to add quotation marks. Should be "hold" or "toggle", not hold or toggle.
https://github.com/mhgar/ReShade-Magnifier
(Which has the magnifier function, but no key binds)
and
https://github.com/luluco250/FXShaders/commit/982a96c6b5bda14cd7da3eeec5902af1bbca91b4
(A simple full-screen zoom shader that have key binding function, but its code is too old and only hold mode works)
If you can make the first one work, you should be able to use mine.
I just downloaded Reshade today so i doubt it's a version problem.
I will try and see if Keyboard works rather than mouse.
Here's my screenshot.
https://i.imgur.com/CswJwL3.png
The noticeable difference is that yours is called magnifier.fx and mine is called magnifier+.fx
I'm using Reshade 6.3.3 with full addons support.
EDIT: nevermind, apparently this cannot be used with the night vision shader because i have to manually enable and disable the effects, and if they are disabled, the zoom will not work, and on top of this, it doesn't work with 3 out of the 4 presets of that mod, sorry for bothering and thank you for your time and reply!
that's make me sad