SasMaster
07-29-2012, 01:54 AM
Hi All. I am trying to understand different methods of MSAA in GL 4.0 (CORE) I started with GL 3.3 and used the book "OpenGL Superbible 5" as a primary reference to modern pipeline.In the app I have been working on I needed to implement MSAA manuall because I use FBOs for offscreen rendering.The approach outlined in SB5 looks complex where the sample weights are calculated on CPU then passed to shaders and used by texelFetch . But then I took a look into GL 4.0 specs and found a new "Adaptive multisampling and per-sample processing" technique exposed via GL_ARB_sample_shading. It looks really simple to implement :Just enable multisampling , attach mulitsample texture to the FBO ,then in fragment shader
use interpolateAtSample + gl_sampleID . Apparently it looks like this approach does the job.But I would like to know if this is how the optimal MSAA should be done in GL 4.0 ?
use interpolateAtSample + gl_sampleID . Apparently it looks like this approach does the job.But I would like to know if this is how the optimal MSAA should be done in GL 4.0 ?