Jump to content

[1.7.10] Depth Test issues.


Adam8234

Recommended Posts

I'm rendering two faces one is opaque, and the other is transparent. Enabling Blending would not fix this issue, because its not the issue I'm having.

 

When a vertex is rendered, it's added to the depth buffer, no problems. Until I want to render faces right on top one another.

 

The problem I'm having is similar to this:

vNjf2Kr.png

It's much more dramatic with the camera moving.

 

Okay, to start off, In the ISBRH, I render the first layer, and so on. This is no problem when you're calling RenderBlocks.renderFaceXXXX and RenderBlocks.renderStanardBlock  but when you start rendering with the same vertices's and positions it produces an image that is similar to above (left). So the first thing I do is disable the depth testing, which works, and produces the image I want (right), but it brings the face to the front, making the face visible through blocks. Which is the intended effect of disabling the depth testing. Turning off the depth mask on the first layer causes other world blocks to render over top because the vertices's aren't being added to the buffer. Is there any way to get this intended result without having offsets?

 

I know the simple solution is to render all faces with a small offset, but that produces seams on the edges of the block, which isn't what I really want, but if this sorta thing is not possible I can do.

 

Thanks and I hope you can help,

 

Adam

 

EDIT:

In renderWorldBlock in a ISBRH it's bad to call draw and startDrawing for the tessellator. I was doing this to do most of what I explained above. This doesn't mean the issue is no longer present. Still having the same issue. To explain more, I've made a "FakeWorldRenderer" which renders some connected texture. It adds vertices, in four corners of the block. Rendering this with no layers causes no issues with depth testing with one another. I did some debugging found out the coords of the faces compared to if it was using the normal RenderBlocks, it's the same. I don't know why this would be happening at all if the faces are engendered in the same position.

Link to comment
Share on other sites

Hi Adam

 

To the best of my knowledge there really is no magic fix for this, using a small offset is the only robust way to solve it.  You can make the offset very small so any seam should be unnoticeable; alternatively in the example you showed, it should be possible to offset one of the faces forward without visible seams at the block edges. 

 

-TGG

Link to comment
Share on other sites

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.