Posted April 30, 201411 yr As far as I can tell, there's no up-to-date tutorials for this. I know it has something to do with Multi-Pass Rendering, but the tutorial on the wiki doesn't work. Could someone help me? if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
April 30, 201411 yr Hi This link might help. http://greyminecraftcoder.blogspot.com.au/2013/07/rendering-transparent-blocks.html It shows you the basics, and there is a link to another tutorial on how to render a block in both pass 1 and path 2 (although - that might be the one you're talking about?) If you give your block an ISimpleBlockRenderingHandler you can render as many layers of texture as you want. -TGG
May 1, 201411 yr Author I like the effort you put into your tutorials, but I want to render a texture that requires multiple images that come together to form a single texture. Example for items: Tinkers' Construct's special tools. if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
May 1, 201411 yr This is just a 1.6 code I used for a mod back in the old days. I have not tested it in 1.7, but you can modify it and make it into what you need. These methodes can make it multi layer (in 1.6) public class PotionSword extends ItemSword{ Random rand = new Random(); private Icon sword; private Icon overlay; public PotionSword(int id, int pot, int length, EnumToolMaterial mat) { super(id, mat); potionID = pot; Length = length; Mat = mat; this.setCreativeTab(Core.tabBlades); this.setUnlocalizedName(getTexture() + "_" + potion[potionID]); } private String getTexture() { if(this.Mat == EnumToolMaterial.WOOD){ return "wood_sword";} if(this.Mat == EnumToolMaterial.STONE){ return "stone_sword";} if(this.Mat == EnumToolMaterial.IRON){ return "iron_sword";} if(this.Mat == EnumToolMaterial.GOLD){ return "gold_sword";} if(this.Mat == EnumToolMaterial.EMERALD){ return "diamond_sword";} else{ return "wood_sword";} } @Override public Icon getIconFromDamageForRenderPass(int damage, int pass) { if(pass == 0) { return this.sword; } else { return this.overlay; } } @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @Override public void registerIcons(IconRegister i) { this.sword = i.registerIcon(this.getTexture()); this.overlay = i.registerIcon(Core.getModid() + ":" + "overlay_" + potion[potionID]); } } I hoped this helped you out, Coding, Testing, Smiling, Publishing!
May 1, 201411 yr I like the effort you put into your tutorials, but I want to render a texture that requires multiple images that come together to form a single texture. Example for items: Tinkers' Construct's special tools. Hi I'm not sure exactly what you want to do, but if you use an ISimpleBlockRenderingHandler, you can use the Tessellator to render however you like. For example - if you want to render three textures one on top of the other, your handler render code just draws the same rectangle three times with different textures, using an appropriate blending function or transparent sections or however you want to overlay them. The hardest part is blending the images properly; you can get some strange banding patterns if you render two rectangles almost exactly in the same position. You can usually fix that by offsetting them slightly or by alpha blending. It's also possible to combine your multiple textures to a single texture, then apply this texture to your image (for example - the light map texture does this, see EntityRenderer.updateLightMap()), this is a bit more complicated but (I'm told) not too hard once you get the hang of it; some more info in here http://www.opengl-tutorial.org/intermediate-tutorials/tutorial-14-render-to-texture/ -TGG
May 1, 201411 yr I think the topic author is asking for the ability to "stitch" textures together, not render multiple layers on top of each other. Since TiCon is open-source, why don't you go give it a looksey.
May 2, 201411 yr Author This is just a 1.6 code I used for a mod back in the old days. I have not tested it in 1.7, but you can modify it and make it into what you need. These methodes can make it multi layer (in 1.6) public class PotionSword extends ItemSword{ Random rand = new Random(); private Icon sword; private Icon overlay; public PotionSword(int id, int pot, int length, EnumToolMaterial mat) { super(id, mat); potionID = pot; Length = length; Mat = mat; this.setCreativeTab(Core.tabBlades); this.setUnlocalizedName(getTexture() + "_" + potion[potionID]); } private String getTexture() { if(this.Mat == EnumToolMaterial.WOOD){ return "wood_sword";} if(this.Mat == EnumToolMaterial.STONE){ return "stone_sword";} if(this.Mat == EnumToolMaterial.IRON){ return "iron_sword";} if(this.Mat == EnumToolMaterial.GOLD){ return "gold_sword";} if(this.Mat == EnumToolMaterial.EMERALD){ return "diamond_sword";} else{ return "wood_sword";} } @Override public Icon getIconFromDamageForRenderPass(int damage, int pass) { if(pass == 0) { return this.sword; } else { return this.overlay; } } @SideOnly(Side.CLIENT) public boolean requiresMultipleRenderPasses() { return true; } @Override public void registerIcons(IconRegister i) { this.sword = i.registerIcon(this.getTexture()); this.overlay = i.registerIcon(Core.getModid() + ":" + "overlay_" + potion[potionID]); } } I hoped this helped you out, Thank you. This is exactly what I needed. if (user.hasKnowledgeOfJava) { if (user.question.hasCode) { return interpetHelpfulResponse(user.getQuestion()); } else { return "Could you post your code please?"; } } else { return "Learn some freaking Java!"; }
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.