Hey nice
May I advertise the
FXAA shader I did in 2016.
It still works... in Vulkan also.
Here is it again but a bit more user friendly than before:
New FXAA Shader Demo (Press space to cycle through the AA modes)
@Raven: You render the Text to the Rendertarget also, so the Text also gets AA.
I think you want text to be sharp, so change the Render to Render3D and add a Render2DFront to draw the text and sprites afterwards.
And as your code didn't compile I corrected it and added my changes:
Type FXAA_Shader
ShaderID As Integer
RenderBuffer As Integer
RenderTarget As Integer
Width As Integer
Height As Integer
ScreenHeight As Integer
ScreenWidth As Integer
EndType
Global FXAA As FXAA_Shader
FXAA.ShaderID = LoadFullScreenShader( "fxaa.ps" )
FXAA.RenderBuffer = CreateRenderImage( FXAA.Width, FXAA.Height, 0, 0 )
FXAA.RenderTarget = CreateObjectQuad() : SetObjectShader( FXAA.RenderTarget, FXAA.ShaderID )
Do
// If the Screen changes Resolution, Update the RenderBuffer
If FXAA.ScreenHeight <> GetDeviceHeight() || FXAA.ScreenWidth || GetDeviceWidth()
DeleteImage( FXAA.RenderBuffer )
FXAA.Height = GetDeviceHeight() : FXAA.Width = GetDeviceWidth()
FXAA.RenderBuffer = CreateRenderImage( FXAA.Width, FXAA.Height, 0, 0 )
EndIf
RenderScene()
Loop
Function RenderScene()
Update(0) // Update Scene Objects
// Post-Processing
SetRenderToImage(FXAA.RenderBuffer, -1)
ClearScreen()
Render3D()
// End Post-Processing
// Render Final Output
SetRenderToScreen()
SetObjectImage(FXAA.RenderTarget, FXAA.RenderBuffer, 0)
DrawObject(FXAA.RenderTarget)
Render2DFront()
Swap() // Update Display
EndFunction