ctbe Posted September 4, 2017 Posted September 4, 2017 I'm trying to use ModelChest to render a lid for my chest in a TESR. However, the lid renders dark and upside down. I don't know if calling render on a model from the overridden function is not the correct way to do it or recommended. I do know that when I tried this but while extending FastTESR, the code crashed because of some buffering issues and the crash was caused by the call of render(0.0625f) over the model. Not understanding how it works I might me doing something ridiculous here. This is my code: class TileEntitySimpleBoxRenderer : TileEntitySpecialRenderer<TileEntitySimpleBox>() { private val TEXTURE_NORMAL = ResourceLocation("textures/entity/chest/normal.png") private val simpleChest = ModelChest() override fun render(te: TileEntitySimpleBox, x: Double, y: Double, z: Double, partialTicks: Float, destroyStage: Int, alpha: Float) { // Store rendering flags GlStateManager.pushAttrib() // Store the viewport GlStateManager.pushMatrix() // Bind the chest texture this.bindTexture(TEXTURE_NORMAL) // Translate the location of the lid and knob GlStateManager.translate(x, y + 0.9, z) // Render the lid this.simpleChest.chestLid.render(0.0625f) // Render the knob this.simpleChest.chestKnob.render(0.0625F) // Restore the viewport GlStateManager.popMatrix() // Restore rendering flags GlStateManager.popAttrib() } } Result: Is there any way to make it normally bright, like a normal chest and flip it? By flipping it I mean maybe a method that takes care of it without having to use rotate and translate. If not I suppose I will have to use rotate and translate. I'm more concerned on fixing the brightness of the model rendered. Quote
ctbe Posted September 5, 2017 Author Posted September 5, 2017 (edited) The lightning got fixed by using this.setLightmapDisabled(true) as in the solution found here. But I feel I'm still doing something wrong since if I place more than one block, one lid renders normally lighted, and the other dark. Perhaps I should change the model of the block below the lid to be less than 1x1x1. After all, I have read various times it is not recommended to render anything bigger than 1x1x1. Edit: After a check, this doesn't solve the brightness issue. As when the chest and the player stand in a completely dark area, the lid can be seen clearly despite there being no source of light. After all, the lightmap was disabled. Edited September 6, 2017 by ctbe Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.