本文整理汇总了Java中org.lwjgl.opengl.GL11.glDepthMask方法的典型用法代码示例。如果您正苦于以下问题:Java GL11.glDepthMask方法的具体用法?Java GL11.glDepthMask怎么用?Java GL11.glDepthMask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.lwjgl.opengl.GL11
的用法示例。
在下文中一共展示了GL11.glDepthMask方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: searchBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void searchBox(BlockPos blockPos) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(1.0F);
float sinus = 1F - MathHelper
.abs(MathHelper.sin(Minecraft.getSystemTime() % 10000L / 10000.0F * (float) Math.PI * 4.0F) * 1F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4f(1F - sinus, sinus, 0F, 0.15F);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0), 1F - sinus, sinus, 0F, 0.15F);
GL11.glColor4d(0, 0, 0, 0.5);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0, y + 1.0, z + 1.0));
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
}
示例2: frame
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void frame(double x, double y, double z, double x2, double y2, double z2, Color color) {
x -= Minecraft.getMinecraft().getRenderManager().renderPosX;
y -= Minecraft.getMinecraft().getRenderManager().renderPosY;
z -= Minecraft.getMinecraft().getRenderManager().renderPosZ;
x2 -= Minecraft.getMinecraft().getRenderManager().renderPosX;
y2 -= Minecraft.getMinecraft().getRenderManager().renderPosY;
z2 -= Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glLineWidth(2.0F);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
glColor(color);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x2, y2, z2));
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
}
示例3: blockEsp
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* Renders an ESP box with the size of a normal block at the specified
* BlockPos.
*/
public static void blockEsp(BlockPos blockPos, Color c, double length, double length2) {
double x = blockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = blockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = blockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glPushMatrix();
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(2.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glColor4d(c.getRed() / 255f, c.getGreen() / 255f, c.getBlue() / 255f, 0.25);
drawColorBox(new AxisAlignedBB(x, y, z, x + length2, y + 1.0, z + length), 0F, 0F, 0F, 0F);
GL11.glColor4d(0, 0, 0, 0.5);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + length2, y + 1.0, z + length));
GL11.glLineWidth(2.0F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
GL11.glPopMatrix();
}
示例4: blockESPBox
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void blockESPBox(IBlockPos IBlockPos, Color c) {
RenderUtils.fixDarkLight();
GlStateManager.resetColor();
float red = c.getRed(), green = c.getGreen(), blue = c.getBlue();
double x = IBlockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = IBlockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = IBlockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glLineWidth(1.0F);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glColor4f(red, green, blue, 0.15F);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), 0.0F, 1.0F, 0.0F, 0.15F);
GL11.glColor4d(0.0D, 0.0D, 0.0D, 0.5D);
drawSelectionBoundingBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D));
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
GlStateManager.resetColor();
}
示例5: framelessBlockESP
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void framelessBlockESP(IBlockPos IBlockPos, float red, float green, float blue) {
RenderUtils.fixDarkLight();
GlStateManager.resetColor();
double x = IBlockPos.getX() - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = IBlockPos.getY() - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = IBlockPos.getZ() - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glLineWidth(2.0F);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
GL11.glColor4f(red, green, blue, 0.15F);
drawColorBox(new AxisAlignedBB(x, y, z, x + 1.0D, y + 1.0D, z + 1.0D), red, green, blue, 0.15F);
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
GlStateManager.resetColor();
}
示例6: onRender
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
public void onRender() {
if(this.isEnabled()) {
GL11.glPushMatrix();
GL11.glLineWidth(2F);
GL11.glBlendFunc(770, 771);
GL11.glEnable(GL_BLEND);
GL11.glLineWidth(1.0F);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glBegin(GL11.GL_LINE_STRIP);
for(double[] pos : positionsList) {
double distance = posit(Math.hypot(pos[0] - RenderManager.renderPosX, pos[1] - RenderManager.renderPosY));
if(distance > 100) continue;
GL11.glColor4f(0.0F, 1.0F, 0.0F, 1.0F - (float)(distance / 100D));
GL11.glVertex3d(pos[0] - RenderManager.renderPosX, pos[1] - RenderManager.renderPosY, pos[2] - RenderManager.renderPosZ);
}
GL11.glEnd();
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL_DEPTH_TEST);
GL11.glDepthMask(true);
GL11.glDisable(GL_BLEND);
GL11.glPopMatrix();
}
}
示例7: render3D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
@Override
@SideOnly(Side.CLIENT)
public void render3D(float partialTicks) {
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
GL11.glEnable(GL11.GL_TEXTURE_2D);
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);
Minecraft.getMinecraft().getRenderManager().renderEngine.bindTexture(Textures.GLOW_RESOURCE);
// mc.func_110434_K().func_110577_a(Textures.GLOW_RESOURCE);
for (Map.Entry<EntityItem, Integer> entry : searchedItems.entrySet()) {
EntityItem item = entry.getKey();
float height = MathHelper.sin((item.getAge() + partialTicks) / 10.0F + item.hoverStart) * 0.1F + 0.2F;
RenderSearchItemBlock.renderSearch(item.lastTickPosX + (item.posX - item.lastTickPosX) * partialTicks, item.lastTickPosY + (item.posY - item.lastTickPosY) * partialTicks + height, item.lastTickPosZ + (item.posZ - item.lastTickPosZ) * partialTicks, entry.getValue(), totalSearchedItemCount);
}
for (int i = 0; i < searchedBlocks.size(); i++) {
if (!searchedBlocks.get(i).renderSearchBlock(totalSearchedItemCount)) {
searchedBlocks.remove(i);
i--;
}
}
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);
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
}
示例8: tracerLine
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void tracerLine(Entity entity, Color color) {
RenderUtils.fixDarkLight();
GlStateManager.resetColor();
double x = entity.posX - Minecraft.getMinecraft().getRenderManager().renderPosX;
double y = entity.posY + entity.height / 2.0F - Minecraft.getMinecraft().getRenderManager().renderPosY;
double z = entity.posZ - Minecraft.getMinecraft().getRenderManager().renderPosZ;
GL11.glBlendFunc(770, 771);
GL11.glEnable(3042);
GL11.glLineWidth(2.0F);
GL11.glDisable(3553);
GL11.glDisable(2929);
GL11.glDepthMask(false);
glColor(color);
Vec3d eyes = new Vec3d(0.0D, 0.0D, 1.0D)
.rotatePitch(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationPitch))
.rotateYaw(-(float) Math.toRadians(Minecraft.getMinecraft().player.rotationYaw));
GL11.glBegin(1);
GL11.glVertex3d(eyes.xCoord, Minecraft.getMinecraft().player.getEyeHeight() + eyes.yCoord, eyes.zCoord);
GL11.glVertex3d(x, y, z);
GL11.glEnd();
GL11.glEnable(3553);
GL11.glEnable(2929);
GL11.glDepthMask(true);
GL11.glDisable(3042);
}
示例9: disableGL3D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void disableGL3D() {
GL11.glEnable((int)3553);
GL11.glEnable((int)2929);
GL11.glDisable((int)3042);
GL11.glEnable((int)3008);
GL11.glDepthMask((boolean)true);
GL11.glCullFace((int)1029);
GL11.glDisable((int)2848);
GL11.glHint((int)3154, (int)4352);
GL11.glHint((int)3155, (int)4352);
}
示例10: drawPlayerESP
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void drawPlayerESP(double d, double d1, double d2, EntityPlayer ep, double e, double f)
{
if(!(ep instanceof EntityPlayerSP))
{
GL11.glPushMatrix();
GL11.glEnable(3042);
if(Wrapper.getFriends().isFriend(ep.getName())) {
GL11.glColor4f(0.0F, 1F, 0.0F, 0.15F);
}else{
GL11.glColor4f(0.7F, 0.0F, 0.0F, 0.15F);
}
GL11.glPushMatrix();
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glDepthMask(false);
GL11.glLineWidth(1.0F);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glEnable(GL11.GL_LINE_SMOOTH);
drawBoundingBox(new AxisAlignedBB(d - f, d1 + 0.1, d2 - f, d + f, d1 + e + 0.25, d2 + f));
if(Wrapper.getFriends().isFriend(ep.getName())) {
GL11.glColor4f(0.0F, 1F, 0.0F, 1F);
}else{
GL11.glColor4f(0.7F, 0.0F, 0.0F, 1F);
}
drawOutlinedBoundingBox(new AxisAlignedBB(d - f, d1 + 0.1, d2 - f, d + f, d1 + e + 0.25, d2 + f));
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glDisable(3042);
GL11.glPopMatrix();
}
}
示例11: disableRender3D
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void disableRender3D(boolean depthOn) {
if (depthOn) {
GL11.glDepthMask(true);
GL11.glEnable(GL11.GL_DEPTH_TEST);
}
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
}
示例12: depthMask
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static void depthMask(boolean flagIn)
{
if (flagIn != depthState.maskEnabled)
{
depthState.maskEnabled = flagIn;
GL11.glDepthMask(flagIn);
}
}
示例13: render
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
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(pos.getX(), pos.getY(), pos.getZ());
BufferBuilder wr = Tessellator.getInstance().getBuffer();
wr.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION);
wr.pos(minX, minY, minZ).endVertex();
wr.pos(minX, maxY, minZ).endVertex();
wr.pos(minX, minY, maxZ).endVertex();
wr.pos(minX, maxY, maxZ).endVertex();
wr.pos(maxX, minY, minZ).endVertex();
wr.pos(maxX, maxY, minZ).endVertex();
wr.pos(maxX, minY, maxZ).endVertex();
wr.pos(maxX, maxY, maxZ).endVertex();
wr.pos(minX, minY, minZ).endVertex();
wr.pos(maxX, minY, minZ).endVertex();
wr.pos(minX, minY, maxZ).endVertex();
wr.pos(maxX, minY, maxZ).endVertex();
wr.pos(minX, maxY, minZ).endVertex();
wr.pos(maxX, maxY, minZ).endVertex();
wr.pos(minX, maxY, maxZ).endVertex();
wr.pos(maxX, maxY, maxZ).endVertex();
wr.pos(minX, minY, minZ).endVertex();
wr.pos(minX, minY, maxZ).endVertex();
wr.pos(maxX, minY, minZ).endVertex();
wr.pos(maxX, minY, maxZ).endVertex();
wr.pos(minX, maxY, minZ).endVertex();
wr.pos(minX, maxY, maxZ).endVertex();
wr.pos(maxX, maxY, minZ).endVertex();
wr.pos(maxX, maxY, maxZ).endVertex();
Tessellator.getInstance().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);
}
示例14: begin
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
public static final void begin(final Light sun, final Vec3 skyColor, final Vec3 position, final float scale) {
shader.start();
shader.loadViewMatrix(GameCamera.view);
shader.loadLight(sun);
shader.loadLogSettings(skyColor, Settings.CURRENT_FOG_SETTING.x, Settings.CURRENT_FOG_SETTING.y);
final float time = (float) (Timings.globalTime * 0.02f);
shader.loadTextureOffsets(new Vec2(time * Wind.DIRECTON.x + position.x / scale, time * Wind.DIRECTON.z + position.z / scale), new Vec2(0, 0));
shader.loadProjectionMatrix(GameCamera.projection_primary);
shader.stop();
texture.bind(0);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glDisable(GL11.GL_CULL_FACE);
GL11.glDepthMask(false);
}
示例15: glDepthMask
import org.lwjgl.opengl.GL11; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.opengl.renderer.SGL#glDepthMask(boolean)
*/
public void glDepthMask(boolean mask) {
GL11.glDepthMask(mask);
}