Improve glass pane rendering#270
Open
Majora320 wants to merge 10 commits into
Open
Conversation
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.
Author
|
Fixes #267 |
| public class GlassBlockConnected extends MantleBlock { | ||
|
|
||
| protected IIcon[] icons = new IIcon[16]; | ||
| private final boolean shouldRenderSelectionBox = true; |
|
The panes don't really look good in an inventory, any specific reason you removed the 3d look? |
| 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); |
There was a problem hiding this comment.
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]; |
There was a problem hiding this comment.
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]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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:


After: