Tesseract

Tesseract

12M Downloads

[Feature] Option to disable rendering ender faces

lilmayu opened this issue ยท 2 comments

commented

Minecraft: 1.12.2

Is your feature request related to a problem? Please describe.
I've been diagnosing issues with my FPS and came upon your TesseractBlockEntityRenderer. I'm quite baffled why there's no option to disable the end portal effect render, since it's just for decoration purposes.

Describe the solution you'd like
Add an option in the config to disable this behavior; render instead a black cube, like so (for example):

Tessellator tessellator = Tessellator.getInstance();
BufferBuilder bufferbuilder = tessellator.getBuffer();
GlStateManager.disableTexture2D();
GlStateManager.color(0, 0, 0); // Set the color to black

bufferbuilder.begin(7, DefaultVertexFormats.POSITION);

bufferbuilder.pos(0, 0, 0).endVertex();
bufferbuilder.pos(1, 0, 0).endVertex();
bufferbuilder.pos(1, 0, 1).endVertex();
bufferbuilder.pos(0, 0, 1).endVertex();

bufferbuilder.pos(0, 1, 1).endVertex();
bufferbuilder.pos(1, 1, 1).endVertex();
bufferbuilder.pos(1, 1, 0).endVertex();
bufferbuilder.pos(0, 1, 0).endVertex();

bufferbuilder.pos(0, 1, 0).endVertex();
bufferbuilder.pos(1, 1, 0).endVertex();
bufferbuilder.pos(1, 0, 0).endVertex();
bufferbuilder.pos(0, 0, 0).endVertex();

bufferbuilder.pos(0, 0, 1).endVertex();
bufferbuilder.pos(1, 0, 1).endVertex();
bufferbuilder.pos(1, 1, 1).endVertex();
bufferbuilder.pos(0, 1, 1).endVertex();

bufferbuilder.pos(0, 0, 0).endVertex();
bufferbuilder.pos(0, 0, 1).endVertex();
bufferbuilder.pos(0, 1, 1).endVertex();
bufferbuilder.pos(0, 1, 0).endVertex();

bufferbuilder.pos(1, 1, 0).endVertex();
bufferbuilder.pos(1, 1, 1).endVertex();
bufferbuilder.pos(1, 0, 1).endVertex();
bufferbuilder.pos(1, 0, 0).endVertex();

tessellator.draw();
GlStateManager.enableTexture2D();

Upon applying, I've achieved nearly +30fps in environments, where there are more than few Tesseracts.

commented

Another idea is to render whole different model when the render should be on. Or render some block model inside the Tesseract to have still some beauty, for example obsidian or some custom texture which mimics the end portal effect (but without any animations)

commented

I have not tested the performance of the end portal effect (especially on 1.12). As the code for it is simply copied from the end portal itself, I assumed performance would not be significantly impacted.

Newer Minecraft versions simply use shaders for the end portal effect, hence it's unlikely to be an issue there. In 1.12, shaders aren't really an option due to the older OpenGL version used. I am not too sure there's much I can (or am willing to) optimize for the 1.12 code.

Add an option in the config to disable this behavior

I don't mind adding an option to render something simpler instead.