Skip to content

Commit 6ff70d2

Browse files
committed
retro-v2 softlight, further refinements to border & softlight gradations
1 parent 5870471 commit 6ff70d2

File tree

10 files changed

+45
-9
lines changed

10 files changed

+45
-9
lines changed

reshade/retro-v2-softlight-subtle.glslp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ shader1 = shaders/blendsoftlight/blendsoftlight.glsl
44

55

66

7-
textures = "overlay;BORDER"
7+
textures = "overlay;overlay2;BORDER;BORDERTHICK;BORDERTHIN"
88
# change this path to point to your overlay image
9-
overlay = shaders/blendsoftlight/shine_subtle.png
9+
overlay = shaders/blendsoftlight/shine720_subtle.png
10+
overlay2 = shaders/blendsoftlight/shineblack720.png
1011
BORDER = shaders/blendsoftlight/border.png
12+
BORDERTHICK = shaders/blendsoftlight/borderthick.png
13+
BORDERTHIN = shaders/blendsoftlight/borderthin.png
14+
BorderBool = 0.0
15+
ThickBool = 0.0
16+
ThinBool = 0.0
1117
OverlayMix = 1.0
1218
ASPECTRATIO = "43.0"
1319

reshade/retro-v2-softlight.glslp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,16 @@ shader1 = shaders/blendsoftlight/blendsoftlight.glsl
44

55

66

7-
textures = "overlay;BORDER"
7+
textures = "overlay;overlay2;BORDER;BORDERTHICK;BORDERTHIN"
88
# change this path to point to your overlay image
9-
overlay = shaders/blendsoftlight/shine.png
9+
overlay = shaders/blendsoftlight/shine720.png
10+
overlay2 = shaders/blendsoftlight/shineblack720.png
1011
BORDER = shaders/blendsoftlight/border.png
12+
BORDERTHICK = shaders/blendsoftlight/borderthick.png
13+
BORDERTHIN = shaders/blendsoftlight/borderthin.png
14+
BorderBool = 0.0
15+
ThickBool = 0.0
16+
ThinBool = 0.0
1117
OverlayMix = 1.0
1218
ASPECTRATIO = "43.0"
1319

reshade/shaders/blendsoftlight/blendsoftlight.glsl

Lines changed: 29 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@
1515
#pragma parameter OverlayMix "Overlay Mix" 1.0 0.0 1.0 0.05
1616
#pragma parameter SCALE "Box Scale" 4.0 0.25 4.0 0.05
1717
#pragma parameter ASPECTRATIO "Aspect Ratio" 87.0 43.0 87.0 44.0
18+
#pragma parameter BorderBool "Normal Borders" 0.0 0.0 1.0 1.0
19+
#pragma parameter ThickBool "Thick Borders" 0.0 0.0 1.0 1.0
20+
#pragma parameter ThinBool "Thin Borders" 0.0 0.0 1.0 1.0
1821

1922
#if defined(VERTEX)
2023

@@ -110,7 +113,10 @@ uniform COMPAT_PRECISION vec2 TextureSize;
110113
uniform COMPAT_PRECISION vec2 InputSize;
111114
uniform sampler2D Texture;
112115
uniform sampler2D BORDER;
116+
uniform sampler2D BORDERTHICK;
117+
uniform sampler2D BORDERTHIN;
113118
uniform sampler2D overlay;
119+
uniform sampler2D overlay2;
114120
COMPAT_VARYING vec4 TEX0;
115121

116122
// compatibility #defines
@@ -123,9 +129,15 @@ COMPAT_VARYING vec4 TEX0;
123129
#ifdef PARAMETER_UNIFORM
124130
uniform COMPAT_PRECISION float OverlayMix;
125131
uniform COMPAT_PRECISION float ASPECTRATIO;
132+
uniform COMPAT_PRECISION float BorderBool;
133+
uniform COMPAT_PRECISION float ThickBool;
134+
uniform COMPAT_PRECISION float ThinBool;
126135
#else
127136
#define OverlayMix 1.0
128137
#define ASPECTRATIO 43.0
138+
#define BorderBool 0.0
139+
#define ThickBool 0.0
140+
#define ThinBool 0.0
129141
#endif
130142

131143
float blendSoftlight(float base, float blend) {
@@ -135,20 +147,32 @@ float blendSoftlight(float base, float blend) {
135147
void main()
136148
{
137149

138-
vec4 frame = COMPAT_TEXTURE(Source, vTexCoord).rgba;
139-
vec4 softlight = COMPAT_TEXTURE(overlay, vTexCoord).rgba;
150+
vec4 frame = COMPAT_TEXTURE(Source, vTexCoord).rgba;
151+
vec4 softlight = COMPAT_TEXTURE(overlay, vTexCoord).rgba;
152+
if ( OverlayMix < 1.0 ){
153+
softlight = COMPAT_TEXTURE(overlay2, vTexCoord).rgba;
154+
softlight.a = OverlayMix;
155+
}
140156

141157
vec4 ImageFinal = frame;
142158

143159
ImageFinal.r = blendSoftlight(frame.r,softlight.r);
144160
ImageFinal.g = blendSoftlight(frame.g,softlight.g);
145161
ImageFinal.b = blendSoftlight(frame.b,softlight.b);
146162
ImageFinal.a = blendSoftlight(frame.a,softlight.a);
147-
ImageFinal = mix(frame,clamp(ImageFinal,0.0,OverlayMix),softlight.a);
163+
ImageFinal = mix(frame,ImageFinal,softlight.a);
164+
// ImageFinal = mix(frame,clamp(ImageFinal,0.0,OverlayMix),softlight.a);
148165

149-
if (ASPECTRATIO == 87.0) {
166+
// Aspect ratio 8:7 will always have a normal border applied
167+
// otherwise glitching will occur on the edges
168+
if (ASPECTRATIO == 87.0 || BorderBool == 1.0 || ThickBool == 1.0 || ThinBool == 1.0) {
150169
vec4 background = COMPAT_TEXTURE(BORDER, vTexCoord);
151-
170+
if(ThickBool == 1.0){
171+
background = COMPAT_TEXTURE(BORDERTHICK, vTexCoord);
172+
}
173+
if(ThinBool == 1.0){
174+
background = COMPAT_TEXTURE(BORDERTHIN, vTexCoord);
175+
}
152176
FragColor = vec4(mix(ImageFinal, background, background.a));
153177
}
154178
else{
551 Bytes
Loading
7.64 KB
Loading
7.05 KB
Loading
-3.59 MB
Binary file not shown.
144 KB
Loading
133 KB
Loading
114 KB
Loading

0 commit comments

Comments
 (0)