BC 7.2.5: Rendering of fuel tanks is buggy
rapus95 opened this issue · 12 comments
As you can see that the fuel "overlays" the tank texture (that's probably why the empty tank just renders fine)
My setup uses Optifine (in the pictures using default settings, thus most advanced stuff disabled)
Can this be fixed in the mods code (since both fuel and tank are part of buildcraft) or is this error only depending on the render pipeline (depth test etc) and thus a minecraft problem?
- Does this happen without Optifine?
- Does this happen if you get closer?
Am 11.04.2016 um 11:51 schrieb Aaron [email protected]:
As you can see that the fuel "overlays" the tank texture (that's probably why the empty tank just renders fine)
My setup uses Optifine (in the pictures using default settings, thus most advanced stuff disabled)Can this be fixed in the mods code (since both fuel and tank are part of buildcraft) or is this error only depending on the render pipeline and thus a minecraft problem?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
Yes, it happens w/o optifine too.
It stops flickering (and looking buggy) at a distance of ~10 blocks (when facing front)
I think the ε value needs to be bigger.
Am 11.04.2016 um 12:18 schrieb Aaron [email protected]:
Yes, it happens w/o optifine too.
It stops flickering (and looking buggy) at a distance of ~10 blocks (when facing front)
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
Or dynamic depending on the player distance but I don't know how hard it would be to do.
Yes ;)
Am 11.04.2016 um 12:27 schrieb Aaron [email protected]:
well i assume i got it: the amount the fuel block is smaller than the tank block?
—
You are receiving this because you commented.
Reply to this email directly or view it on GitHub
My OpenGL skills are rather bad but maybe you could solve the issue by rendering in the opposite order
Just knowledge things (out of curiosity):
@AlexIIL i thought the problem resulted out of the depth test which evaluated in some sort of same depth making one color overwriting the other color (or doing not) thus the flickering. Only thing i don't know is whether the color data is overwritten when having same depth or preserved. But either way rendering tank & fluid block in the opposite order should make the right one being rendered on top, shouldn't it? Or would it only "exchange" the wrong parts with the currently right parts?
The issue is that floating point calculations are not perfect (loss of precision and not requiring them to be for performance) and so the depth of each pixel is not its true value but one slightly off. Normally this isn't a problem because the difference in position between each polygon is bigger than the loss in precision, but if the polygons are close enough then the losses become grater than the difference, and it causes a depth-fight.
When you get closer to the screen it can use more precision, and so you get less depth-fighting.
Only thing I don't know is whether the color data is overwritten
when having same depth or preserved
OpenGL allows you to specify how the depth test is evaluated, out of the 5 basic number comparisons. (Function spec on OpenGL depth testing functions here). I don't know which one minecraft uses but it doesn't really affect the result.
But either way rendering tank & fluid block in the opposite
order should make the right one being rendered on top, shouldn't it?
You ARE correct about what depth testing is and how it happens, however I cannot change the order that they are rendered (the tank block is rendered in batches in mini-chunks, and the fluid is rendered indervidually per-tank per-frame).
That's not how OpenGL works :P
Currently the fluid renders 99.9%
of the tank size. Thats quite close though, changing it to ~99%
would probably fix it