Description
If you run Minecraft on a Mac, you've probably noticed that things in the distance look horrible! Clouds look stair-stepped, snow tears into the block beneath it, torches pop in and out of walls, and so on. This is because by default on a Mac, Minecraft uses an 8-bit depth buffer.
When rendering a 3D scene, the depth buffer stores the distance from the eye point to each pixel in the scene. If a new pixel (called a fragment) is rendered that is further away than an existing fragment at the same location on the screen, it is thrown out. This is why you can't see every block on the map at once, even though they're all rendered. An 8-bit depth buffer only allows for 256 levels of distance--not a lot. As a result, fragments in the distance get rounded to the same depth value, even though one may actually be in front of the other. When multiple fragments share the same depth value, the most recently rendered one is the one you see, even if it's not actually the "frontmost" in the scene. This is why you see parts of objects show through in front of the things they're behind.
This mod increases the size of the depth buffer to 32-bits per pixel, resulting in dramatically improved image quality. It only changes one line of code. I tweeted @notch several times asking him to make the simple change, but he hasn't yet. If you want to help encourage Notch to make the change, you can retweet my tweet.
Compare the difference in quality between the two images below. If you see the glitches shown in the first image, this mod is for you.
The fix you've posted works exactly as described, and makes Minecraft playable once more on a Mac! I've been using Boot Camp to play under windows, just because it's been such an ugly mess.
HOWEVER (there's always a BUT) I ALSO love to use custom texture-packs (Dokucraft is my current favourite!) and when using this mod, MCPatcher won't accept the minecraft.jar as being valid.
So as best I can tell, this fix works, but means that no custom texture packs (other than x16 packs) will work.
I'm not sure if there's anything you can do about this, or whether it's something MCPatcher would need to address, but I thought it was worth mentioning. Maybe you already have a solution?
Otherwise, great job - I'll be going back to Windows because I love the look of Dokucraft - but hopefully Notch fixes the z-buffer issue in the 1.6 update.
Actually this can happen on a pc too (ex: my computer), but thanks for the fix! would it add a FPS boost too, or would it just change the depth buffer?
Hey now that Beta 1.6 has come around the fix doesn't seem to work anymore. When I install it I get a black screen after logging in. I guess they changed something in the minecraft.class file?
The alternative to this patch is to use a patched version of lwjgl which sets a 32bit depth buffer. This means that point releases will still work, only if Mojang upgrade the lwjgl library will the fix stop working.
Great job + 1 for you! I can now look at my snowy fields without wanting to tear my eyes out.
Rollback Post to RevisionRollBack
If, by some freak chance the usual nonsense I generate seems to help you, there's a nice shiny green + button to tell me that I'm doing the right thing
Description
If you run Minecraft on a Mac, you've probably noticed that things in the distance look horrible! Clouds look stair-stepped, snow tears into the block beneath it, torches pop in and out of walls, and so on. This is because by default on a Mac, Minecraft uses an 8-bit depth buffer.
When rendering a 3D scene, the depth buffer stores the distance from the eye point to each pixel in the scene. If a new pixel (called a fragment) is rendered that is further away than an existing fragment at the same location on the screen, it is thrown out. This is why you can't see every block on the map at once, even though they're all rendered. An 8-bit depth buffer only allows for 256 levels of distance--not a lot. As a result, fragments in the distance get rounded to the same depth value, even though one may actually be in front of the other. When multiple fragments share the same depth value, the most recently rendered one is the one you see, even if it's not actually the "frontmost" in the scene. This is why you see parts of objects show through in front of the things they're behind.
This mod increases the size of the depth buffer to 32-bits per pixel, resulting in dramatically improved image quality. It only changes one line of code. I tweeted @notch several times asking him to make the simple change, but he hasn't yet. If you want to help encourage Notch to make the change, you can retweet my tweet.
Compare the difference in quality between the two images below. If you see the glitches shown in the first image, this mod is for you.
Minecraft with 8-Bit Depth Buffer
Minecraft with 32-Bit Depth Buffer
Download for 1.7.3
Minecraft.class
Download for 1.7.2
Minecraft.class
Download for 1.6.6
Minecraft.class
Download for 1.5._01
Minecraft.class
Installation
To install the mod, replace net/minecraft/client/Minecraft.class inside of minecraft.jar with the downloaded file.
The fix you've posted works exactly as described, and makes Minecraft playable once more on a Mac! I've been using Boot Camp to play under windows, just because it's been such an ugly mess.
HOWEVER (there's always a BUT) I ALSO love to use custom texture-packs (Dokucraft is my current favourite!) and when using this mod, MCPatcher won't accept the minecraft.jar as being valid.
So as best I can tell, this fix works, but means that no custom texture packs (other than x16 packs) will work.
I'm not sure if there's anything you can do about this, or whether it's something MCPatcher would need to address, but I thought it was worth mentioning. Maybe you already have a solution?
Otherwise, great job - I'll be going back to Windows because I love the look of Dokucraft - but hopefully Notch fixes the z-buffer issue in the 1.6 update.
Cheers,
WJ.
(PS: I re-tweeted your suggestion.)
http://anyhub.net/file/2Zp4-depthbufferfix-1.6.5.zip
I used MCP to make the change Amitofu made, and it seems to work for me.
http://anyhub.net/file/31D8-depthbufferfix-patcher-1.6.6_1.zip
To use it,
./patch.sh
The .class file is inside the zip; I thought it would be easier for people if there was a script to patch the minecraft.jar file for them.
A Pattern Language for Minecraft
Minecraft Facts: A Sources Thread
http://getsatisfaction.com/mojang/topics/severe_z_buffer_fighting_on_os_x
Further down in that thread you will find a patched lwjgl library by David Schroeder: http://www.mediafire.com/?a1p5kwyqn1m0ked
This works for me on the Mac.
I understand this is a long shot, but I was wondering if you still had the Minecraft.class files available? It seems the links are no longer active.
I have been playing old Beta versions of MC on my Mac and the jagged clouds and distant terrain glitches are a little annoying.
Thanks!