Enabling Supersampling


I’m trying to enable supersampling for each fragment, however, I’m unsure how. I have read https://www.opengl.org/registry/specs/ARB/texture_multisample.txt but I couldn’t find an explanation. At the moment I accomplish it with a terrible hack, nameley by making a sample position query in the fragement shader program:

colorOut = ... * + vec4(gl_SampleID) * 0.001

Without that the supersampling only occurs at the edges, having both GL_SAMPLE_SHADING_ARB and GL_MULTISAMPLE enabled.

I hope someone can help me. Thanks.