1
0
mirror of https://github.com/SquidDev-CC/CC-Tweaked synced 2024-06-25 22:53:22 +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 committed by Jonathan Coates
parent d967730085
commit 51c3a9d8af
No known key found for this signature in database
GPG Key ID: B9E431FF07C98D06

View File

@ -115,8 +115,11 @@ public static void drawBorder( Matrix4f transform, IRenderTypeBuffer renderer, f
}
}
// 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,
@ -127,8 +130,7 @@ public static void drawBorder( Matrix4f transform, IRenderTypeBuffer renderer, f
);
}
// 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,