mojira.dev
MC-34751

Backface culling should not be used improperly

When stained glass was introduced, it did not have backface culling, and ice and portals also had backface culling removed. However, later this was "fixed" because of MC-34649, the result being to add backface culling to EVERY block, including water. Water is now harder to see where it is, along with not being able to see the surface of the water, making it look like you're in a waterworld.

Some of this issue is user preference, but the side that doesn't like backface culling on blocks like glass and ice not only is an aesthetic one, but also one of a visibility issue that cannot be fixed, unlike many of the issues that people who like backface culling find with the absence of it.

Backface culling will make large glass surfaces hard to see exactly where glass is when viewed from 1 direction (see 1a-3a and compare with 1b-3b). With backface culling enabled, you can only see 1 or 2 dimensions of a shape (depending on your viewing angle) and even then, this can be deceiving (compare 4a to 4b)

Partial transparency is also a nice feature. You could say "normal glass doesn't need it" because there is stained glass, however this isn't true because even normal glass has a small amount of color, based on how it was formed (such as density) and from which angle it is being viewed from. Partial transparency can also be used to simulate glare, scratches, smudges, dirt, imperfections, cracks, etc. It can allow artists to add detail that is not as much in the way as opaque pixels, and this is a way to make glass that has backfaces enabled more pleasant. What I'm saying is: normal glass should have partial transparency support. Why not allow it if there are no issues with it now and stained glass/ice have it, wasn't the issue they fixed the only reason glass didn't support it in the first place?

When stained glass was originally added, it also had a transparency issue that would not allow for you to use textures with below 50% opacity properly. The faces of the blocks blended together as well, so it was more opaque than the texture itself. Some would say backface culling fixed this, however there is no issue now, because now we could lower the opacity of the texture to compensate for this. It could be fixed in Minecraft by inversely blending the partially transparent textures before mapping them, that way when they blend on one object, the blending is the proper opacity.

Z-fighting is also not a reason to backface cull. Z-fighting a large problem in Minecraft and it needs to be approached at the source. Whether it is fixed through block logic, OpenGL functions, raytracing, or just changing how certain textures are placed/used, it needs to be dealt with.

Some people like water with backface culling because it makes flowing water on the side of most blocks invisible, but this can be fixed instead by making water sides invisible when touching solid blocks. Additionally I'm sure that this could also include glass, or even have waterfalls differ from inner water blocks in bodies of water.

Backface culling is meant to not render faces that you don't see. That is how it should be used. If you can potentially see the face, then backface culling should not be applied, otherwise the result is ugly and weird, as the texture clearly differs based on your position relative to the object. It is true that having backfaces makes it a bit harder to see through in smaller blocks, but this can be remedied with cleaner textures, especially if partial transparency can be used. On large structures having backfaces is not much of a clarity issue, but without it you may need to walk around the structure to see where it stands.

Possible solution that allows for artist's choice of backface culling or not in their packs:

The .mcmeta file:

{
  "texture": {
    "backfaces": true
  }
}

The only problem with this is that derivative textures, like the beacon glass, would either take the attribute from standard glass or not be changed at all.

another possible solution is the creation of a new .json file, maybe "backfaces.json":

{
  "backfaces": {
    "glass":false,
    "stained_glass":true,
    "beacon":true,
    "torch":true,
    "redstone_torch":true,
    "cactus":true
  }
}

That would have less issues with derivative textures, and might also allow for entities (like the ender crystal) to have backface culling removed as well. The reason things like torches and cacti are on that list is because their faces can be larger than the rectangular prism they create before they intersect, meaning that you can see where the face should be but isn't because it is culled. This is very noticeable when looking at the top of the default redstone torch (while fairly close) and walking around it.

Linked issues

Attachments

Comments 19

This sounds more like a suggestion than a bug to me...

insomniac_lemon

Before 13w41a it would have been. However, stained glass is now in the game, with now backface culling and nearly perfect partial transparency.

It's inconsistent now, because stained glass has no backface culling, while normal glass still does. Regular glass should also have partial transparency support because now it's possible, and it will allow for more artistic normal glass. More beautiful (artist-defined) regular glass AND (user-defined) stained glass.

I know it SOUNDS like a suggestion, but it's not just that. The stained glass added is MUCH more aesthetically pleasing because of new features that were not backported to regular glass. This should not be the case-stained glass and regular glass should be able to be equal as far as aesthetics, the ONLY differences should really be color, which is user-preference. The only other difference that there should be is allowing normal glass to be less opaque, which is again, up to preference (and the texture pack), but should be allowable for more subtle details (as said above) than stained glass.

@Jrdiver:
It's a clear inconsistency and should therefore be handled as an issue. The only logical step after adding Stained Glass would have been to change normal glass to support transparency too, I don't understand why the devs forgot that. Another benefit of doing this would be: Texturepacks would no longer need MCPatchers "Better Glass" mod.

Matthias Schabhüttl

When you look through stained glass you can see the back texture, but when you look through normal, transparent glass you can't.

As of 13w42a stained glass seems to have the same back face culling behavior as clear glass. However, clear glass still doesn't allow semi-transparency.

9 more comments
insomniac_lemon

Thanks guys. I knew I had to update it now that the decision has been made in the opposite direction. I get that some people like it, but backface culling really should not be used like this.

Water comparison redone. Now it has the texture issue in dirt..... heh, can't take a screenshot without another bug in it.....

Mog (Ryan Holtz)

This is a feature request, not a bug. The issue with not being able to see the surface of water from below has been resolved. Beyond that, as well-written as the bug is, it has little to no relevance to how the Minecraft engine actually works.

@Mog:
So, will there be any way to get proper looking glass and stained glass blocks (without backface culling) in the future or at least any options for resource packs? I mean, what was wrong with MC-34649? It looked great and a lot more realistic this way.

insomniac_lemon

When I first created the issue it was relevant as a feature parity between glass and stained glass.

When it was updated to increase the usage of backface culling (and without discretion, leading to the water surface), I decided to re-write the issue on why shooting backface culling at everything is not a good solution, and why resource pack makers might not want it.

As stated, it's not just about aesthetics, but also adding backface culling creates depth-perception issues, and even a-per-pack option would be nice.

So that's why I consider it a "bug", on top of the fact that it was created during the same time as the other issue that was on the other side of the issue, that was for backface culling and led to it being added to most things that didn't have it (and that was considered a "bug", without any explanation of why it was or why a change should be made).

It'd be nice even to consider it, considering this actually has a decent amount of votes, compared to the other issue that was implemented right away.

Mog (Ryan Holtz)

As much as I can appreciate a clear and well-written bug, as such things appear to be in very short supply these days, backface culling will not be turned off for stained glass and water.

In the case of the water's surface it was an actual usability issue as it was difficult to gauge your depth without a visible pattern to reference against visually. In the case of stained glass, it is a simple matter of consistency: Regular glass and stained glass does not have backface culling disabled. I do not buy the "depth perception" issue as one can clearly see the point at which the stained glass meets the ground, and the fact that the stained glass texture and the block texture on which it rests will be the same size is a perfectly acceptable visual cue.

To head off any potential re-filings, it could also be argued that the consistency issue can be resolved by disabling backface culling on regular glass as well, but that would be too "busy" visually, and would also not be consistent with the Minecraft look-and-feel in general. Yes, it would be a simple change, but a change being easy to make is not a priori justification itself for the change. Indeed, the change being easy to make is more a point in favor of it being done via a mod or eventually through the plugin API rather than in favor of it being done in vanilla.

insomniac_lemon

migrated

Unconfirmed

glass, transparency

Minecraft 13w41a, Minecraft 13w41b, Minecraft 13w42a, Minecraft 1.7, Minecraft 1.7.1, Minecraft 1.7.2

Retrieved