Java Code Examples for org.lwjgl.opengl.GL11#glDepthMask()
The following examples show how to use
org.lwjgl.opengl.GL11#glDepthMask() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenderWireless.java From WirelessRedstone with MIT License | 6 votes |
private static void renderFreq(int freq) { float scale = 1 / 64F; GL11.glPushMatrix(); GL11.glRotatef(90, 0, 1, 0); GL11.glRotatef(90, 1, 0, 0); GL11.glTranslated(0, -5 / 16D, 0.374); GL11.glScalef(scale, scale, scale); FontRenderer font = Minecraft.getMinecraft().fontRenderer; String s = Integer.toString(freq); GL11.glDepthMask(false); font.drawString(s, -font.getStringWidth(s) / 2, 0, 0); GL11.glDepthMask(true); GL11.glPopMatrix(); }
Example 2
Source File: QCraftProxyClient.java From qcraft-mod with Apache License 2.0 | 6 votes |
private void renderOverlay( ResourceLocation texture, float width, float height ) { Minecraft mc = Minecraft.getMinecraft(); GL11.glDisable( GL11.GL_DEPTH_TEST ); GL11.glDepthMask( false ); GL11.glBlendFunc( GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); GL11.glDisable( GL11.GL_ALPHA_TEST ); mc.renderEngine.bindTexture( texture ); Tessellator tessellator = Tessellator.instance; tessellator.startDrawingQuads(); tessellator.addVertexWithUV( 0.0D, (double) height, -90.0D, 0.0D, 1.0D ); tessellator.addVertexWithUV( (double) width, (double) height, -90.0D, 1.0D, 1.0D ); tessellator.addVertexWithUV( (double) width, 0.0D, -90.0D, 1.0D, 0.0D ); tessellator.addVertexWithUV( 0.0D, 0.0D, -90.0D, 0.0D, 0.0D ); tessellator.draw(); GL11.glDepthMask( true ); GL11.glEnable( GL11.GL_DEPTH_TEST ); GL11.glEnable( GL11.GL_ALPHA_TEST ); GL11.glColor4f( 1.0F, 1.0F, 1.0F, 1.0F ); }
Example 3
Source File: CurveRenderState.java From opsu with GNU General Public License v3.0 | 6 votes |
/** * Restore the old OpenGL state that's backed up in {@code state}. * @param state the old state to restore */ private void restoreRenderState(RenderState state) { GL11.glEnable(GL11.GL_BLEND); GL20.glUseProgram(state.oldProgram); GL11.glDisable(GL11.GL_TEXTURE_1D); GL15.glBindBuffer(GL15.GL_ARRAY_BUFFER, state.oldArrayBuffer); if (!state.depthWriteEnabled) GL11.glDepthMask(false); if (!state.depthEnabled) GL11.glDisable(GL11.GL_DEPTH_TEST); if (state.texEnabled) GL11.glEnable(GL11.GL_TEXTURE_2D); if (state.smoothedPoly) GL11.glEnable(GL11.GL_POLYGON_SMOOTH); if (!state.blendEnabled) GL11.glDisable(GL11.GL_BLEND); }
Example 4
Source File: GlassesHUD.java From Signals with GNU General Public License v3.0 | 6 votes |
private void render2D(){ Minecraft minecraft = FMLClientHandler.instance().getClient(); EntityPlayer player = minecraft.player; ItemStack helmetStack = player.inventory.armorInventory.get(3); if(!helmetStack.isEmpty() && minecraft.inGameHasFocus && helmetStack.getItem() == Items.DIAMOND_HELMET) { GL11.glDepthMask(false); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glPushMatrix(); GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); GL11.glColor4d(0, 1, 0, 0.8D); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); for(int i = 0; i < messages.size(); i++) { minecraft.fontRenderer.drawString(messages.get(i).localizedMessage, 16, 16 + i * (minecraft.fontRenderer.FONT_HEIGHT + 1), 0xFF0000); } } }
Example 5
Source File: LightningRenderer.java From tribaltrouble with GNU General Public License v2.0 | 6 votes |
public static void render(RenderQueues render_queues, List emitter_queue, CameraState state) { tmp_camera.set(state); view_matrix.setIdentity(); tmp_camera.setView(view_matrix); float rx = tmp_camera.getModelView().m00; float ry = tmp_camera.getModelView().m10; float rz = tmp_camera.getModelView().m20; right_vector.set(rx, ry, rz); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_BLEND); GL11.glAlphaFunc(GL11.GL_GREATER, 0f); GL11.glEnable(GL11.GL_ALPHA_TEST); GL11.glDepthMask(false); for (int i = 0; i < emitter_queue.size(); i++) { Lightning emitter = (Lightning)emitter_queue.get(i); if (Globals.draw_particles) render(render_queues, emitter); } emitter_queue.clear(); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_ALPHA_TEST); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_CULL_FACE); }
Example 6
Source File: CurveRenderState.java From opsu-dance with GNU General Public License v3.0 | 5 votes |
/** * Backup the current state of the relevant OpenGL state and change it to * what's needed to draw the curve. */ private RenderState saveRenderState() { RenderState state = new RenderState(); state.smoothedPoly = GL11.glGetBoolean(GL11.GL_POLYGON_SMOOTH); state.blendEnabled = GL11.glGetBoolean(GL11.GL_BLEND); state.depthEnabled = GL11.glGetBoolean(GL11.GL_DEPTH_TEST); state.depthWriteEnabled = GL11.glGetBoolean(GL11.GL_DEPTH_WRITEMASK); state.texEnabled = GL11.glGetBoolean(GL11.GL_TEXTURE_2D); state.texUnit = GL11.glGetInteger(GL13.GL_ACTIVE_TEXTURE); state.oldProgram = GL11.glGetInteger(GL20.GL_CURRENT_PROGRAM); state.oldArrayBuffer = GL11.glGetInteger(GL15.GL_ARRAY_BUFFER_BINDING); GL11.glDisable(GL11.GL_POLYGON_SMOOTH); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_TEXTURE_1D); GL11.glBindTexture(GL11.GL_TEXTURE_1D, staticState.gradientTexture); GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR_MIPMAP_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); GL11.glTexParameteri(GL11.GL_TEXTURE_1D, GL11.GL_TEXTURE_WRAP_S, GL11.GL_CLAMP); GL20.glUseProgram(0); GL11.glMatrixMode(GL11.GL_PROJECTION); GL11.glPushMatrix(); GL11.glLoadIdentity(); GL11.glMatrixMode(GL11.GL_MODELVIEW); GL11.glPushMatrix(); GL11.glLoadIdentity(); return state; }
Example 7
Source File: Peek.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void renderTooltipBox(int x1, int y1, int x2, int y2, boolean wrap) { GL12.glDisable(GL12.GL_RESCALE_NORMAL); GuiLighting.disable(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDepthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glTranslatef(0.0F, 0.0F, 300.0F); int int_5 = x1 + 12; int int_6 = y1 - 12; if (wrap) { if (int_5 + y2 > mc.currentScreen.width) int_5 -= 28 + y2; if (int_6 + x2 + 6 > mc.currentScreen.height) int_6 = mc.currentScreen.height - x2 - 6; } /* why the fork is this private? */ FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 3, int_6 - 4, int_5 + y2 + 3, int_6 - 3, -267386864, -267386864); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 3, int_6 + x2 + 3, int_5 + y2 + 3, int_6 + x2 + 4, -267386864, -267386864); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 3, int_6 - 3, int_5 + y2 + 3, int_6 + x2 + 3, -267386864, -267386864); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 4, int_6 - 3, int_5 - 3, int_6 + x2 + 3, -267386864, -267386864); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 + y2 + 3, int_6 - 3, int_5 + y2 + 4, int_6 + x2 + 3, -267386864, -267386864); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 3, int_6 - 3 + 1, int_5 - 3 + 1, int_6 + x2 + 3 - 1, 1347420415, 1344798847); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 + y2 + 2, int_6 - 3 + 1, int_5 + y2 + 3, int_6 + x2 + 3 - 1, 1347420415, 1344798847); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 3, int_6 - 3, int_5 + y2 + 3, int_6 - 3 + 1, 1347420415, 1347420415); FabricReflect.invokeMethod(mc.currentScreen, "", "fillGradient", int_5 - 3, int_6 + x2 + 2, int_5 + y2 + 3, int_6 + x2 + 3, 1344798847, 1344798847); GL11.glEnable(GL11.GL_LIGHTING); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); GuiLighting.enable(); GL12.glEnable(GL12.GL_RESCALE_NORMAL); }
Example 8
Source File: PartFrame.java From Framez with GNU General Public License v3.0 | 5 votes |
@Override public boolean drawHighlight(MovingObjectPosition hit, EntityPlayer player, float frame) { GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glColor4f(0, 0, 0, 0.4F); GL11.glLineWidth(2); GL11.glDepthMask(true); GL11.glPushMatrix(); RenderUtils.translateToWorldCoords(player, frame); GL11.glTranslated(x(), y(), z()); { double d = 0.002; if (!is2D()) { RenderUtils.drawCuboidOutline(new Cuboid6(2 / 16D + d, isSideHidden(ForgeDirection.DOWN) ? d * 2 : -d * 2, 2 / 16D + d, 14 / 16D - d, 1 + (isSideHidden(ForgeDirection.UP) ? -d * 2 : d * 2), 14 / 16D - d)); RenderUtils.drawCuboidOutline(new Cuboid6(isSideHidden(ForgeDirection.WEST) ? d * 2 : -d * 2, 2 / 16D + d, 2 / 16D + d, 1 + (isSideHidden(ForgeDirection.EAST) ? -d * 2 : d * 2), 14 / 16D - d, 14 / 16D - d)); RenderUtils.drawCuboidOutline(new Cuboid6(2 / 16D + d, 2 / 16D + d, isSideHidden(ForgeDirection.NORTH) ? d : -d, 14 / 16D - d, 14 / 16D - d, 1 + (isSideHidden(ForgeDirection.SOUTH) ? -d * 2 : d * 2))); } RenderUtils.drawCuboidOutline(new Cuboid6(0, 0, 0, 1, 1, 1).expand(d)); } GL11.glPopMatrix(); GL11.glDepthMask(false); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); return true; }
Example 9
Source File: BleachCheckbox.java From bleachhack-1.14 with GNU General Public License v3.0 | 5 votes |
public void renderButton(MatrixStack matrix, int mouseX, int mouseY, float delta) { MinecraftClient minecraftClient_1 = MinecraftClient.getInstance(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_DEPTH_TEST); TextRenderer textRenderer = minecraftClient_1.textRenderer; int color = mouseX > x && mouseX < x + 10 && mouseY > y && mouseY < y + 10 ? 0xffc0c0c0 : 0xffe0e0e0; fill(matrix, x, y, x + 11, y + 11, color); fill(matrix, x, y, x + 1, y + 11, 0xff303030); fill(matrix, x, y + 10, x + 11, y + 11, 0xffb0b0b0); fill(matrix, x, y, x + 10, y + 1, 0xff303030); fill(matrix, x + 10, y, x + 11, y + 11, 0xffb0b0b0); if (checked) textRenderer.draw(matrix, "\u2714", x + 2, y + 2, 0x000000); //fill(x + 3, y + 5, x + 8, y + 6, 0xff000000); drawStringWithShadow(matrix, textRenderer, getMessage().getString(), x + 15, y + 2, 0xC0C0C0); }
Example 10
Source File: Tracers.java From ehacks-pro with GNU General Public License v3.0 | 5 votes |
@Override public void onWorldRender(RenderWorldLastEvent event) { try { GL11.glBlendFunc(770, 771); GL11.glEnable(3042); GL11.glLineWidth(2.0f); GL11.glDisable(3553); GL11.glDisable(2929); GL11.glDepthMask(false); Wrapper.INSTANCE.world().loadedEntityList.stream().filter((entities) -> !(entities == Wrapper.INSTANCE.player() || !(entities instanceof EntityPlayer) || (entities instanceof EntityFakePlayer) || ((Entity) entities).isDead || ((EntityPlayer) entities).isInvisible())).map((entities) -> (EntityPlayer) entities).map((entity1) -> { Entity entity = (Entity) entity1; float distance = Wrapper.INSTANCE.mc().renderViewEntity.getDistanceToEntity(entity); double posX = entity.posX - RenderManager.renderPosX; double posY = entity.posY + (entity.height / 2.0f) - RenderManager.renderPosY; double posZ = entity.posZ - RenderManager.renderPosZ; String playerName = Wrapper.INSTANCE.player().getGameProfile().getName(); if (distance <= 6.0f) { GL11.glColor3f(1.0f, 0.0f, 0.0f); } else if (distance <= 96.0f) { GL11.glColor3f(1.0f, (distance / 100.0f), 0.0f); } else if (distance > 96.0f) { GL11.glColor3f(0.1f, 0.6f, 255.0f); } GL11.glBegin(1); GL11.glVertex3d(0.0, 0.0, 0.0); GL11.glVertex3d(posX, posY, posZ); return entity; }).forEachOrdered((_item) -> { GL11.glEnd(); }); GL11.glEnable(3553); GL11.glEnable(2929); GL11.glDepthMask(true); GL11.glDisable(3042); } catch (Exception exception) { // empty catch block } }
Example 11
Source File: BlockTrackUpgradeHandler.java From PneumaticCraft with GNU General Public License v3.0 | 5 votes |
@Override public void render3D(float partialTicks){ GL11.glDepthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); for(RenderBlockTarget blockTarget : blockTargets) { blockTarget.render(partialTicks); } GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); }
Example 12
Source File: EntitySnakestoneObsidianFX.java From Chisel-2 with GNU General Public License v2.0 | 5 votes |
@Override public void renderParticle(Tessellator tessellator, float partialTick, float rotX, float rotXZ, float rotZ, float rotYZ, float rotXY) { GL11.glDepthMask(false); GL11.glEnable(3042); GL11.glBlendFunc(770, 771); super.renderParticle(tessellator, partialTick, rotX, rotXZ, rotZ, rotYZ, rotXY); }
Example 13
Source File: GLUtils.java From ehacks-pro with GNU General Public License v3.0 | 5 votes |
public static void disableDefaults() { GL11.glPopMatrix(); GL11.glDisable(2848); GL11.glDepthMask(true); GL11.glEnable(2929); GL11.glEnable(3553); GL11.glEnable(2896); GL11.glDisable(3042); Wrapper.INSTANCE.mc().entityRenderer.enableLightmap(1.0); }
Example 14
Source File: ClientProxy.java From NBTEdit with GNU General Public License v3.0 | 4 votes |
private void drawBoundingBox(RenderGlobal r, float f, AxisAlignedBB aabb) { if (aabb == null) return; EntityLivingBase player = Minecraft.getMinecraft().renderViewEntity; double var8 = player.lastTickPosX + (player.posX - player.lastTickPosX) * (double)f; double var10 = player.lastTickPosY + (player.posY - player.lastTickPosY) * (double)f; double var12 = player.lastTickPosZ + (player.posZ - player.lastTickPosZ) * (double)f; aabb = aabb.getOffsetBoundingBox(-var8, -var10, -var12); GL11.glEnable(GL11.GL_BLEND); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glColor4f(1.0F, 0.0F, 0.0F, .5F); GL11.glLineWidth(3.5F); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glDepthMask(false); Tessellator var2 = Tessellator.instance; var2.startDrawing(3); var2.addVertex(aabb.minX, aabb.minY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.minY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.minY, aabb.maxZ); var2.addVertex(aabb.minX, aabb.minY, aabb.maxZ); var2.addVertex(aabb.minX, aabb.minY, aabb.minZ); var2.draw(); var2.startDrawing(3); var2.addVertex(aabb.minX, aabb.maxY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.maxY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.maxY, aabb.maxZ); var2.addVertex(aabb.minX, aabb.maxY, aabb.maxZ); var2.addVertex(aabb.minX, aabb.maxY, aabb.minZ); var2.draw(); var2.startDrawing(1); var2.addVertex(aabb.minX, aabb.minY, aabb.minZ); var2.addVertex(aabb.minX, aabb.maxY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.minY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.maxY, aabb.minZ); var2.addVertex(aabb.maxX, aabb.minY, aabb.maxZ); var2.addVertex(aabb.maxX, aabb.maxY, aabb.maxZ); var2.addVertex(aabb.minX, aabb.minY, aabb.maxZ); var2.addVertex(aabb.minX, aabb.maxY, aabb.maxZ); var2.draw(); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glDisable(GL11.GL_BLEND); }
Example 15
Source File: RenderGravityMachine.java From AdvancedRocketry with MIT License | 4 votes |
@Override public void render(TileEntity tile, double x, double y, double z, float f, int damage, float a) { TileGravityController multiBlockTile = (TileGravityController)tile; if(!multiBlockTile.canRender()) return; GL11.glPushMatrix(); //Initial setup GL11.glTranslated(x + 0.5, y - .5f, z + .5); //Rotate and move the model into position EnumFacing front = RotatableBlock.getFront(tile.getWorld().getBlockState(tile.getPos())); GL11.glRotatef((front.getFrontOffsetX() == 1 ? 180 : 0) + front.getFrontOffsetZ()*90f, 0, 1, 0); //GL11.glTranslated(2f, 0, 0f); bindTexture(texture); model.renderOnly("Base"); GL11.glDisable(GL11.GL_LIGHTING); int maxSize = 5; //Render blur GL11.glDisable(GL11.GL_TEXTURE_2D); GlStateManager.color(0f, 1f, 1f, Math.max(((float)multiBlockTile.getGravityMultiplier() - 0.1f)*0.2f,0f)); GL11.glEnable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glAlphaFunc(GL11.GL_GREATER, 0f); GL11.glPushMatrix(); GL11.glScaled(1.1, 1, 1.1); for(int i = 0; i < 4; i++) { GL11.glScaled(.93, 1, .93); model.renderOnly("Blur"); } GL11.glPopMatrix(); GL11.glAlphaFunc(GL11.GL_GREATER, 0.1f); GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDepthMask(true); GL11.glDisable(GL11.GL_BLEND); GlStateManager.color(1f, 1f, 1f,1f); GL11.glEnable(GL11.GL_TEXTURE_2D); // END render blur GL11.glRotated(multiBlockTile.getArmRotation(), 0, 1, 0); for(int i = 0; i < maxSize; i++) { GL11.glRotated(360/maxSize, 0, 1, 0); model.renderOnly("Arm"); } GL11.glEnable(GL11.GL_LIGHTING); GL11.glPopMatrix(); }
Example 16
Source File: RenderLaser.java From AdvancedRocketry with MIT License | 4 votes |
public void doRender(Particle entity, double x, double y, double z, float f, float f1) { GL11.glPushMatrix(); GL11.glTranslated(x, y, z); BufferBuilder buffer = Tessellator.getInstance().getBuffer(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); GL11.glEnable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); Minecraft.getMinecraft().renderEngine.bindTexture(flare); //bindTexture(flare); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX); GlStateManager.color(flareColor[0],flareColor[1],flareColor[2],flareColor[3]); for(int i = 0; i < 4; i++) { RenderHelper.renderBottomFaceWithUV(buffer, -y + 200, -(i*6) - x, -(i*6) - z, (i*6) - x, (i*6) - z, 0, 1, 0, 1); } Tessellator.getInstance().draw(); GL11.glDisable(GL11.GL_TEXTURE_2D); OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE, 0, 0); //GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); GlStateManager.color(color[0], color[1], color[2], color[3]);//0.9F, 0.2F, 0.3F, 0.5F); for(float radius = 0.25F; radius < size; radius += .25F) { for(double i = 0; i < 2*Math.PI; i += Math.PI) { buffer.pos(- x , -y + 200, - z).endVertex(); buffer.pos(- x, -y + 200, - z).endVertex(); buffer.pos(- (radius* Math.cos(i)) + 0.5F, 0,- (radius* Math.sin(i)) + 0.5F).endVertex(); buffer.pos(+ (radius* Math.sin(i)) + 0.5F, 0, (radius* Math.cos(i)) + 0.5F).endVertex(); } for(double i = 0; i < 2*Math.PI; i += Math.PI) { buffer.pos(- x, -y + 200,- z).endVertex(); buffer.pos(- x, -y + 200, - z).endVertex(); buffer.pos(+ (radius* Math.sin(i)) + 0.5F, 0, -(radius* Math.cos(i)) + 0.5F).endVertex(); buffer.pos(- (radius* Math.cos(i)) + 0.5F, 0,(radius* Math.sin(i)) + 0.5F).endVertex(); } } Tessellator.getInstance().draw(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_FOG); GL11.glDepthMask(true); GL11.glPopMatrix(); GlStateManager.color(1f, 1f, 1f,1f); //Clean up and make player not transparent OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 0, 0); }
Example 17
Source File: RenderLaserTile.java From AdvancedRocketry with MIT License | 4 votes |
@Override public void render(TileEntity tileentity, double x, double y, double z, float f, int damage, float a) { if(!((TileSpaceLaser)tileentity).isRunning()) return; GL11.glPushMatrix(); GL11.glTranslated(x, y, z); BufferBuilder buffer = Tessellator.getInstance().getBuffer(); GL11.glDisable(GL11.GL_LIGHTING); GL11.glDisable(GL11.GL_FOG); GL11.glEnable(GL11.GL_BLEND); GL11.glDepthMask(false); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE); //GL11.glB //GL11.gl buffer.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION); buffer.color(0.9F, 0.2F, 0.3F, 1F); for(float radius = 0.1F; radius < .5; radius += .1F) { for(double i = 0; i < 2*Math.PI; i += Math.PI) { buffer.pos(- x , -y - 100, - z).endVertex(); buffer.pos(- x, -y - 100, - z).endVertex(); buffer.pos(- (radius* Math.cos(i)) + 0.5F, 0,- (radius* Math.sin(i)) + 0.5F).endVertex(); buffer.pos(+ (radius* Math.sin(i)) + 0.5F, 0, (radius* Math.cos(i)) + 0.5F).endVertex(); } for(double i = 0; i < 2*Math.PI; i += Math.PI) { buffer.pos(- x, -y - 100,- z).endVertex(); buffer.pos(- x, -y - 100, - z).endVertex(); buffer.pos(+ (radius* Math.sin(i)) + 0.5F, 0, -(radius* Math.cos(i)) + 0.5F).endVertex(); buffer.pos(- (radius* Math.cos(i)) + 0.5F, 0,(radius* Math.sin(i)) + 0.5F).endVertex(); } } buffer.endVertex(); GL11.glDisable(GL11.GL_BLEND); GL11.glEnable(GL11.GL_LIGHTING); GL11.glEnable(GL11.GL_TEXTURE_2D); GL11.glEnable(GL11.GL_FOG); GL11.glDepthMask(true); GL11.glPopMatrix(); }
Example 18
Source File: ImmediateModeOGLRenderer.java From slick2d-maven with BSD 3-Clause "New" or "Revised" License | 4 votes |
/** * @see org.newdawn.slick.opengl.renderer.SGL#glDepthMask(boolean) */ public void glDepthMask(boolean mask) { GL11.glDepthMask(mask); }
Example 19
Source File: RenderCoordWireframe.java From PneumaticCraft with GNU General Public License v3.0 | 4 votes |
public void render(float partialTicks){ /* Block block = Block.blocksList[world.getBlockId(x, y, z)]; block.setBlockBoundsBasedOnState(world, x, y, z); double minX = block.getBlockBoundsMinX(); double minY = block.getBlockBoundsMinY(); double minZ = block.getBlockBoundsMinZ(); double maxX = minX + (block.getBlockBoundsMaxX() - minX) * progress; double maxY = minY + (block.getBlockBoundsMaxY() - minY) * progress; double maxZ = minZ + (block.getBlockBoundsMaxX() - minZ) * progress; */ double minX = 0; double minY = 0; double minZ = 0; double maxX = 1; double maxY = 1; double maxZ = 1; float progress = (ticksExisted % 20 + partialTicks) / 20; GL11.glDepthMask(false); GL11.glDisable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_BLEND); GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT); GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GL11.glDisable(GL11.GL_TEXTURE_2D); GL11.glLineWidth(1.0F); // GL11.glColor4d(0, 1, 1, progress < 0.5F ? progress + 0.5F : 1.5 - progress); GL11.glColor4d(0, progress < 0.5F ? progress + 0.5F : 1.5 - progress, 1, 1); GL11.glPushMatrix(); // GL11.glTranslated(-0.5D, -0.5D, -0.5D); GL11.glTranslated(x, y, z); Tessellator tess = Tessellator.instance; tess.startDrawing(GL11.GL_LINES); tess.addVertex(minX, minY, minZ); tess.addVertex(minX, maxY, minZ); tess.addVertex(minX, minY, maxZ); tess.addVertex(minX, maxY, maxZ); tess.addVertex(maxX, minY, minZ); tess.addVertex(maxX, maxY, minZ); tess.addVertex(maxX, minY, maxZ); tess.addVertex(maxX, maxY, maxZ); tess.addVertex(minX, minY, minZ); tess.addVertex(maxX, minY, minZ); tess.addVertex(minX, minY, maxZ); tess.addVertex(maxX, minY, maxZ); tess.addVertex(minX, maxY, minZ); tess.addVertex(maxX, maxY, minZ); tess.addVertex(minX, maxY, maxZ); tess.addVertex(maxX, maxY, maxZ); tess.addVertex(minX, minY, minZ); tess.addVertex(minX, minY, maxZ); tess.addVertex(maxX, minY, minZ); tess.addVertex(maxX, minY, maxZ); tess.addVertex(minX, maxY, minZ); tess.addVertex(minX, maxY, maxZ); tess.addVertex(maxX, maxY, minZ); tess.addVertex(maxX, maxY, maxZ); tess.draw(); GL11.glPopMatrix(); GL11.glEnable(GL11.GL_CULL_FACE); GL11.glEnable(GL11.GL_DEPTH_TEST); GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); GL11.glEnable(GL11.GL_TEXTURE_2D); }
Example 20
Source File: LargePotRenderer.java From GardenCollection with MIT License | 3 votes |
private void renderInventoryBlock (BlockLargePot block, int metadata, int modelId, RenderBlocks renderer) { IIcon icon = renderer.getBlockIconFromSideAndMetadata(block, 1, metadata & 15); boolean blendEnabled = GL11.glIsEnabled(GL11.GL_BLEND); if (blendEnabled) GL11.glDisable(GL11.GL_BLEND); GL11.glDepthMask(true); boxRenderer.setUnit(.0625); boxRenderer.setIcon(icon); boxRenderer.setColor(ModularBoxRenderer.COLOR_WHITE); GL11.glRotatef(90, 0, 1, 0); GL11.glTranslatef(-.5f, -.5f, -.5f); boxRenderer.renderBox(null, block, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, ModularBoxRenderer.CUT_YPOS); GL11.glEnable(GL11.GL_BLEND); if ((metadata & 0xFF00) != 0) { int cutFlags = ModularBoxRenderer.CUT_YPOS | ModularBoxRenderer.CUT_YNEG; boxRenderer.setUnit(0); boxRenderer.setIcon(block.getOverlayIcon((metadata >> 8) & 255)); boxRenderer.renderExterior(null, block, 0, 0, 0, 0, 0, 0, 1, 1, 1, 0, cutFlags); } if (!blendEnabled) GL11.glDisable(GL11.GL_BLEND); GL11.glTranslatef(.5f, .5f, .5f); }