mirror of
https://github.com/WinampDesktop/winamp.git
synced 2025-06-18 01:55:46 -04:00
Add geom-overlay and fix other shaders. (#3245)
- Add geom-overlay.fx shader + psx.jpg texture; - Add crt-consumer.fx and delete crt-consumer.glsl; - Fix corner parameters from crt-geom.fx and geom.fx; - Fix coords from super-xbr. Now it works with more aspect ratio options.
This commit is contained in:
@ -76,16 +76,16 @@ uniform float geom_cornersmooth <
|
||||
|
||||
uniform float geom_x_tilt <
|
||||
ui_type = "drag";
|
||||
ui_min = -0.5;
|
||||
ui_max = 0.5;
|
||||
ui_min = -1.0;
|
||||
ui_max = 1.0;
|
||||
ui_step = 0.05;
|
||||
ui_label = "Geom Horizontal Tilt";
|
||||
> = 0.0;
|
||||
|
||||
uniform float geom_y_tilt <
|
||||
ui_type = "drag";
|
||||
ui_min = -0.5;
|
||||
ui_max = 0.5;
|
||||
ui_min = -1.0;
|
||||
ui_max = 1.0;
|
||||
ui_step = 0.05;
|
||||
ui_label = "Geom Vertical Tilt";
|
||||
> = 0.0;
|
||||
@ -108,17 +108,17 @@ uniform float geom_overscan_y <
|
||||
|
||||
uniform float centerx <
|
||||
ui_type = "drag";
|
||||
ui_min = -9.99;
|
||||
ui_max = 9.99;
|
||||
ui_step = 0.01;
|
||||
ui_min = -100.0;
|
||||
ui_max = 100.0;
|
||||
ui_step = 0.1;
|
||||
ui_label = "Image Center X";
|
||||
> = 0.00;
|
||||
|
||||
uniform float centery <
|
||||
ui_type = "drag";
|
||||
ui_min = -9.99;
|
||||
ui_max = 9.99;
|
||||
ui_step = 0.01;
|
||||
ui_min = -100.0;
|
||||
ui_max = 100.0;
|
||||
ui_step = 0.1;
|
||||
ui_label = "Image Center Y";
|
||||
> = 0.00;
|
||||
|
||||
@ -147,9 +147,11 @@ uniform float geom_monitor_gamma <
|
||||
> = 2.2;
|
||||
|
||||
|
||||
uniform float2 BufferViewportRatio < source = "buffer_to_viewport_ratio"; >;
|
||||
uniform float2 BufferToViewportRatio < source = "buffer_to_viewport_ratio"; >;
|
||||
uniform float2 NormalizedNativePixelSize < source = "normalized_native_pixel_size"; >;
|
||||
uniform float2 ViewportSize < source = "viewportsize"; >;
|
||||
uniform float ViewportWidth < source = "viewportwidth"; >;
|
||||
uniform float ViewportHeight < source = "viewportheight"; >;
|
||||
|
||||
sampler2D sBackBuffer{Texture=ReShade::BackBufferTex;AddressU=BORDER;AddressV=BORDER;AddressW=BORDER;MagFilter=LINEAR;MinFilter=LINEAR;};
|
||||
|
||||
@ -174,7 +176,7 @@ sampler2D sBackBuffer{Texture=ReShade::BackBufferTex;AddressU=BORDER;AddressV=BO
|
||||
#endif
|
||||
|
||||
// aspect ratio
|
||||
#define aspect (geom_invert_aspect==true?float2(0.75,1.0):float2(1.0,0.75))
|
||||
#define aspect (geom_invert_aspect==true?float2(ViewportHeight/ViewportWidth,1.0):float2(1.0,ViewportHeight/ViewportWidth))
|
||||
#define overscan (float2(1.01,1.01));
|
||||
|
||||
|
||||
@ -259,8 +261,7 @@ void VS_CRT_Geom(in uint id : SV_VertexID, out float4 position : SV_Position, ou
|
||||
// center screen
|
||||
texcoord = Warp(texcoord - float2(centerx,centery)/100.0);
|
||||
|
||||
// float2 SourceSize = 1.0/NormalizedNativePixelSize;
|
||||
float2 SourceSize = ViewportSize*BufferViewportRatio;
|
||||
float2 SourceSize = 1.0/NormalizedNativePixelSize;
|
||||
|
||||
// Precalculate a bunch of useful values we'll need in the fragment
|
||||
// shader.
|
||||
@ -336,7 +337,6 @@ float2 transform(float2 coord, float2 sinangle, float2 cosangle, float3 stretch)
|
||||
|
||||
float corner(float2 coord)
|
||||
{
|
||||
coord = (coord - float2(0.5, 0.5)) * float2(geom_overscan_x / 100.0, geom_overscan_y / 100.0) + float2(0.5, 0.5);
|
||||
coord = min(coord, float2(1.0, 1.0) - coord) * aspect;
|
||||
float2 cdist = float2(geom_cornersize, geom_cornersize);
|
||||
coord = (cdist - min(coord, cdist));
|
||||
@ -360,7 +360,7 @@ float4 PS_CRT_Geom(float4 vpos: SV_Position, float2 vTexCoord : TEXCOORD, in ST_
|
||||
else
|
||||
xy = vTexCoord;
|
||||
|
||||
float cval = corner(xy);
|
||||
float cval = corner((xy-float2(0.5,0.5)) * BufferToViewportRatio + float2(0.5,0.5));
|
||||
|
||||
float2 uv_ratio = frac((xy * vVARS.TextureSize - float2(0.5, 0.5)) / vVARS.TextureSize);
|
||||
|
||||
|
Reference in New Issue
Block a user