Skip to content

Commit

Permalink
Remove the floor from vpos calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
flibitijibibo committed Aug 14, 2019
1 parent ffe145c commit 810c038
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion profiles/mojoshader_profile_glsl.c
Expand Up @@ -1037,9 +1037,10 @@ void emit_GLSL_attribute(Context *ctx, RegisterType regtype, int regnum,
} // if
else if (mt == MISCTYPE_TYPE_POSITION)
{
// TODO: For half-pixel offset compensation, floor() this value!
push_output(ctx, &ctx->globals);
output_line(ctx, "uniform vec2 vposFlip;");
output_line(ctx, "vec4 %s = floor(vec4(gl_FragCoord.x, (gl_FragCoord.y * vposFlip.x) + vposFlip.y, gl_FragCoord.z, gl_FragCoord.w));", var);
output_line(ctx, "vec4 %s = vec4(gl_FragCoord.x, (gl_FragCoord.y * vposFlip.x) + vposFlip.y, gl_FragCoord.z, gl_FragCoord.w);", var);
pop_output(ctx);
return;
} // else if
Expand Down

0 comments on commit 810c038

Please sign in to comment.