本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.clearDepth方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.clearDepth方法的具体用法?Java GlStateManager.clearDepth怎么用?Java GlStateManager.clearDepth使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.clearDepth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: framebufferClear
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void framebufferClear()
{
this.bindFramebuffer(true);
GlStateManager.clearColor(this.framebufferColor[0], this.framebufferColor[1], this.framebufferColor[2], this.framebufferColor[3]);
int i = 16384;
if (this.useDepth)
{
GlStateManager.clearDepth(1.0D);
i |= 256;
}
GlStateManager.clear(i);
this.unbindFramebuffer();
}
示例2: onRenderWorld
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@SubscribeEvent(priority = EventPriority.LOWEST)
public void onRenderWorld(RenderWorldLastEvent event) {
if(renderers != null) try {
GlStateManager.pushMatrix();
GlStateManager.disableTexture2D();
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
if(!clear_buffer.get())
GlStateManager.disableDepth();
else {
GlStateManager.clearDepth(1.f);
GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);
}
final boolean aa_enabled = anti_aliasing.get();
final int aa_max = anti_aliasing_max.get();
GlStateManager.glEnableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.glEnableClientState(GL11.GL_COLOR_ARRAY);
renderers.forEach((chk, info) -> {
if (info.isVboPresent() && info.isRendering()) {
if(aa_enabled && (aa_max == 0 || info.getRenderCount() <= aa_max))
GL11.glEnable(GL11.GL_LINE_SMOOTH);
GlStateManager.pushMatrix();
BlockPos pos = chk.getPosition();
GlStateManager.translate(
(double) pos.getX() - renderingOffset.x,
(double) pos.getY() - renderingOffset.y,
(double) pos.getZ() - renderingOffset.z
);
chk.multModelviewMatrix();
info.getVbo().bindBuffer();
GlStateManager.glVertexPointer(
DefaultVertexFormats.POSITION_3F.getElementCount(),
DefaultVertexFormats.POSITION_3F.getType().getGlConstant(),
DefaultVertexFormats.POSITION_3F.getSize() + DefaultVertexFormats.COLOR_4UB.getSize(),
0
);
GlStateManager.glColorPointer(
DefaultVertexFormats.COLOR_4UB.getElementCount(),
DefaultVertexFormats.COLOR_4UB.getType().getGlConstant(),
DefaultVertexFormats.POSITION_3F.getSize() + DefaultVertexFormats.COLOR_4UB.getSize(),
DefaultVertexFormats.POSITION_3F.getSize()
);
info.getVbo().drawArrays(GL11.GL_LINES);
GlStateManager.popMatrix();
GL11.glDisable(GL11.GL_LINE_SMOOTH);
info.setRendering(false);
}
});
GL11.glDisable(GL11.GL_LINE_SMOOTH);
GlStateManager.glDisableClientState(GL11.GL_VERTEX_ARRAY);
GlStateManager.glDisableClientState(GL11.GL_COLOR_ARRAY);
OpenGlHelper.glBindBuffer(OpenGlHelper.GL_ARRAY_BUFFER, 0);
GlStateManager.shadeModel(GL11.GL_FLAT);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.enableCull();
GlStateManager.popMatrix();
} catch (Exception e) {
handleException(null, e);
}
}