makamys / Neodymium

Reimplements chunk rendering using modern OpenGL features to improve performance (1.7.10)
Other
116 stars 11 forks source link

Blocks that render using triangles don't render properly #5

Closed embeddedt closed 2 years ago

embeddedt commented 2 years ago

With Neodymium:

2022-07-05_22 14 47

Without Neodymium:

2022-07-05_22 14 49

This is a modpack world, so getting it to you will be complicated, but I can try to strip it down if the images are not enough.

embeddedt commented 2 years ago

Turning "cull faces" off does not seem to fix the problem at runtime, even after F3+A.

makamys commented 2 years ago

Does it happen consistently when you visit the same spot? Does it stay if you move farther away? Are you saying F3+A doesn't fix it? What happens if you break one of the blocks in the missing subchunk then replace it? Finally, is there anything in the log that could indicate an error?

embeddedt commented 2 years ago

I'll confirm that it persists after a game restart today. It does persist even if you move farther away, you can see the missing faces at a distance. F3+A does not fix it, but using the hotkey to switch to the vanilla renderer does. I will also check the log.

makamys commented 2 years ago

If it persists, then it probably happens because Nd has trouble rendering a certain modded block. What blocks are there in those chunks that are rendered in a non-standard way? I can see this grey thing that might be a culprit. image Try removing blocks in the chunk until the issue goes away, that should reveal which block was causing it.

embeddedt commented 2 years ago

You found it! The block in question is a Molecular Inscriber from Matter Overdrive. Placing it immediately causes the surrounding blocks to stop rendering, and breaking it fixes the issue.

2022-07-06_08 48 40

I think it is supposed to have a base but that's the part that isn't rendering.

makamys commented 2 years ago

Looks like it uses the tessellator in triangle mode to render those blocks, while Nd is only compatible with quad rendering at the moment. https://bitbucket.org/hrznstudio/mo-legacy-edition/src/460d23944be14a66b6bebe925f998c393a184719/src/main/java/matteroverdrive/client/render/block/RendererBlockInscriber.java#lines-72:82

To fix this, I will have to add logic to convert triangles into quads. I also plan to add an option to render everything using triangles in the future, that will also solve this.

makamys commented 2 years ago

Should be fixed now, but Matter Overdrive puts normal data in its vertices, which I'm ignoring. I won't close this issue until I'm confident this doesn't cause problems.

makamys commented 2 years ago

From the GL 2.1 spec I've gathered that normals are only used for lighting. It doesn't look like chunks are ever rendered with GL lighting enabled, so it should be fine. I've added a warning on the off-chance that it does happen.