mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-18 23:55:26 +01:00
OpenGL3: Add subpixel offset for 2D rendering (#16676)
This commit is contained in:
@@ -18,7 +18,10 @@ varying vec4 vVertexColor;
|
||||
|
||||
void main()
|
||||
{
|
||||
gl_Position = uProjection * inVertexPosition;
|
||||
// Subpixel offset to render pixel-perfect 2D images
|
||||
// This is a compromise that is expected to work well on most drivers.
|
||||
// Explanation: https://jvm-gaming.org/t/pixel-perfect-rendering-in-2d/26261/4
|
||||
gl_Position = uProjection * (inVertexPosition + vec4(0.375, 0.375, 0.0, 0.0));
|
||||
gl_PointSize = uThickness;
|
||||
vTextureCoord = inTexCoord0;
|
||||
vVertexColor = inVertexColor.bgra;
|
||||
|
||||
Reference in New Issue
Block a user