Will I need to update for this fix, or will my situation be unaffected?
I haven’t updated it yet, coming soon
Am I going to need to update after you do?
This was only a fix inside the screen scale code, so it shouldn’t affect you
Appreciate the heads up,
Just to clarify for other users, you guys will still need to update when he fixes this. I’m doing weird shit, that’s why I don’t need to update my stuff. I don’t want people being confused and not updating when the update is out, hence this post.
Was going to make another post but the forums was crying about me doing consecutive posts, so I’ll just add to this one, lol.
I haven’t really seen anyone comment on how nice the addition of royale’s curvature is including how much the additional controls hyperspacemadness added, enhance the feature as a whole.(I’m talking about the [CURVATURE 2D] 2D/Extra3D Curvature on Long/Short Axis: Settings).
Like its night and day compared to LottesWarp and TorridsWarp (No offence), Sorry I doubted you guys telling me how much nicer royales curvature was, which I’m still not the biggest fan of vanilla royale curvature, @HyperspaceMadness’s update to the royale curvature though makes it much more usable and adds to the look immensely imo, making me actually want to use royale’s curvature for the first time ever, as I don’t have to fiddle with the settings forever to get a somewhat decent look (that only ever ended up looking sub-par imo, instead of looking fantastic like it does now).
This was totally worth you’re effort @HyperspaceMadness, big thumbs up from me!
now that X / Y offset are working for non-centered TV overlays, I updated my laaarge number of shaders/overlays/presets and would like to present a few of them so you can see, what nice things can easily be done with your mega refelction shader.
Maybe some of them are a little bit … crazy. But I like it that way
As your shader preset has 3 stock shaders (1 to 3) that seem to act as placeholders, I used them for some of my creations to apply mame_downsample.slang (because I like the “smoothness” of it) and color-mangler.slang (for those monochrome effects).
Sadly I wasn’t able to apply mame_distortion.slang, which I like best for vignetting, light bulb reflection and border smoothing (the cubic features ot that shader are of course not needed because of the great implementation in your mega shader). Once I try to apply mame_distortion, the whole shader crashes (but it works as standalone).
Do you have any idea, why mame_distortion ist not compatible with your shader?
Here are some screenshots
@frenki The monochrome screens are great. Also really enjoyed the woodgrain tv setup. The coffee/espresso machine made me lol.
Did you make sure to disconnect mame_distortion from mame-hlsl via the shaders code, as from what I recall the mame-hlsl chain is mostly hard-coded together. So if a pass has any settings, you’re not able to use it without the rest of mame-hlsl. It’s not to hard to disconnect them from each other, I have disconnected mame_phosphor, mame_deconverge, and mame_ntsc personally before.
Hi @Syh Actually I was thinking about that I have to “disconnect” single shaders from the mame-hlsl preset code. I tried to, but didn’t manage to do that. mame_downsample worked without disconnecting, so I hoped the rest would do, too. But it didn’t. Do you have any hint for me on how to disconnect (isolate) the mame distortion shader?
I’ve got basic coding skills and did some nice shader programmings (enhancements, to be honest) for reshade fx, but I’ve got severe problems with slang shaders. Somehow I don’t understand the concept deep enough
Give a sec real quick, I’m in the middle of testing the disconnect now lol. Yeah downsample is one of the only ones not hard-coded together for some reason, lol.
I’d be interested in hearing more about this tbh.
Sorry I was already disconnecting it before you had even asked, lol. I was just finishing up or so I thought when you messaged.
I got it separated properly now, sorry it was giving me fits for a second I didn’t pull everything correctly the first time and had to troubleshoot real quick. (I was getting tripped up by the swapxy thing.)
I separated the slang version of the shader. Everything seems to be working as far as I could tell. (I don’t really use mame-hlsl much as I’ve disconnected everything I was interested in, lol.)
Here ya go though!
#version 450
// license:BSD-3-Clause
// copyright-holders:ImJezze
//-----------------------------------------------------------------------------
// Distortion Effect
//-----------------------------------------------------------------------------
layout(push_constant) uniform Push
{
vec4 SourceSize;
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
vec4 FinalViewportSize;
} params;
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
float swapxy;
float distortiontoggle;
float distortion_amount;
float cubic_distortion_amount;
float distort_corner_amount;
float round_corner_amount;
float smooth_border_amount;
float vignette_amount;
float reflection_amount;
float reflection_col_r;
float reflection_col_g;
float reflection_col_b;
} global;
#pragma parameter distortiontoggle "Distortion Toggle" 0.0 0.0 1.0 1.0
bool Distortion = bool(global.distortiontoggle);
#pragma parameter distortion_amount "Distortion Amount" 0.0 0.0 1.0 0.01
#pragma parameter cubic_distortion_amount "Cubic Dist. Amt" 0.0 0.0 1.0 0.01
#pragma parameter distort_corner_amount "Corner Dist. Amt" 0.0 0.0 1.0 0.01
#pragma parameter round_corner_amount "Corner Rounding" 0.0 0.0 1.0 0.01
#pragma parameter smooth_border_amount "Border Smoothing" 0.0 0.0 1.0 0.01
#pragma parameter vignette_amount "Vignetting Amount" 0.0 0.0 1.0 0.01
#pragma parameter reflection_amount "Reflection Amount" 0.0 0.0 1.0 0.01
#pragma parameter reflection_col_r "Reflection Color R" 1.0 0.0 1.0 0.01
#pragma parameter reflection_col_g "Reflection Color G" 0.9 0.0 1.0 0.01
#pragma parameter reflection_col_b "Reflection Color B" 0.8 0.0 1.0 0.01
#pragma parameter swapxy "Swap X and Y" 0.0 0.0 1.0 1.0
bool SwapXY = bool(global.swapxy);
#define saturate(c) clamp(c, 0.0, 1.0)
#define mul(a,b) (b*a)
const int ScreenCount = 1;
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
const float Epsilon = 1.0e-7;
const float PI = 3.1415927;
const float E = 2.7182817;
const float Gelfond = 23.140692; // e^pi (Gelfond constant)
const float GelfondSchneider = 2.6651442; // 2^sqrt(2) (Gelfond-Schneider constant)
//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------
// www.stackoverflow.com/questions/5149544/can-i-generate-a-random-number-inside-a-pixel-shader/
float random(vec2 seed)
{
// irrationals for pseudo randomness
vec2 i = vec2(Gelfond, GelfondSchneider);
return fract(cos(dot(seed, i)) * 123456.0);
}
// www.dinodini.wordpress.com/2010/04/05/normalized-tunable-sigmoid-functions/
float normalizedSigmoid(float n, float k)
{
// valid for n and k in range of -1.0 and 1.0
return (n - n * k) / (k - abs(n) * 2.0 * k + 1);
}
// www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
float roundBox(vec2 p, vec2 b, float r)
{
return length(max(abs(p) - b + r, 0.0)) - r;
}
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source;
#define DiffuseSampler Source
float DistortionAmount = global.distortion_amount; // k - quartic distortion coefficient
float CubicDistortionAmount = global.cubic_distortion_amount; // kcube - cubic distortion modifier
float DistortCornerAmount = global.distort_corner_amount;
float RoundCornerAmount = global.round_corner_amount;
float SmoothBorderAmount = global.smooth_border_amount;
float VignettingAmount = global.vignette_amount;
float ReflectionAmount = global.reflection_amount;
vec3 LightReflectionColor = vec3(global.reflection_col_r, global.reflection_col_g, global.reflection_col_b); // color temperature 5.000 Kelvin
vec2 QuadDims = params.OutputSize.xy;
vec2 TargetDims = params.FinalViewportSize.xy;
float TargetScale = 1.0;
float GetNoiseFactor(vec3 n, float random)
{
// smaller n become more noisy
return 1.0f + random * max(0.0f, 0.25f * pow(E, -8 * n.x));
}
float GetVignetteFactor(vec2 coord, float amount)
{
vec2 VignetteCoord = coord;
float VignetteLength = length(VignetteCoord);
float VignetteBlur = (amount * 0.75f) + 0.25;
// 0.5 full screen fitting circle
float VignetteRadius = 1.0f - (amount * 0.25f);
float Vignette = smoothstep(VignetteRadius, VignetteRadius - VignetteBlur, VignetteLength);
return saturate(Vignette);
}
float GetSpotAddend(vec2 coord, float amount)
{
vec2 SpotCoord = coord;
// upper right quadrant
vec2 spotOffset = vec2(-0.25f, 0.25f);
// normalized screen canvas ratio
vec2 CanvasRatio = SwapXY
? vec2(1.0f, QuadDims.x / QuadDims.y)
: vec2(1.0f, QuadDims.y / QuadDims.x);
SpotCoord += spotOffset;
SpotCoord *= CanvasRatio;
float SpotBlur = amount;
// 0.5 full screen fitting circle
float SpotRadius = amount * 0.75f;
float Spot = smoothstep(SpotRadius, SpotRadius - SpotBlur, length(SpotCoord));
float SigmoidSpot = amount * normalizedSigmoid(Spot, 0.75);
// increase strength by 100%
SigmoidSpot = SigmoidSpot * 2.0f;
return saturate(SigmoidSpot);
}
float GetBoundsFactor(vec2 coord, vec2 bounds, float radiusAmount, float smoothAmount)
{
// reduce smooth amount down to radius amount
smoothAmount = min(smoothAmount, radiusAmount);
float range = min(bounds.x, bounds.y);
float amountMinimum = 1.0f / range;
float radius = range * max(radiusAmount, amountMinimum);
float smooth_ = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f));
// compute box
float box = roundBox(bounds * (coord * 2.0f), bounds, radius);
// apply smooth
box *= smooth_;
box += 1.0f - pow(smooth_ * 0.5f, 0.5f);
float border = smoothstep(1.0f, 0.0f, box);
return saturate(border);
}
// www.francois-tarlier.com/blog/cubic-lens-distortion-shader/
vec2 GetDistortedCoords(vec2 centerCoord, float amount, float amountCube)
{
// lens distortion coefficient
float k = amount;
// cubic distortion value
float kcube = amountCube;
// compute cubic distortion factor
float r2 = centerCoord.x * centerCoord.x + centerCoord.y * centerCoord.y;
float f = kcube == 0.0f
? 1.0f + r2 * k
: 1.0f + r2 * (k + kcube * sqrt(r2));
// fit screen bounds
f /= 1.0f + amount * 0.25f + amountCube * 0.125f;
// apply cubic distortion factor
centerCoord *= f;
return centerCoord;
}
vec2 GetTextureCoords(vec2 coord, float distortionAmount, float cubicDistortionAmount)
{
// center coordinates
coord -= 0.5f;
// distort coordinates
coord = GetDistortedCoords(coord, distortionAmount, cubicDistortionAmount);
// un-center coordinates
coord += 0.5f;
return coord;
}
vec2 GetQuadCoords(vec2 coord, vec2 scale, float distortionAmount, float cubicDistortionAmount)
{
// center coordinates
coord -= 0.5f;
// apply scale
coord *= scale;
// distort coordinates
coord = GetDistortedCoords(coord, distortionAmount, cubicDistortionAmount);
return coord;
}
void main()
{
if(!Distortion)
{
FragColor = texture(Source, vTexCoord);
return;
}
else
{
// image distortion
float distortionAmount = DistortionAmount;
float cubicDistortionAmount = CubicDistortionAmount > 0.0f
? CubicDistortionAmount * 1.1f // cubic distortion need to be a little higher to compensate the quartic distortion
: CubicDistortionAmount * 1.2f; // negativ values even more
// corner distortion at least by the amount of the image distorition
float distortCornerAmount = max(DistortCornerAmount, DistortionAmount + CubicDistortionAmount);
float roundCornerAmount = RoundCornerAmount * 0.5f;
float smoothBorderAmount = SmoothBorderAmount * 0.5f;
vec2 TexelDims = 1.0f / TargetDims;
// base-target dimensions (without oversampling)
vec2 BaseTargetDims = TargetDims / TargetScale;
BaseTargetDims = SwapXY
? BaseTargetDims.yx
: BaseTargetDims.xy;
// base-target/quad difference scale
vec2 BaseTargetQuadScale = (ScreenCount == 1)
? BaseTargetDims / QuadDims // keeps the coords inside of the quad bounds of a single screen
: vec2(1.0);
// Screen Texture Curvature
vec2 BaseCoord = GetTextureCoords(vTexCoord, distortionAmount, cubicDistortionAmount);
// Screen Quad Curvature
vec2 QuadCoord = GetQuadCoords(vTexCoord, BaseTargetQuadScale, distortCornerAmount, 0.0f);
/*
// clip border
if (BaseCoord.x < 0.0f - TexelDims.x || BaseCoord.y < 0.0f - TexelDims.y ||
BaseCoord.x > 1.0f + TexelDims.x || BaseCoord.y > 1.0f + TexelDims.y)
{
// we don't use the clip function, because we don't clear the render target before
return vec4(0.0f, 0.0f, 0.0f, 1.0f);
}
*/
// Color
vec4 BaseColor = texture(DiffuseSampler, BaseCoord);
BaseColor.a = 1.0f;
// Vignetting Simulation
vec2 VignetteCoord = QuadCoord;
float VignetteFactor = GetVignetteFactor(VignetteCoord, VignettingAmount);
BaseColor.rgb *= VignetteFactor;
// Light Reflection Simulation
vec2 SpotCoord = QuadCoord;
vec3 SpotAddend = GetSpotAddend(SpotCoord, ReflectionAmount) * LightReflectionColor;
BaseColor.rgb += SpotAddend * GetNoiseFactor(SpotAddend, random(SpotCoord));
// Round Corners Simulation
vec2 RoundCornerCoord = QuadCoord;
vec2 RoundCornerBounds = (ScreenCount == 1)
? QuadDims // align corners to quad bounds of a single screen
: BaseTargetDims; // align corners to target bounds of multiple screens
RoundCornerBounds = SwapXY
? RoundCornerBounds.yx
: RoundCornerBounds.xy;
float roundCornerFactor = GetBoundsFactor(RoundCornerCoord, RoundCornerBounds, roundCornerAmount, smoothBorderAmount);
BaseColor.rgb *= roundCornerFactor;
FragColor = BaseColor;
}
}
Just make a copy of some random slang shader and copy pasta this over it. The code could be tidied up some, but it runs without issues on my end. You can use this as reference to disconnect the others. If your curious about any of the passes I’ve already disconnected just PM me and I’ll help you out.
Hope this helps!
Wow nice. Thx a lot @Syh.
I will not be at home today, so I can’t test it before tomorrow. I think that this kind of stuff is interesting for many others, so it’s good we discussed this in public. I’ll give you feedback via PM tomorrow
If anyone has questions about my setup: don’t hesitate to ask, I’m happy to help!
It was NP, I like to help out with things when I can and it’s in my skill level. My memory is just horrible, juggling all the things currently lol.
Now that I think about it there’s a 50/50 chance that the previous verison I posted won’t work with @HyperspaceMadness’s shader chain (the shader I posted does work though, I was using it before I posted it) but that version might not work for your use case as RA or Slang in general has a setting amount limit. So I’ll have to semi-hardcode the setting values for that mame shader to work in Hyper’s chain.
I’m waiting on my computer to finish up some stuff before I go to sleep so I went ahead hardcoded the setting so it could be used with Hyper’s chain.
You’re going to want to use this version with Hyper’s chain, most other cases you can just use the first copy, lol.
#version 450
// license:BSD-3-Clause
// copyright-holders:ImJezze
//-----------------------------------------------------------------------------
// Distortion Effect
//-----------------------------------------------------------------------------
layout(push_constant) uniform Push
{
vec4 SourceSize;
vec4 OriginalSize;
vec4 OutputSize;
uint FrameCount;
vec4 FinalViewportSize;
} params;
layout(std140, set = 0, binding = 0) uniform UBO
{
mat4 MVP;
} global;
#define saturate(c) clamp(c, 0.0, 1.0)
#define mul(a,b) (b*a)
const int ScreenCount = 1;
//-----------------------------------------------------------------------------
// Constants
//-----------------------------------------------------------------------------
const float Epsilon = 1.0e-7;
const float PI = 3.1415927;
const float E = 2.7182817;
const float Gelfond = 23.140692; // e^pi (Gelfond constant)
const float GelfondSchneider = 2.6651442; // 2^sqrt(2) (Gelfond-Schneider constant)
//-----------------------------------------------------------------------------
// Functions
//-----------------------------------------------------------------------------
// www.stackoverflow.com/questions/5149544/can-i-generate-a-random-number-inside-a-pixel-shader/
float random(vec2 seed)
{
// irrationals for pseudo randomness
vec2 i = vec2(Gelfond, GelfondSchneider);
return fract(cos(dot(seed, i)) * 123456.0);
}
// www.dinodini.wordpress.com/2010/04/05/normalized-tunable-sigmoid-functions/
float normalizedSigmoid(float n, float k)
{
// valid for n and k in range of -1.0 and 1.0
return (n - n * k) / (k - abs(n) * 2.0 * k + 1);
}
// www.iquilezles.org/www/articles/distfunctions/distfunctions.htm
float roundBox(vec2 p, vec2 b, float r)
{
return length(max(abs(p) - b + r, 0.0)) - r;
}
#pragma stage vertex
layout(location = 0) in vec4 Position;
layout(location = 1) in vec2 TexCoord;
layout(location = 0) out vec2 vTexCoord;
void main()
{
gl_Position = global.MVP * Position;
vTexCoord = TexCoord;
}
#pragma stage fragment
layout(location = 0) in vec2 vTexCoord;
layout(location = 0) out vec4 FragColor;
layout(set = 0, binding = 2) uniform sampler2D Source;
#define DiffuseSampler Source
float DistortionAmount = 0.0; // k - quartic distortion coefficient
float CubicDistortionAmount = 0.0; // kcube - cubic distortion modifier
float DistortCornerAmount = 0.0;
float RoundCornerAmount = 0.0;
float SmoothBorderAmount = 0.0;
float VignettingAmount = 0.5;
float ReflectionAmount = 0.2;
vec3 LightReflectionColor = vec3(1.0, 0.9, 0.8); // color temperature 5.000 Kelvin
vec2 QuadDims = params.OutputSize.xy;
vec2 TargetDims = params.FinalViewportSize.xy;
float TargetScale = 1.0;
float GetNoiseFactor(vec3 n, float random)
{
// smaller n become more noisy
return 1.0f + random * max(0.0f, 0.25f * pow(E, -8 * n.x));
}
float GetVignetteFactor(vec2 coord, float amount)
{
vec2 VignetteCoord = coord;
float VignetteLength = length(VignetteCoord);
float VignetteBlur = (amount * 0.75f) + 0.25;
// 0.5 full screen fitting circle
float VignetteRadius = 1.0f - (amount * 0.25f);
float Vignette = smoothstep(VignetteRadius, VignetteRadius - VignetteBlur, VignetteLength);
return saturate(Vignette);
}
float GetSpotAddend(vec2 coord, float amount)
{
vec2 SpotCoord = coord;
// upper right quadrant
vec2 spotOffset = vec2(-0.25f, 0.25f);
// normalized screen canvas ratio
vec2 CanvasRatio = vec2(1.0f, QuadDims.y / QuadDims.x);
SpotCoord += spotOffset;
SpotCoord *= CanvasRatio;
float SpotBlur = amount;
// 0.5 full screen fitting circle
float SpotRadius = amount * 0.75f;
float Spot = smoothstep(SpotRadius, SpotRadius - SpotBlur, length(SpotCoord));
float SigmoidSpot = amount * normalizedSigmoid(Spot, 0.75);
// increase strength by 100%
SigmoidSpot = SigmoidSpot * 2.0f;
return saturate(SigmoidSpot);
}
float GetBoundsFactor(vec2 coord, vec2 bounds, float radiusAmount, float smoothAmount)
{
// reduce smooth amount down to radius amount
smoothAmount = min(smoothAmount, radiusAmount);
float range = min(bounds.x, bounds.y);
float amountMinimum = 1.0f / range;
float radius = range * max(radiusAmount, amountMinimum);
float smooth_ = 1.0f / (range * max(smoothAmount, amountMinimum * 2.0f));
// compute box
float box = roundBox(bounds * (coord * 2.0f), bounds, radius);
// apply smooth
box *= smooth_;
box += 1.0f - pow(smooth_ * 0.5f, 0.5f);
float border = smoothstep(1.0f, 0.0f, box);
return saturate(border);
}
// www.francois-tarlier.com/blog/cubic-lens-distortion-shader/
vec2 GetDistortedCoords(vec2 centerCoord, float amount, float amountCube)
{
// lens distortion coefficient
float k = amount;
// cubic distortion value
float kcube = amountCube;
// compute cubic distortion factor
float r2 = centerCoord.x * centerCoord.x + centerCoord.y * centerCoord.y;
float f = kcube == 0.0f
? 1.0f + r2 * k
: 1.0f + r2 * (k + kcube * sqrt(r2));
// fit screen bounds
f /= 1.0f + amount * 0.25f + amountCube * 0.125f;
// apply cubic distortion factor
centerCoord *= f;
return centerCoord;
}
vec2 GetTextureCoords(vec2 coord, float distortionAmount, float cubicDistortionAmount)
{
// center coordinates
coord -= 0.5f;
// distort coordinates
coord = GetDistortedCoords(coord, distortionAmount, cubicDistortionAmount);
// un-center coordinates
coord += 0.5f;
return coord;
}
vec2 GetQuadCoords(vec2 coord, vec2 scale, float distortionAmount, float cubicDistortionAmount)
{
// center coordinates
coord -= 0.5f;
// apply scale
coord *= scale;
// distort coordinates
coord = GetDistortedCoords(coord, distortionAmount, cubicDistortionAmount);
return coord;
}
void main()
{
// image distortion
float distortionAmount = DistortionAmount;
float cubicDistortionAmount = CubicDistortionAmount > 0.0f
? CubicDistortionAmount * 1.1f // cubic distortion need to be a little higher to compensate the quartic distortion
: CubicDistortionAmount * 1.2f; // negativ values even more
// corner distortion at least by the amount of the image distorition
float distortCornerAmount = max(DistortCornerAmount, DistortionAmount + CubicDistortionAmount);
float roundCornerAmount = RoundCornerAmount * 0.5f;
float smoothBorderAmount = SmoothBorderAmount * 0.5f;
vec2 TexelDims = 1.0f / TargetDims;
// base-target dimensions (without oversampling)
vec2 BaseTargetDims = TargetDims / TargetScale;
BaseTargetDims = BaseTargetDims.xy;
// base-target/quad difference scale
vec2 BaseTargetQuadScale = (ScreenCount == 1)
? BaseTargetDims / QuadDims // keeps the coords inside of the quad bounds of a single screen
: vec2(1.0);
// Screen Texture Curvature
vec2 BaseCoord = GetTextureCoords(vTexCoord, distortionAmount, cubicDistortionAmount);
// Screen Quad Curvature
vec2 QuadCoord = GetQuadCoords(vTexCoord, BaseTargetQuadScale, distortCornerAmount, 0.0f);
/*
// clip border
if (BaseCoord.x < 0.0f - TexelDims.x || BaseCoord.y < 0.0f - TexelDims.y ||
BaseCoord.x > 1.0f + TexelDims.x || BaseCoord.y > 1.0f + TexelDims.y)
{
// we don't use the clip function, because we don't clear the render target before
return vec4(0.0f, 0.0f, 0.0f, 1.0f);
}
*/
// Color
vec4 BaseColor = texture(DiffuseSampler, BaseCoord);
BaseColor.a = 1.0f;
// Vignetting Simulation
vec2 VignetteCoord = QuadCoord;
float VignetteFactor = GetVignetteFactor(VignetteCoord, VignettingAmount);
BaseColor.rgb *= VignetteFactor;
// Light Reflection Simulation
vec2 SpotCoord = QuadCoord;
vec3 SpotAddend = GetSpotAddend(SpotCoord, ReflectionAmount) * LightReflectionColor;
BaseColor.rgb += SpotAddend * GetNoiseFactor(SpotAddend, random(SpotCoord));
// Round Corners Simulation
vec2 RoundCornerCoord = QuadCoord;
vec2 RoundCornerBounds = (ScreenCount == 1)
? QuadDims // align corners to quad bounds of a single screen
: BaseTargetDims; // align corners to target bounds of multiple screens
RoundCornerBounds = RoundCornerBounds.xy;
float roundCornerFactor = GetBoundsFactor(RoundCornerCoord, RoundCornerBounds, roundCornerAmount, smoothBorderAmount);
BaseColor.rgb *= roundCornerFactor;
FragColor = BaseColor;
}
Here’s where the settings are so you can adjust them, you have to open the shader to edit the settings (which is a pain, but at least this way you should be able to run it with Hyper’s chain like you’re wanting.)
Just find this section in the shader and change these numbers to w/e you want them set at, the vignette and reflection are already set to be visible as I needed them to be so I could see if it worked and I just realized this after I posted it, lol.
float DistortionAmount = 0.0; // k - quartic distortion coefficient
float CubicDistortionAmount = 0.0; // kcube - cubic distortion modifier
float DistortCornerAmount = 0.0;
float RoundCornerAmount = 0.0;
float SmoothBorderAmount = 0.0;
float VignettingAmount = 0.5;
float ReflectionAmount = 0.2;
vec3 LightReflectionColor = vec3(1.0, 0.9, 0.8); // color temperature 5.000 Kelvin
The LightReflectionColor thingy that has three numbers, the numbers are in RGB order (so first number is the red value, then the green, then blue.)
Have fun, lol!
Hi,
How to say, Some people will prefer CBOD, Mdapt or others
The dithering problem mainly affects the Sega Genesis a bit Snes and some games on PSX SilentHill
I understand that this is not a priority, my question was just to increase realism.
I don’t know if it would be possible but in the shader pass add the three main ones
- CBOB
- Mdapt
- GTU and to insert an on / off switch, so that everyone can choose what they want and there are fewer shader available. for example A single shader for Guest-Venom (with the GTU / CBOD / Mdapt switches on off by default). One shader for Guest-sm and Easymode
So less shader in the list but even more options …
I even wonder and I don’t know how the result would be. My idea would be to resume your reflection in the game screen itself and have an adjustable blur. I do not know how would be the superposition can be, maybe that it would be useless (I am not a programmer just a player)
Truth be told, I’ve always found the zombie shader shader packs to be super nice visual level (provided you have the correct distance) some probably don’t like at all
Some are inspired by AnalogShader Pack which has never been converted to Glsl or Slang
If one day someone could combine this kind of zombshader blurring / dithering with Guest and your incredible reflection, it would be huge
I leave you a link, below there is a Genesis screen with a nice dithering for me
https://forums.launchbox-app.com/topic/30010-the-big-ol-retroarch-shader-thread/page/9/
If u wish, i can try it. I suggested the bezel project thing, and I really doubt that i can improove the script but i could improove the process steps, the inly thing i didn’t saw the reflections on your bezel. Great work!!
Hi, this is almost certainly because it has its own parameters. The shader system has a max number of parameters, and the Mega Bezel Shader with GTU is at the limit already (GTU adds 3 parameters), so if any shader you add has its own parameters it goes over the limit and won’t compile. This is a considerable difficulty with the Mega Bezel because it needs so many parameters, so much so that I’ve had to hack off a bunch of parameters from some of the crt shaders & other shaders in the chain.
I like this option, having less presets is better, the difficulty is fitting in the on/off parameters, but it may still be worth it.
Hi I’m not sure I understand what you mean, do you mean the reflection fading onto the screen itself, basically a blur of the actual edge of the screen between the screen and the bezel area?
I’ll have to check these out I haven’t tried them before.
Hi,
I am really sorry for my disastrous English I use a corrector.
If I understand correctly,
The reflection shader
- 1 copy of the game image
- 2 adds blur
These are the two parameters related to my idea. If I look at the Zombshader shaders or those of the Analog ShaderPack3 (still available on this forum), they are mainly composed in the first passes of blur9 or blur10. (The famous blur that created problems with AMD / ATI cards if I remember correctly).
If you have managed to add blur to Guest, Easymode or the other shaders in your pack, it is possible to add some for the main screen (that of the game).
This addition could have a rendering similar to that offered by zombshader or certain shaders of the AnalogShaderPack, with perhaps a blurring adjustment.
It’s an idea, I’m not sure how it would be visually if it were possible.
I may be wrong but during my youth, I played a lot on arcade cabinet (Street Fighter II, Mortal Kombat 1, Virtua Racing mainly and some NeoGeo games), I do not remember scanlines and I was very close to the 'screen.
My memory would be rather visually something between Guest and Zombshader, in any case your reflection with the TV frame and for me fantastic for the memory.
I have a Sony Trinitron European 100HZ (100hz can not be deactivated) with just a scart not VGA so I do not see scanlines, the image is disgusting for me … I much prefer my little VHS / CRT Samsung combo 36cm, it has no scan lines (or I can’t see them, even a few centimeters).
It is this memory that I have of arcade screens and in any case of TV on which I played Genesis or Snes Games.
I never had a Trinitron or PVM / BVM during my childhood, I have a CRT 19 "iiyama, I connected a Retroarch 15khz crtswitch the image does not make me dream.
I’m sorry for this long novel I hope you understand the essentials
Thank you
I decided to make a glass border preset, It’s not done quite yet, but Here are some screenshots as a sneak peak!
Coming Soon
Im already using your other pack for all my games with the carbon background. This new iteration with the glass border is exactly what i had in mind to modernize in a retro way (if that makes sense) older games. This will look stunning in 4k. Nice work and looking forward to this release.