Ability to render mobs.
mikuhl-dev opened this issue · 13 comments
This is the feature that will complete the mod. We have these nice block renders for wikis but mob pages are lacking nice renders. This will even help the vanilla wiki because the new 1.11 mobs are lacking good renders as the people who made the good ones in blender have dropped off the face of the earth.
Just to add on to this, this would be awesome for us at the FTB Gamepedia who don't have time to create advanced renderings :O
I've been busy with work and haven't really had time to work on any of my mods.
Since mobs can come with different NBT and such, I would say pressing the render key while looking at the mob should render that specific one.
@unascribed I figured out how to render entities like this:
GlStateManager.enableColorMaterial();
GlStateManager.pushMatrix();
Float scale = height / (1 + entity.height); // Scale needs to be adjusted to always get a 512 sized image, not sure how to do that.
GlStateManager.translate(width / 2, height / 2 + entity.height * scale / 2, 50.0F);
GlStateManager.scale(scale, scale, scale);
GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); // For some reason mobs are rendered upside down.
GlStateManager.rotate(45.0F, 0.0F, 1.0F, 0.0F); // Ortho angle on y axis.
GlStateManager.rotate(30.0F, 1.0F, 0.0F, 1.0F); // Ortho angle on x and z axis.
entity.setRotationYawHead(0); // Minecraft gives mobs a slightly random head facing. Reset it.
RenderHelper.enableStandardItemLighting();
RenderManager rendermanager = mc.getRenderManager();
rendermanager.setPlayerViewY(180.0F);
rendermanager.setRenderShadow(false);
rendermanager.renderEntity(entity, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F, false);
rendermanager.setRenderShadow(true);
GlStateManager.popMatrix();
RenderHelper.disableStandardItemLighting();
GlStateManager.disableRescaleNormal();
GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.disableTexture2D();
GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
Need a whole GUI with options and stuff like to flip axis' because some mobs like Ender Dragon are backwards.
It seems that the renders will have to be manually sized, because the bounding boxes are not accurate on lots of mobs.
Yes the game lags for a second, but usually you want to do renders for mobs on-demand, because there are many variables you might want to render, like dye, armor, etc.
Due to the usage of the DataManager for entities, all permutations of entity properties can be iterated automatically. The game lagging for "a second" is extremely expensive when you start thinking about hundreds or thousands of renders.
If you were to PR this I'd probably merge it, I've stopped caring about Minecraft. Trying to present my concerns and explain why I think this is a bad approach.