Posted August 16, 201411 yr Hey guys, I was wondering is there a way to use 2 textures on the rendering? Let's say that I have a mob and I would like to use one texture for the body and another texture for the head. I tried everything, but the first texture is always replaced by the other one...
August 16, 201411 yr you may have to look into the workings of OpenGl for texture blending, I attempted to try this when I was doing a 3D game could never get it to work properly. But maybe the Modding API has something for this. Currently updating my Mod to 1.10.2 https://bitbucket.org/hugo_the_dwarf/riseoftristram2016/src?at=master
August 16, 201411 yr I have done up to 8 texture blends for terrain generation it is not something that i would recommend trying to implement into minecraft in case you want to try to do it you would have to add custom block rendering then add cgi pixel shading (including a cgi pixel shader program) if you havnt done any pixel shading before i would recommend getting used to using it in a standalone enviroment (google LWJDL they have some good tutorials to get you started and its what minecraft uses)
August 17, 201411 yr Hi So you don't actually want texture blending, you just want different textures for the different parts of the model? Based on my work with blocks, you can switch textures if you make sure you flush the Tessellator in between switching. Most of the rendering code just queues up commands on the Tessellator, so if you do this code: 1) change texture using GL11.bindTexture 2) do Tessellator commands 3) change texture using GL11.bindTexture 4) do more Tessellator commands 5) flush Tessellator (to OpenGL) the actual order that the OpenGL sees is 1) change texture using GL11.bindTexture 3) change texture using GL11.bindTexture 5) flush Tessellator commands (2) and (4)(to OpenGL) Whether this applies to you or not depends on what you're rendering. Could you show your code? -TGG
August 17, 201411 yr Author Thanks for all your responses guys, but I have to rethink what is my goal. Actually, what I would like to make is: a mob that can change colors depending on a float value of the entity class. therefore, I would get this value and change the color of the secondary texture using glColor4f, but i would keep the primary texture unchanged. Just imagine a dog that have spots, for instance. To be honestly, I could do lots of different textures for each mob, but it would be a pain...
August 19, 201411 yr if you want to create a simple blend of, for instance fur and spots, you could do this create each texture , fur and spots leave fur completely opaque but make the spots texture so only the spots show , the rest transparent then render 2 layers render the fur first, then render the spots a fraction above the fur if you use mpc and de-compile minecraft , you could look at how the horses are done, you might get another idea from that
August 19, 201411 yr Look into EntityHorse. It is already doing a base-color + markings combo like you are describing. Imitate and adapt. The debugger is a powerful and necessary tool in any IDE, so learn how to use it. You'll be able to tell us more and get better help here if you investigate your runtime problems in the debugger before posting.
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.