-
-
Save mariodivece/dab278f82ef3725b06001adec28ef92b to your computer and use it in GitHub Desktop.
/* | |
[configuration] | |
[OptionRangeFloat] | |
GUIName = Blur Area | |
OptionName = BLUR_SIZE | |
MinValue = 0.0 | |
MaxValue = 10.0 | |
StepAmount = 0.1 | |
DefaultValue = 1.6 | |
[OptionRangeFloat] | |
GUIName = Scanline Alpha | |
OptionName = SEPARATOR_ALPHA | |
MinValue = 0.0 | |
MaxValue = 1.0 | |
StepAmount = 0.05 | |
DefaultValue = 0.15 | |
[OptionRangeFloat] | |
GUIName = Scanline Width | |
OptionName = SCANLINE_SIZE | |
MinValue = 0.0 | |
MaxValue = 64 | |
StepAmount = 0.1 | |
DefaultValue = 6.3 | |
[OptionRangeFloat] | |
GUIName = Brightness Boost | |
OptionName = BRIGHTNESS_BOOST | |
MinValue = 0.0 | |
MaxValue = 2.0 | |
StepAmount = 0.01 | |
DefaultValue = 1.25 | |
[/configuration] | |
*/ | |
void main() | |
{ | |
const float PI = 3.1415926535897932384626433832795; | |
float4 c0 = Sample(); | |
float blursize = GetOption(BLUR_SIZE); | |
float subtleLevel = GetOption(SEPARATOR_ALPHA); // 0 is very dark separator, 1 is no separator | |
float scanlineSize = GetOption(SCANLINE_SIZE); | |
float boost = GetOption(BRIGHTNESS_BOOST); | |
//blur | |
float4 blurtotal = float4(0.0, 0.0, 0.0, 0.0); | |
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, -blursize) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, blursize) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, -blursize) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, blursize) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2(-blursize, 0.0) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2( blursize, 0.0) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2( 0.0, -blursize) * GetInvResolution()); | |
blurtotal += SampleLocation(GetCoordinates() + float2( 0.0, blursize) * GetInvResolution()); | |
blurtotal *= 0.125; | |
c0 = blurtotal; | |
// get color factor intensity based on vertical pixel position | |
// coordinates are 0 to 1 while resolution is a pixel resolution | |
float vPos = GetCoordinates().y * GetWindowResolution().y; | |
float lineIntensity = subtleLevel + abs(cos(PI / scanlineSize * vPos)); | |
// output | |
SetOutput(c0 * clamp(lineIntensity, 0.0, 1.125) * boost); | |
} |
This is amazing! Thank you for making it! It's really improved my immersion playing Resident Evil 2 :)
Works great! 👍
Thank you!
Hi @mariodivece , I also would prefer no flicker so came to get this one. However, while the other one shows the scanlines nice and thin like I expected, this one with default settings shows them way too big:
What values should I configure the second one to match the first?
Can you please port The Shader "crt-royale" to Dolphin? I tried renaming the one i found from ".glslp" to ".glsl" Format and putting it in the shaders folder of my Dolphin Folder, it shows up in Dolphin's Graphics Enhancement Menu, but when i select it and run a game it just gives me error messages. i tried both of your Dolphin shaders you made, they work fine, but i don't prefer them, "crt-royale" is actually really awesome CRT Shader on Duckstation that is almost perfect, and i would really love if you would make this one work for Dolphin.
ÂżPuedes portar el Shader "crt-royale" a Dolphin? IntentĂ© cambiar el nombre del que encontrĂ© de ".glslp" a ".glsl" y ponerlo en la carpeta de shaders de mi carpeta Dolphin. Aparece en el menĂş de mejora de gráficos de Dolphin, pero cuando lo selecciono y ejecuto un juego, solo me da mensajes de error. ProbĂ© los dos shaders de Dolphin que creaste y funcionan bien, pero no los prefiero. "crt-royale" es realmente un Shader CRT realmente asombroso en Duckstation que es casi perfecto. Me encantarĂa que hicieras que este funcione para Dolphin.
Check this: https://www.mediafire.com/file/164jvb9plhi0sjq/scanlines.zip/file
Hey guy, nice shader, i'm using duckstation emulator and this shade works normally, through the other scanline you made not. Can you make another shader, or its impossible? Using these same codes... I want some shaders which work with Duckstation like this above. If you need sugestion, the bad bloom is one which works too with duckstation.
RTX ON, Ultra Realistic is 2 shaders which i liked but half of the code not work...