MxEngine icon indicating copy to clipboard operation
MxEngine copied to clipboard

Issue: Bad antialiasing algorithm

Open WhiteBlackGoose opened this issue 4 years ago • 5 comments

image image

🦆

WhiteBlackGoose avatar Feb 17 '21 17:02 WhiteBlackGoose

hi can you please me in this ,actually I am not getting this issue

anishsingh935 avatar Apr 28 '21 06:04 anishsingh935

Hey. If you look at the green stripe, you can notice sharp dots/pixels, which should be smoother

WhiteBlackGoose avatar Apr 28 '21 07:04 WhiteBlackGoose

To make it clear what we have in engine for now: изображение no antialiasing algorithm enabled - sharp edges изображение FXAA enabled - too blurry textures

MomoDeve avatar Apr 28 '21 08:04 MomoDeve

There is also a third option (which is actually the best) - use SSAA by manually increasing camera render texture. It is not implemented in engine as separate method, but can be coded in just a few lines:

Event::AddEventListener<WindowResizeEvent>("CameraSSAA",
    [controller](WindowResizeEvent& e) mutable
    {
        constexpr size_t scaleSSAA = 2;
        controller->ResizeRenderTexture(e.New.x * scaleSSAA, e.New.y * scaleSSAA);
    });
// comment the line below in your code, as it resizes render texture to window size
// controller->ListenWindowResizeEvent();

изображение SSAA 2x enabled - much less visible deffects. It is quite a good antialiasing algorithm, but it requires much more pixel processing power, so I can not recommend using it for fullscreen applications.

MomoDeve avatar Apr 28 '21 08:04 MomoDeve

Hey. If you look at the green stripe, you can notice sharp dots/pixels, which should be smoother

OK I understood thanks

anishsingh935 avatar Apr 30 '21 14:04 anishsingh935