Skip to content

Commit

Permalink
Screen('DrawDots'): Only apply a margin to non-square dot types.
Browse files Browse the repository at this point in the history
Only round dots get trimmed in the fragment shader, and so dot_type=4
was left with too much padding from the vertex shader.
  • Loading branch information
aforren1 committed Jun 11, 2024
1 parent 5c919e9 commit 1e425bf
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PsychSourceGL/Source/Common/Screen/SCREENDrawDots.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ char PointSmoothVertexShaderSrc[] =
"/* delivers individual point size (diameter) information for each point. */ \n"
"\n"
"uniform int useUnclampedFragColor;\n"
"uniform int drawRoundDots;\n"
"varying float pointSize;\n"
"varying vec4 unclampedFragColor;\n"
"\n"
Expand All @@ -111,7 +112,9 @@ char PointSmoothVertexShaderSrc[] =
" /* Point size comes via texture coordinate set 2: Make diameter 2 pixels bigger */\n"
" /* than requested, to have some 1 pixel security margin around the dot, to avoid */\n"
" /* cutoff artifacts for the rendered point-sprite quad. Compensate in frag-shader. */\n"
" pointSize = gl_MultiTexCoord2[0] + 2.0;\n"
" /* Only apply the margin to round dots. */\n"
" float margin = drawRoundDots > 0 ? 2.0 : 0.0;\n"
" pointSize = gl_MultiTexCoord2[0] + margin;\n"
" gl_PointSize = pointSize;\n"
"}\n\0";

Expand Down

0 comments on commit 1e425bf

Please sign in to comment.