PDA

View Full Version : Multisampling Sample Positions > 4



Christoph.LGDV
03-22-2017, 12:57 AM
Hi,

this is a basic question which requires some indepth knowledge.


I want to query the sample positions of a 16x MSTexture. Simple enough:

for(i : 16)
glGetMultisamplefv(GL_SAMPLE_POSITION, i, (GLfloat*)&samplingPoints[i][0]);

However, I notice that only the first 4 positions are non 0 and show the rotateted 2x2 pattern:

0.375000, 0.125000
0.875000, 0.375000
0.125000, 0.625000
0.625000, 0.875000


What about the other 12.
I have been told that msaa uses super sampling beyond that but is there some definitive documentation.
Also, how will fragment coordinates behave?


Edit:

This is the sampling pattern in the fragment shader when using per sample shading, written to ssbo from shader:

0 0.062500, 0.000000
1 0.250000, 0.125000
2 0.187500, 0.375000
3 0.437500, 0.312500
4 0.500000, 0.062500
5 0.687500, 0.187500
6 0.750000, 0.437500
7 0.937500, 0.250000
8 0.000000, 0.500000
9 0.312500, 0.625000
10 0.125000, 0.750000
11 0.375000, 0.875000
12 0.562500, 0.562500
13 0.812500, 0.687500
14 0.625000, 0.812500
15 0.875000, 0.937500

Why do they differ from the actual point query?

Also: Which Sequence produces these coordinates?


Best regards,
Christoph

GClements
03-22-2017, 03:59 AM
Is the correct framebuffer bound at the point that you perform the query? Have you checked the value of glGetIntegerv(GL_SAMPLES)?

Christoph.LGDV
03-22-2017, 07:09 AM
You are right of course.

I have become so used to the new GL4.5 syntax using named calls, that I forgot to think.

Interesting though, that such a call without bound framebuffer produces such half assed output.
It was probably the default framebuffer sporting 2x2 ms.

Ok, another question for the stupid folder.