本文整理匯總了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);
}
}