mirror of
https://github.com/luanti-org/luanti.git
synced 2025-11-19 08:05:20 +01:00
29 lines
661 B
GLSL
29 lines
661 B
GLSL
#version 100
|
|
|
|
/* Attributes */
|
|
|
|
attribute vec4 inVertexPosition;
|
|
attribute vec4 inVertexColor;
|
|
attribute vec2 inTexCoord0;
|
|
|
|
/* Uniforms */
|
|
|
|
uniform float uThickness;
|
|
uniform mat4 uProjection;
|
|
|
|
/* Varyings */
|
|
|
|
varying vec2 vTextureCoord;
|
|
varying vec4 vVertexColor;
|
|
|
|
void main()
|
|
{
|
|
// 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;
|
|
}
|