Posted February 18, 20178 yr I have a block model that renders an overlay onto the block beside it. The overlay functions perfectly when both block blocks are in the same chunk, but when one of the blocks is in another chunk as the first one then the overlay and the block start to z-fight. Here's an image of what I'm talking about: The black block renders the overlay onto the cobblestone block to the left of it. As you can see when both blocks are in the same chunk they're fine, but when they're in different chunks the cobblestone z-fights the overlay. I think the reason this happens is because each chunk is drawn separately, and two quads in the same draw won't z-fight. But when a quad from one draw is in the same position as a quad from another draw then they z-fight. Is this theory correct? And if it is, is there a way to solve this? Edited February 19, 20178 yr by Silly511
February 18, 20178 yr That's because each chunk is baked down to a single 3D object and rendered. The z-fighting doesn't occur because the overlay and the cobblestone are in the same mesh and it gets simplified to remove unneeded faces. But when you render across a chunk boundary, both faces exist in the same space and OpenGL has to render both of them, but can't z-sort them. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 18, 20178 yr Author 47 minutes ago, Draco18s said: That's because each chunk is baked down to a single 3D object and rendered. The z-fighting doesn't occur because the overlay and the cobblestone are in the same mesh and it gets simplified to remove unneeded faces. But when you render across a chunk boundary, both faces exist in the same space and OpenGL has to render both of them, but can't z-sort them. Ok that makes sense. So there really isn't a good way to solve this?
February 19, 20178 yr offset the overlay from the block position by a tiny amount. 0.001 is sufficient. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
February 19, 20178 yr Author Thank you that worked. I was trying to avoid offsetting it a bit because I thought if you looked at the model top-down you could see a tiny gap, but you really can't see anything at all. Edited February 19, 20178 yr by Silly511
February 19, 20178 yr Nope, the distance is too tiny. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.