Advertisement
Guest User

Untitled

a guest
Jul 24th, 2015
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.29 KB | None | 0 0
  1. private void renderLightRuneFx(Vec3Int coord) {
  2.         glPushMatrix();
  3.  
  4.         EntityClientPlayerMP player = Minecraft.getMinecraft().thePlayer;
  5.  
  6.  
  7.         double offsetX = coord.x - (player.lastTickPosX + (player.posX - player.lastTickPosX) * partialTicks) + 0.5;
  8.         double offsetY = coord.y - (player.lastTickPosY + (player.posY - player.lastTickPosY) * partialTicks) + 5.5;
  9.         double offsetZ = coord.z - (player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * partialTicks) + 0.5;
  10.  
  11.         int renderDistBlocks = FMLClientHandler.instance().getClient().gameSettings.renderDistanceChunks * 16;
  12.         if ((offsetX*offsetX + offsetZ*offsetZ) > (renderDistBlocks*renderDistBlocks)) return;
  13.  
  14.         glTranslated(offsetX, offsetY, offsetZ);
  15.         glColor4f(0.8f, 0.8f, 1f, 0.9f);
  16.         glRotatef(renderTick, 0, 1, 0);
  17.         glDisable(GL_TEXTURE_2D);
  18.  
  19.         glEnable(GL_BLEND);
  20.         glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_ALPHA);
  21.  
  22.         // Blur X and render to framebuffer A
  23.         glUseProgram(GAUSSIAN_BLUR);
  24.     int location = glGetUniformLocation(GAUSSIAN_BLUR, "direction");
  25.         glUniform3f(location, 1f, 0f, 0f);
  26.         sphere.draw(2, 24, 24);
  27.  
  28.         glEnable(GL_TEXTURE_2D);
  29.         glDisable(GL_BLEND);
  30.         glUseProgram(0);
  31.         glPopMatrix();
  32.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement