Skip to content

Commit

Permalink
retro-v2 softlight, further refinements to border & softlight gradations
Browse files Browse the repository at this point in the history
  • Loading branch information
rbreaves committed Oct 15, 2022
1 parent 5870471 commit 34e3d2e
Show file tree
Hide file tree
Showing 9 changed files with 29 additions and 9 deletions.
7 changes: 5 additions & 2 deletions reshade/retro-v2-softlight-subtle.glslp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ shader1 = shaders/blendsoftlight/blendsoftlight.glsl



textures = "overlay;BORDER"
textures = "overlay;overlay2;BORDER;BORDERTHICK"
# change this path to point to your overlay image
overlay = shaders/blendsoftlight/shine_subtle.png
overlay = shaders/blendsoftlight/shine720_subtle.png
overlay2 = shaders/blendsoftlight/shineblack720.png
BORDER = shaders/blendsoftlight/border.png
BORDERTHICK = shaders/blendsoftlight/borderthick.png
ThickBool = 0.0
OverlayMix = 1.0
ASPECTRATIO = "43.0"

Expand Down
7 changes: 5 additions & 2 deletions reshade/retro-v2-softlight.glslp
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,13 @@ shader1 = shaders/blendsoftlight/blendsoftlight.glsl



textures = "overlay;BORDER"
textures = "overlay;overlay2;BORDER;BORDERTHICK"
# change this path to point to your overlay image
overlay = shaders/blendsoftlight/shine.png
overlay = shaders/blendsoftlight/shine720.png
overlay2 = shaders/blendsoftlight/shineblack720.png
BORDER = shaders/blendsoftlight/border.png
BORDERTHICK = shaders/blendsoftlight/borderthick.png
ThickBool = 0.0
OverlayMix = 1.0
ASPECTRATIO = "43.0"

Expand Down
24 changes: 19 additions & 5 deletions reshade/shaders/blendsoftlight/blendsoftlight.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#pragma parameter OverlayMix "Overlay Mix" 1.0 0.0 1.0 0.05
#pragma parameter SCALE "Box Scale" 4.0 0.25 4.0 0.05
#pragma parameter ASPECTRATIO "Aspect Ratio" 87.0 43.0 87.0 44.0
#pragma parameter ThickBool "Thick Borders" 0.0 0.0 1.0 1.0

#if defined(VERTEX)

Expand Down Expand Up @@ -110,7 +111,9 @@ uniform COMPAT_PRECISION vec2 TextureSize;
uniform COMPAT_PRECISION vec2 InputSize;
uniform sampler2D Texture;
uniform sampler2D BORDER;
uniform sampler2D BORDERTHICK;
uniform sampler2D overlay;
uniform sampler2D overlay2;
COMPAT_VARYING vec4 TEX0;

// compatibility #defines
Expand All @@ -123,9 +126,11 @@ COMPAT_VARYING vec4 TEX0;
#ifdef PARAMETER_UNIFORM
uniform COMPAT_PRECISION float OverlayMix;
uniform COMPAT_PRECISION float ASPECTRATIO;
uniform COMPAT_PRECISION float ThickBool;
#else
#define OverlayMix 1.0
#define ASPECTRATIO 43.0
#define ThickBool 0.0
#endif

float blendSoftlight(float base, float blend) {
Expand All @@ -135,21 +140,30 @@ float blendSoftlight(float base, float blend) {
void main()
{

vec4 frame = COMPAT_TEXTURE(Source, vTexCoord).rgba;
vec4 softlight = COMPAT_TEXTURE(overlay, vTexCoord).rgba;
vec4 frame = COMPAT_TEXTURE(Source, vTexCoord).rgba;
vec4 softlight = COMPAT_TEXTURE(overlay, vTexCoord).rgba;
if ( OverlayMix < 1.0 ){
softlight = COMPAT_TEXTURE(overlay2, vTexCoord).rgba;
softlight.a = OverlayMix;
}

vec4 ImageFinal = frame;

ImageFinal.r = blendSoftlight(frame.r,softlight.r);
ImageFinal.g = blendSoftlight(frame.g,softlight.g);
ImageFinal.b = blendSoftlight(frame.b,softlight.b);
ImageFinal.a = blendSoftlight(frame.a,softlight.a);
ImageFinal = mix(frame,clamp(ImageFinal,0.0,OverlayMix),softlight.a);
ImageFinal = mix(frame,ImageFinal,softlight.a);
// ImageFinal = mix(frame,clamp(ImageFinal,0.0,OverlayMix),softlight.a);


if (ASPECTRATIO == 87.0) {
vec4 background = COMPAT_TEXTURE(BORDER, vTexCoord);

FragColor = vec4(mix(ImageFinal, background, background.a));
if(ThickBool == 1.0){
background = COMPAT_TEXTURE(BORDERTHICK, vTexCoord);
}

FragColor = vec4(mix(ImageFinal, background, background.a));
}
else{
FragColor = vec4(ImageFinal);
Expand Down
Binary file modified reshade/shaders/blendsoftlight/border.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reshade/shaders/blendsoftlight/borderthick.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed reshade/shaders/blendsoftlight/shine.png
Binary file not shown.
Binary file added reshade/shaders/blendsoftlight/shine720.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added reshade/shaders/blendsoftlight/shineblack720.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 34e3d2e

Please sign in to comment.