BuildCraft|Core

BuildCraft|Core

7M Downloads

4.0.1 pipe rendering

darkager opened this issue ยท 8 comments

commented

The surface of a pipe that is touching a block doesn't render properly (renders 100% transparent). If you break the block that it's flush against, the pipe then renders appropriately. Even if the pipe doesn't render, it DOES still function appropriately. Here are some examples:

Pipe coming through a hole (flush against a block on 4 sides)
(1)
image

(2)
image

Pipe coming through same hole, with one block next to it removed, thus making it render that side.
image

Pipe with 2 surfaces exposed:
image

BC version 4.0.1

commented

This can be closed now, right?

commented

Correct me if I'm wrong, but with the change that ItsMeElConquistador implemented, doesn't that just force all sides of the pipe to always render?
There's a noticeable performance issue with large pipe networks, even when the pipes aren't supposed to be in relative view. Essentially, if the chunk is loaded, the pipe surface is rendered.

commented

I don't think there is a real performance issue because of this, because vanilla has some more checks than just shouldSideBeRendered. But you can look into solving this problem.

commented

This issue was caused by commit 0ae4035 but it doesn't make sense why...

As for the performance hit, it's not noticeable on servers with small/no pipe networks. However, with a larger pipe network, the performance hit is very noticeable by compiling with/without the change. I wish it wasn't a problem :(

commented

I will take a look at improving my code, could you maybe send me a world with a lot of pipes?

commented

a filler is an excelent way to create a world with lots of pipes.

commented

I don't think there is a way to improve performance issues without causing rendering glitches like (issue #1111).
Because either all sides should be rendered or none if there are no sides visible (pipe encased in solid blocks).

commented

There is. I found the solution. Forgive my ignorance on how to integrate github with all this (I copy the sources manually. I don't have a problem with it, only when implementing an update do I run into this problem, which I NEVER intended to do).

ItsMeElConquistador, if you comment out your implemented change, then in common/buildcraft/transport/renderer/PipeWorldRenderer.java, line 178 (before "renderblocks.setRenderBounds(etc..)) add:

block.setBlockBounds(minSize, minSize, minSize, maxSize, maxSize, maxSize);

For the most part, it was all redundant code. However, this line was removed as part of the commit that I referenced, done by CovertJaguar. the block.setBlockBounds sets the surface boundary of the pipe to the render dimensions. With this gone, the engine thinks it's the size of a normal block and thinks it's flush against a neighboring block, thus doesn't render that side, even though it doesn't necessarily touch.