Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>They are several. The usual one is to check is the current's coordinates (gl_FragCoord) are (0.5, 0.5). If it is, it means that you're in the middle of a polygon : it's sampled only once.</p> <p>It it's not, it's probably one of the 4 (for 4xMSAA) rotated-square-corners : You're on an edge, and openGL has detected that one sample only isn't enough.</p> <p>See also <a href="http://www.opengl.org/pipeline/article/vol003_6/" rel="nofollow noreferrer">http://www.opengl.org/pipeline/article/vol003_6/</a></p> <p>In order to have this information in a second pass, you'll have to store it in a g-buffer, though.</p> <p>EDIT : Here is a code snippet that I've just done. Tested on gtx 470 with a 1024x1024 4xMSAA texture.</p> <p>Vertex shader : </p> <pre><code> #version 400 core uniform mat4 MVP; noperspective centroid out vec2 posCentroid; layout(location = 0) in vec4 Position; void main(){ gl_Position = MVP * Position; posCentroid = (gl_Position.xy / gl_Position.w)*512; // there is a factor two compared to 1024 because normalized coordinates have range [-1,1], not [0,1] } </code></pre> <p>Fragment shader : </p> <pre><code>#version 400 core out vec4 color; noperspective centroid in vec2 posCentroid; void main() { if (abs(fract(posCentroid.x) - 0.5) &lt; 0.01 &amp;&amp; abs(fract(posCentroid.y) - 0.5) &lt; 0.01){ color = vec4(1,0,0,0); }else{ color = vec4(0,1,0,0); } } </code></pre> <p>Edges are green, center of polygon is red.</p> <p>For your original question, I recommend you this article : <a href="http://www.gamasutra.com/view/feature/3591/resolve_your_resolves.php" rel="nofollow noreferrer">http://www.gamasutra.com/view/feature/3591/resolve_your_resolves.php</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload