OpenCubicChunks / CubicChunks

Infinite* height mod for Minecraft
MIT License
534 stars 69 forks source link

Render issue with LittleTiles #314

Closed CreativeMD closed 6 years ago

CreativeMD commented 6 years ago

Hey there, i'm the author of LittleTiles and recently somebody an issue:

LittleTiles blocks don't render above 256 or below 0:

LittleTiles uses a rather hacky way to save performance. It hooks into the ChunkRenderDispatcher and adds the render data once minecraft uploads the buffer to the graphic card. Source.

Maybe we can figure out a solution together. How does CubicChunks render its chunks? Is there a way for me to hook in?

In Regards CreativeMD

Barteks2x commented 6 years ago

CubicChunks renders chunks exactly the same way as vanilla Minecraft does. It's close enough that optifine required only one patch to get entity rendering working and everythinbg else worked fine.

After looking at the code, I belive this is the issue: https://github.com/CreativeMD/LittleTiles/blob/6a58ecc7506c3d29616fabbe62748372a8c67113/src/main/java/com/creativemd/littletiles/client/render/RenderUploader.java#L258-L308 specifically: https://github.com/CreativeMD/LittleTiles/blob/6a58ecc7506c3d29616fabbe62748372a8c67113/src/main/java/com/creativemd/littletiles/client/render/RenderUploader.java#L288

Cubic chunks modifies the way it's calculated: https://github.com/OpenCubicChunks/CubicChunks/blob/00804e89b36141af5ed35bece960543b40ccb8d8/src/main/java/cubicchunks/asm/mixin/core/client/MixinViewFrustum_RenderHeightFix.java#L109-L134

You should be able to fix the issue by reflectively calling that viewfrustum method, instead of (stil half- reflectively) reimplementing it yourself

CreativeMD commented 6 years ago

Oh, the RenderUploader is inactive, it was just a test to modify the render data after it has been uploaded, but i threw away this idea.

Barteks2x commented 6 years ago

Well then I will have to look at the code again

Barteks2x commented 6 years ago

Or is it really inactive?

This method is used here, which is used:

That seems to be far from dead code

CreativeMD commented 6 years ago

Oh sorry ... i was not really paying attention to be honest. I will try to fix it. Thanks for all your help and again sorry :(

CreativeMD commented 6 years ago

Unfortunately things are not fixed, but it's better already.

So everything between 0 and 527 renders correctly. No idea why this is the case, but maybe you have an idea?

EDIT Maybe because i was still using the old method ... i created a fix for it, but forgot to link to the new method. Anyway it is fixed now! Thank you very very much for your help!!!