1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 04:27:45 +00:00

LibSoftGPU: Implement 5 bits of subpixel precision

This snaps vertices to 1/32 of a pixel before rasterization resulting
in smoother movement and less floaty appearance of moving triangles.

This also reduces the severity of the artifacts in the glquake port.

5 bits should allow up to 1024x1024 render targets. Anything larger
needs a different implementation.
This commit is contained in:
Stephan Unverwerth 2021-12-30 18:40:20 +01:00 committed by Andreas Kling
parent c00014fa54
commit 8ae3eb6c33
2 changed files with 15 additions and 12 deletions

View file

@ -17,6 +17,7 @@ namespace SoftGPU {
static constexpr bool ENABLE_STATISTICS_OVERLAY = false;
static constexpr int RASTERIZER_BLOCK_SIZE = 8;
static constexpr int NUM_SAMPLERS = 32;
static constexpr int SUBPIXEL_BITS = 5;
// See: https://www.khronos.org/opengl/wiki/Common_Mistakes#Texture_edge_color_problem
// FIXME: make this dynamically configurable through ConfigServer