Two requests: Fullscreen Zoom & 2 Crosshairs to 1

  • lonerboner
  • Topic Author
More
6 years 2 weeks ago #1 by lonerboner Two requests: Fullscreen Zoom & 2 Crosshairs to 1 was created by lonerboner
Hi guys,

First up, the zoom..
I have absolutely no idea how to tackle this. I am looking for a shader that'll zoom in the screen by a x2 or x3 margin (or even a slider). While I know the result after will be pixelated, i am still interested. The TV simulator did something like this with a warp effect as well, but that's pretty FPS heavy and I dislike the resolution scaling it does by faking the "old tv" effect.

The reason why I'm doing this is because lowering / increasing FOV in some games warps the models and looks odd on screenshots.

--
Secondly, the crosshairs...

I have these 2 crosshair files; one named xhair ( external pastebin link ) and one advanced_crosshair (from this forum, link ). The problem with xhair is that it uses a fixed width and height + a fixed w*h mask (1920 x 1080). This means the crosshair is off center in almost all cases except for ideal 1920x1080p monitors. And the mask, which is basically a .png with a small 4x4px dot in the middle, is also offcenter by 1 px.

The good part about xhair is it's configuration interface, you have many modes and adjustments you can do. I want to port it over to the advanced_crosshair file, especially the color inversion. I'm mainly looking to transfer over the inversion mode, xyz repositioning of the crosshair and maybe also hook in the 'texture' mode, but have it calculate screen res by using:
float2( (BUFFER_WIDTH / 2)-1, (BUFFER_HEIGHT / 2)-1);

instead of:
texture xhairTex	<  source = "xhair.png"; > {Width = 1920; Height = 1080; Format = RGBA8;};
sampler	xhairSampler 	{ Texture = xhairTex; };

texture xhairMaskTex	<  source = "xhair_mask.png"; > {Width = 1920; Height = 1080; Format = RGBA8;};
sampler	xhairMaskSampler 	{ Texture = xhairMaskTex; };

Any help on both subjects would be appreciated!

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

  • luluco250
More
6 years 2 weeks ago - 6 years 2 weeks ago #2 by luluco250 Replied by luluco250 on topic Two requests: Fullscreen Zoom & 2 Crosshairs to 1
I have made a Zoom effect: github.com/luluco250/FXShaders/blob/master/Shaders/Zoom.fx

I'm trying to understand what you want to do with the crosshair thing, well one thing you could try is adapt the texture to whatever aspect ratio/resolution the game is running in.

A function I like to use for scaling coordinates is this:
float scale_uv(float uv, float2 scale, float2 center) {
	return (uv - center) * scale + center;
}
// For normalized coordinates
float2 scale_uv(float2 uv, float2 scale) {
	return scale_uv(uv, scale, 0.5);
} 

You can easily use it to adapt different aspect ratios and resolutions.
Last edit: 6 years 2 weeks ago by luluco250.

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

  • lonerboner
  • Topic Author
More
6 years 2 weeks ago #3 by lonerboner Replied by lonerboner on topic Two requests: Fullscreen Zoom & 2 Crosshairs to 1
Thanks!

The zoom function doesnt seem to work, though :(

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

  • luluco250
More
6 years 1 week ago - 6 years 1 week ago #4 by luluco250 Replied by luluco250 on topic Two requests: Fullscreen Zoom & 2 Crosshairs to 1
I'm back on my PC now let me test it.
See if it works now: reshade.me/forum/shader-presentation/4150-simple-zoom-shader
Last edit: 6 years 1 week 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 forum. 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.