Posted May 6, 20178 yr Hello again, back with some more questions about rendering. I have a TileEntity that can contain multiple materials at once, but does not need to update every tick, an example of which is here: I am currently using a standard TESR to render this, with that code being here: https://github.com/16ColorGames/SuperTechTweaks/blob/master/src/main/java/com/sixteencolorgames/supertechtweaks/render/TESRBlockOre.java I have heard that FastTESRs can speed up performance, as well as IBakedModels, but there do not seem to be any tutorials for either online. Can someone help explain to me how to set up either of those?
May 7, 20178 yr Why do you need a TESR (fast or otherwise) to render a block? Use the JSON model system. Apparently I'm a complete and utter jerk and come to this forum just like to make fun of people, be confrontational, and make your personal life miserable. If you think this is the case, JUST REPORT ME. Otherwise you're just going to get reported when you reply to my posts and point it out, because odds are, I was trying to be nice. Exception: If you do not understand Java, I WILL NOT HELP YOU and your thread will get locked. DO NOT PM ME WITH PROBLEMS. No help will be given.
May 7, 20178 yr Author because I have ~100 ores and each block can contain up to 7 ores. I'm not going to make a json for the 100^7 states that would take up
May 7, 20178 yr I'd recommend using IBakedModels only, as you are using this for (seemingly common) worldgen. (The official GregTech 4 port back in 1.7.10 I believe used TESR's for rendering ores, to bypass xray, and dear god, the FPS drops) You will need to create a custom model-cache You will need to register your own ICustomModelLoader You have to save your TE data to an IExtendedBlockState to provide the data for the models getExtendedState createBlockState You will have to create an IModel, that points to an IBakedModel Either get cached List<BakedQuad> from your cache, or create them on the fly, and cache them in your IBakedModel Block implementing TE->IExtendedBlockState example: Compressed Block Model Cache example: EchoModelCache ICustomModelLoader example: EchoModelLoader IBakedModel example: MengerBakedModel You can of course not simply copy-and-paste these; they were tailored for one of my projects, but they should give you a hint on how to do things. Edited May 7, 20178 yr by Matryoshika Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
May 9, 20178 yr Author Where do you set the textures to use on those? I have 1 texture that I recolor using the setcolor method in GL, how would I color and layer those?
May 9, 20178 yr My example doesn't use own textures, instead it creates a tessellation of vanilla and/or modded blocks, using their textures. I have not handled colouring IBakedModels, so I cannot provide any information on that subject, however, for having several layers: In the IBakedModels getQuads method, you get the state; From this state, get the IExtendedBlockState, and from that, it's properties, one which should be a collection of ores that this block "contains". Be it Enums, or mere strings, as long as you know "this block contains x & y". Now, some pseudo-code List<IBakedQuad> quads = new ArrayList<IBakedQuad>(); List<String> ores = extState.getProperty(SuperTechOre.LIST); //add stone/background texture to the quads list if(ores.contains("gold")){ //add gold texture to the quads list } if(ores.contains("silver")){ //add silver texture to the quads list } The easiest approach to simply "adding" the texture, would probably be having JSON models with "faulty" ores, eg one model for each type of ore, without background, and just the actual metal/chunk parts, and get the IBakedModel from that, to add it's quads this model.This shows how to get an IBakedModel from a resourcelocation. Edited May 9, 20178 yr by Matryoshika Also previously known as eAndPi. "Pi, is there a station coming up where we can board your train of thought?" -Kronnn Published Mods: Underworld Handy links: Vic_'s Forge events Own WIP Tutorials.
May 9, 20178 yr You only need tint(color), right? Then it is feasible only with Json model and Block#getColor(Or something similar). Look at the model code of vanilla spawn egg to figure out the tint, and wool code for specifying the color. (As far as I know you can reference world and position there) I. Stellarium for Minecraft: Configurable Universe for Minecraft! (WIP) II. Stellar Sky, Better Star Rendering&Sky Utility mod, had separated from Stellarium.
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.