Posted May 6, 201411 yr Hey Guys! I wanted to render some textures with the same technique the destroy overlay is rendered: The grayscale of the texture is calculated into a corresponding alpha value. But actually I don't understand how this is done. I looked in RenderGlobal, tried to understand the code, copied something, no effect.. Can anybody explain how to do this? http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
May 7, 201411 yr Author Anyone?? Pls.. http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
May 8, 201411 yr Hi I'm not sure what effect you're talking about - do you mean the cracks? RenderGlobal:: public void drawBlockDamageTexture(Tessellator par1Tessellator, EntityLivingBase par2EntityPlayer, float par3) or the flying fragments when the block bursts? EntityDiggingFX -TGG
May 8, 201411 yr Author Actually I'm not trying to render the cracks but another texture. But i want to do it the same way as the cracks are rendered: grayscale to alpha http://i.imgur.com/wNvtGZw.png[/img] MODS and MODDING TUTORIALS
May 9, 201411 yr The blending is done using the source and destination colour instead of alpha information, due to this command GL11.glBlendFunc(GL11.GL_DST_COLOR, GL11.GL_SRC_COLOR); This makes the blending use the source colour and destination colour, instead of the more usual alpha blending GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); You may also need GL11.glEnable(GL11.GL_BLEND); before the rendering. These bits are also important to make the cracks stand a bit proud of the block surface GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glPolygonOffset(-3.0F, -3.0F); GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL); GL11.glEnable(GL11.GL_ALPHA_TEST); See this link for more information... http://www.glprogramming.com/red/chapter06.html -TGG
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.