DaemonEngine / Daemon

The Dæmon game engine. With some bits of ioq3 and XreaL.
https://unvanquished.net
BSD 3-Clause "New" or "Revised" License
298 stars 61 forks source link

MSAA antialiasing is not implemented #532

Open illwieckz opened 2 years ago

illwieckz commented 2 years ago

It was disabled when moving to OpenGL core profile in 2016, see f3705e57cd6b06aa7ce176be207840ab3270eda4

When I re-enable it I don't get it working anyway, even with compatibility profile.

illwieckz commented 2 years ago

I don't mind not implementing MSAA if FXAA is fixed (see #533).

illwieckz commented 2 years ago

Related cvar to enable the feature: r_ext_multisample (integer, takes value 0, 2, 4, 8, 16), vid_restart has to be called. See also Video tab in Graphics options (tweak MSAA related option and then click Apply button).

I don't know if that should be working outside of rendering of maps, so better load a map and see at edges of a corner in the map. The aliasing should look altered (I don't know how).

The cvar looks to currently be orphaned.

illwieckz commented 2 years ago

Long time ago the code was doing that:

int samples = std::max( 0, r_ext_multisample->integer );
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLEBUFFERS, samples ? 1 : 0 );
SDL_GL_SetAttribute( SDL_GL_MULTISAMPLESAMPLES, samples );

before doing that:

SDL_GL_CreateContext( window );

I see no difference on rendered scene if I do that again.

illwieckz commented 1 year ago

There may be documentation to implement it on https://learnopengl.com/Advanced-OpenGL/Anti-Aliasing

and https://learnopengl.com/code_viewer_gh.php?code=src/4.advanced_opengl/11.2.anti_aliasing_offscreen/anti_aliasing_offscreen.cpp

I made a quick try but failed.

Anyway, if we fix FXAA, we may decide to never implement MSAA:

Currently we don't have any working anti-aliasing method, MSAA isn't implemented and FXAA does nothing.

illwieckz commented 1 year ago

If we decide to implement MSAA one day, we may want to name the cvar r_MSAA like we have r_FXAA, and never mind about the old r_ext_multisample cvar.

DolceTriade commented 1 year ago

Worst case, we can use GPU based overrides like in nvidia-settings?