I made my own adaptation, since its code has 2 errors and does not display the Shader in the main loop, only when taking the screenshot.
RenderImageID=CreateRenderImage(GetDeviceWidth(),GetDeviceHeight(),0,0)
RenderSpriteID=CreateSprite(RenderImageID)
//QuadID=CreateObjectQuad()
//SetObjectImage(QuadID,RenderImageID,0)
DIM ShaderID[2]
FOR I=1 TO 2
//ShaderID[I]=LoadFullScreenShader("Shaders/"+STR(I)+"-Scanline.ps")
ShaderID[I]=LoadSpriteShader("Shaders/"+STR(I)+"-Scanline.ps")
//------------------------------------------------------------------
//SCANLINE-1
if I=1
SetShaderConstantByName(ShaderID[I],"density", 1.25,0,0,0) //cantidad de lineas horizontales (potencias *2)
SetShaderConstantByName(ShaderID[I],"opacityScanline", 0.125,0,0,0) //opacidad de las scanline (potencias *2)
SetShaderConstantByName(ShaderID[I],"opacityNoise", 0.3,0,0,0) //ruido pixeles
SetShaderConstantByName(ShaderID[I],"flickering", 0.075,0,0,0) //parpadeo tipo fluerescente
endif
//SCANLINE-2
IF I=2
//https://www.shadertoy.com/view/Mt2XDV
SetShaderConstantByName(ShaderID[i],"vertJerkOpt", 0.0, 0,0,0)
SetShaderConstantByName(ShaderID[i],"vertMovementOpt", 0.0, 0,0,0)
SetShaderConstantByName(ShaderID[i],"bottomStaticOpt", 0.1, 0,0,0) //Efecto de cinta de video VHS
SetShaderConstantByName(ShaderID[i],"scalinesOpt", 1.0, 0,0,0) //barras fijas horizontales scanline
SetShaderConstantByName(ShaderID[i],"rgbOffsetOpt", 0.135,0,0,0) //color RGB desplazados Horizontalmente
SetShaderConstantByName(ShaderID[i],"horzFuzzOpt", 0.45, 0,0,0) //ruido horizontales pixel
//------------------------------------------------------------------
endif
NEXT I
global Shader_SC=1
//if Shader_SC>0 THEN SetObjectShader(QuadID,ShaderID[Shader_SC])
If Shader_SC>0 THEN SetSpriteShader(RenderSpriteID, ShaderID[Shader_SC])
Do
if GetRawKeyPressed(113) then ScreenShot() //F2
if GetRawKeyPressed(114) //F3
inc Shader_SC //F3
if Shader_SC=3: Shader_SC=0: SetSpriteShader(RenderSpriteID, -1): endif
//if Shader_SC>0 THEN SetObjectShader(QuadID,ShaderID[Shader_SC])
if Shader_SC>0 THEN SetSpriteShader(RenderSpriteID, ShaderID[Shader_SC])
endif
PRINTC("FPS:"):print(ScreenFPS())
PRINT(Shader_SC)
//--------------ScanLine Shader-------------
/*if Shader_SC>0
Update(0)
SetRenderToImage(RenderImageID,-1)
ClearScreen():Render()
SetRenderToScreen()
DrawObject(QuadID)
Swap()
else*/
SYNC()
//endif
Loop
FUNCTION ScreenShot()
i=CreateRenderImage(1280,720,0,0)
SetRenderToImage(i,-1)
ClearScreen():Render()
SetRenderToScreen()
FileName AS STRING
FileName = GetCurrentDate() + "_" + GetCurrentTime() + ".png"
FileName = ReplaceString( FileName , chr(58) , chr(46) , 1000 )
MakeFolder("SCREENSHOT")
SaveImage(i,"SCREENSHOT/HARDWORLD_" + FileName)
DeleteImage(i)
ENDFUNCTION
Shader_SC=1 and Shader_SC=1(no visible shader!)
Shader_SC=2 (Yes visible Shader)
But the result is not as desired, paint the Sprite Shader 100% opaque, without transparency ...
I also see that Shader # 1 does not apply the effect.