Skip to content

Improve glass pane rendering#270

Open
Majora320 wants to merge 10 commits into
GTNewHorizons:masterfrom
Majora320:fix-glass
Open

Improve glass pane rendering#270
Majora320 wants to merge 10 commits into
GTNewHorizons:masterfrom
Majora320:fix-glass

Conversation

@Majora320
Copy link
Copy Markdown

@Majora320 Majora320 commented Apr 3, 2026

Currently the rendering for the clear glass and stained glass panes is somewhat broken, displaying unwanted vertical lines when viewed from certain angles. Stained glass rendering & connectivity is also not optimal. This commit implements custom glass rendering based off of Vanilla that should be an improvement and allow for artifact-free clear glass panes in builds.

Fixes #267

Before:
2026-04-03_16 09 40
After:
2026-04-03_16 10 25

Fixes rendering for both clear and stained glass panes, and cleans up
some older code. This commit is missing textures for the tops and
bottoms of the stained panes.
@Majora320
Copy link
Copy Markdown
Author

Majora320 commented Apr 3, 2026

Fixes #267

@Dream-Master Dream-Master added the 🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta label May 9, 2026
@DarkShadow44
Copy link
Copy Markdown

That doesn't look correct here:

2026-05-23_00 20 42

public class GlassBlockConnected extends MantleBlock {

protected IIcon[] icons = new IIcon[16];
private final boolean shouldRenderSelectionBox = true;
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could probably be removed

@DarkShadow44
Copy link
Copy Markdown

The panes don't really look good in an inventory, any specific reason you removed the 3d look?

Copy link
Copy Markdown

@Luca-Guettinger Luca-Guettinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 nits. (I only looked at the code, not ingame for now)

boolean flag1 = pane.canPaneConnectTo(world, x, y, z, WEST);
boolean flag2 = pane.canPaneConnectTo(world, x, y, z, SOUTH);
boolean flag3 = pane.canPaneConnectTo(world, x, y, z, NORTH);
tessellator.setColorOpaque_F(multR, multG, multB);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Color is set once for all faces. The old renderer used renderStandardBlock which applies vanilla per-face darkening (0.5 bottom, 0.6 east/west, 0.8 north/south, 1.0 top). Without those multipliers the pane looks uniformly lit. Probably fine for clear glass, but stained pane frames might look flat compared to adjacent blocks.

@Override
@SideOnly(Side.CLIENT)
public IIcon getIcon(int side, int meta) {
return icons[meta][0];
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No bounds check on meta here, unlike the IBlockAccess getIcon variant at line 37. Same for getTopIcon/getBottomIcon. Invalid meta from /give or JEI would AIOOBE.

}
} else {
for (int i = xzuv.length - 4; i >= 0; i -= 4) {
tessellator.addVertexWithUV(xzuv[i], y - 0, xzuv[i + 1], xzuv[i + 2], xzuv[i + 3]);
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

y - 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🚧 Testing on Zeta Do not merge yet, testing this PR on Zeta

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Clear Glass doesn't Connect Properly

6 participants