Client - don't draw unnecessary vertices. #99
Loading…
x
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Currently, the client renders all vertices of all faces (example here, with all blocks being drawn at half extent to make the overdraw visible):

There are two main ways you can reduce this:
For solid blocks
(There are some corner cases. For example, cactus would only be true for Y positive and Y negative)
For transparent and transluscent blocks, you can do this:
2) Add a 'CanShareWithNeighbours(Face...' method to BlockProvider. You can skip drawing a face when a block and its neighbour are the same type. (e.g. for glass, water)
(Note that water is a bit trickier - for horizontal neighbours, you have to make sure that they have the same height and shape)
We already half do this. The chunk renderer only creates meshes for blocks that neighbor transparent blocks. You're suggesting to extend this to even omit faces that do not neighbor transparent blocks? It's a good idea but will be complicated to implement.
Yeah, good call.
Maybe I didn't clarify enough. You can see above that the client is drawing the underlying stone and dirt - even when they are all hidden anyways.
In that screenshot, all of that dirt/stone is surrounded by air blocks and has to be drawn. I'm definitely missing something here.
Sorry I didn't make that clear in the screenshot.
I'd changed the 'CreateUniformCube' mesh size from 0.5 to 0.25 to show that the blocks are being drawn, even though they are normally completely hidden.
Oh, I understand. I thought the actual world had the spaces in it. This is definitely a bug, then. This code is meant to collect a list of coordinates that neighbor transparent blocks, and this code renders only those coordinates. Are you using the most up to date client? If so, then this is definitely a bug.
Yeah, I've confirmed the bug for myself now. Investigating.
That always adds coordinates for opaque blocks though?
Yeah, found and fixed the error. I'll push up a commit shortly.
Thanks for pointing out that mistake, @UnknownShadow200, performance is much better with that bug fixed.