Has anyone ported a CRT GLSL shader to Dolphin at all?
A good example would be the one discussed here
I've tried and failed to create a simple scanline based shader:
but it has no effect.
A good example would be the one discussed here
I've tried and failed to create a simple scanline based shader:
Code:
// lerp = mix
#define PI 3.14159265f
uniform samplerRECT samp0 : register(s0);
uniform float ScanlineAmount = 1.0f;
uniform float ScanlineScale = 1.0f;
uniform float ScanlineBrightScale = 1.0f;
uniform float ScanlineBrightOffset = 1.0f;
uniform float ScanlineOffset = 0.0f;
uniform float ScanlineHeight = 1.0f;
uniform float2 SourceDims = float2(640, 528);
void main(out float4 ocol0 : COLOR0, in float2 uv0 : TEXCOORD0)
{
float4 c0 = texRECT(samp0, uv0).rgba;
float TargetWidth = SourceDims.x;
float TargetHeight = SourceDims.y;
float RawWidth = 1920;
float RawHeight = 1080;
float pixelRatio = RawHeight / SourceDims.y;
float2 BaseCoord = uv0;
float2 ScanCoord = BaseCoord - 0.5f / SourceDims;
//float2 ScanCoord = BaseCoord;
ScanCoord.y *= pixelRatio;
float InnerSine = ScanCoord.y * RawHeight * ScanlineScale;
float ScanBrightMod = sin(InnerSine * PI + ScanlineOffset * RawHeight);
float4 ScanBrightness = mix(1.0f, (pow(ScanBrightMod * ScanBrightMod, ScanlineHeight) * ScanlineBrightScale + 1.0f) * 0.5f, ScanlineAmount);
// output
ocol0 = float4(c0 * ScanBrightness.xyz, c0.a);
}
but it has no effect.
