Enabling anti-aliasing
In this tutorial we are going to have a look at how to enable anti-aliasing (AA) when using a renderer.
Contents
Via renderer
When a renderer's UseAppSurface
property is set to true
, you can control the size of the application surface
using the RenderScale
property. This is a scaling factor of the application surface. If you set this
value to 2 for example, then the application surface will be two times larger
than the window and downscaled when rendered onto the screen. This way you will
effectively get 2xAA. Please note that doing AA this way can have a heavy impact
on your game's performance!
/// @desc Create event
renderer = new BBMOD_DefaultRenderer();
renderer.UseAppSurface = true;
renderer.RenderScale = 2;
Tip: The
RenderScale
property can be also used to render your game at a lower resolution than the window size and then upscale it, which can boost performance. E.g. withRenderScale
equal to 0.5 your game will be rendered at half resolution.
Via post-processor
Another way to add AA is using a post-processor, by simply adding the BBMOD_FXAAEffect to it:
/// @desc Create event
renderer = new BBMOD_DefaultRenderer();
renderer.UseAppSurface = true;
postProcessor = new BBMOD_PostProcessor();
postProcessor.add_effect(new BBMOD_FXAAEffect());
renderer.PostProcessor = postProcessor;