beyond-all-reason / spring

A powerful free cross-platform RTS game engine
https://beyond-all-reason.github.io/spring/
Other
222 stars 102 forks source link

Add sample shading for MSAA (better quality) #1765

Closed bcdrme closed 1 week ago

bcdrme commented 1 week ago

Adds sample shading (needs MSAA to be enabled).

https://registry.khronos.org/OpenGL/extensions/ARB/ARB_sample_shading.txt https://registry.khronos.org/OpenGL-Refpages/gl4/html/glMinSampleShading.xhtml

Add this to your springsettings.cfg

MSAA = 1
MSAALevel = 4
MinSampleShadingRate = 1.0

You should immediately notice a lot smoother AA, particularly visible on UI elements.

Best quality observed with MSAA x4 and minSampleShadingRate to 1.0 MSAA x8 is ridiculously expensive for no perceived added value on my rig.

lhog commented 1 week ago

Interesting change... Let's switch to a single parameter SuperSamplingRate (default 0.0f). If it's greater than zero, you execute: https://github.com/beyond-all-reason/spring/pull/1765/files#diff-cffcc39c88c29dc1a956ce68ef42e69dd03ba3ccdfa47d4853cbbdc7e5a2cca2R1668-R1671

bcdrme commented 1 week ago

Interesting change... Let's switch to a single parameter SuperSamplingRate (default 0.0f). If it's greater than zero, you execute: https://github.com/beyond-all-reason/spring/pull/1765/files#diff-cffcc39c88c29dc1a956ce68ef42e69dd03ba3ccdfa47d4853cbbdc7e5a2cca2R1668-R1671

So instead of inventing our own name for the thing I went with MinSampleShadingRate. Single parameter, default 0.0f.