Jump to content
View in the app

A better way to browse. Learn more.

Forge Forums

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Featured Replies

Posted

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?

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

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.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

Important Information

By using this site, you agree to our Terms of Use.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.