1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2025-08-26 15:32:17 +00:00

Fix z-fighting on bold printout borders.

- Changed page background to render as one quad, instead of two halves.
- Set page background to a z-offset that is between zeroth (potentially
bold border) and subsequent background pages. Bold borders were at the
same z-offset before.
This commit is contained in:
Toad-Dev 2022-01-20 15:36:46 -08:00
parent 883ac717d8
commit fc57d0a7e5

View File

@ -116,8 +116,12 @@ public final class PrintoutRenderer
}
}
// Left half
drawTexture( transform, buffer, x, y, z, X_FOLD_SIZE * 2, 0, X_SIZE / 2.0f, Y_SIZE, light );
// Current page background
// z-offset is interleaved between the "zeroth" left/right page and the first left/right page, so that the
// "bold" border can be drawn over the edge where appropriate.
drawTexture( transform, buffer, x, y, z - 1e-3f * 0.5f, X_FOLD_SIZE * 2, 0, X_SIZE, Y_SIZE, light );
// Left pages
for( int n = 0; n <= leftPages; n++ )
{
drawTexture( transform, buffer,
@ -128,8 +132,7 @@ public final class PrintoutRenderer
);
}
// Right half
drawTexture( transform, buffer, x + X_SIZE / 2.0f, y, z, X_FOLD_SIZE * 2 + X_SIZE / 2.0f, 0, X_SIZE / 2.0f, Y_SIZE, light );
// Right pages
for( int n = 0; n <= rightPages; n++ )
{
drawTexture( transform, buffer,