List of usage examples for org.lwjgl.opengl GL11 glStencilFunc
public static void glStencilFunc(@NativeType("GLenum") int func, @NativeType("GLint") int ref, @NativeType("GLuint") int mask)
From source file:playn.java.JavaGL20.java
License:Apache License
@Override public void glStencilFunc(int func, int ref, int mask) { GL11.glStencilFunc(func, ref, mask); }
From source file:processing.opengl.PLWJGL.java
License:Open Source License
@Override public void stencilFunc(int func, int ref, int mask) { GL11.glStencilFunc(func, ref, mask); }
From source file:tk.ivybits.engine.gl.GL.java
License:Open Source License
public static void glStencilFunc(int a, int b, int c) { GL11.glStencilFunc(a, b, c); }
From source file:vazkii.botania.client.core.helper.RenderHelper.java
License:Open Source License
public static void renderProgressPie(int x, int y, float progress, ItemStack stack) { Minecraft mc = Minecraft.getMinecraft(); mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); GlStateManager.clear(GL11.GL_DEPTH_BUFFER_BIT); GL11.glEnable(GL11.GL_STENCIL_TEST); GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false);/* ww w . ja v a 2s. co m*/ GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xFF); GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_KEEP, GL11.GL_KEEP); GL11.glStencilMask(0xFF); mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); mc.renderEngine.bindTexture(new ResourceLocation(LibResources.GUI_MANA_HUD)); int r = 10; int centerX = x + 8; int centerY = y + 8; int degs = (int) (360 * progress); float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F); GlStateManager.disableLighting(); GlStateManager.disableTexture2D(); GlStateManager.shadeModel(GL11.GL_SMOOTH); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.colorMask(true, true, true, true); GlStateManager.depthMask(true); GL11.glStencilMask(0x00); GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF); VertexBuffer buf = Tessellator.getInstance().getBuffer(); buf.begin(GL11.GL_TRIANGLE_FAN, DefaultVertexFormats.POSITION_COLOR); buf.pos(centerX, centerY, 0).color(0, 0.5F, 0.5F, a).endVertex(); for (int i = degs; i > 0; i--) { double rad = (i - 90) / 180F * Math.PI; buf.pos(centerX + Math.cos(rad) * r, centerY + Math.sin(rad) * r, 0).color(0F, 1F, 0.5F, a).endVertex(); } buf.pos(centerX, centerY, 0).color(0F, 1F, 0.5F, a).endVertex(); Tessellator.getInstance().draw(); GlStateManager.disableBlend(); GlStateManager.enableTexture2D(); GlStateManager.shadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_STENCIL_TEST); }
From source file:vazkii.psi.client.core.helper.PsiRenderHelper.java
public static void renderProgressPie(int x, int y, float progress, ItemStack stack) { Minecraft mc = Minecraft.getMinecraft(); mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); GlStateManager.clear(GL11.GL_DEPTH_BUFFER_BIT); GL11.glEnable(GL11.GL_STENCIL_TEST); GlStateManager.colorMask(false, false, false, false); GlStateManager.depthMask(false);/*ww w. jav a 2 s.c o m*/ GL11.glStencilFunc(GL11.GL_NEVER, 1, 0xFF); GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_KEEP, GL11.GL_KEEP); GL11.glStencilMask(0xFF); mc.getRenderItem().renderItemAndEffectIntoGUI(stack, x, y); int r = 10; int centerX = x + 8; int centerY = y + 8; int degs = (int) (360 * progress); float a = 0.5F + 0.2F * ((float) Math.cos((double) (ClientTickHandler.ticksInGame + ClientTickHandler.partialTicks) / 10) * 0.5F + 0.5F); GlStateManager.disableLighting(); GlStateManager.disableTexture2D(); GlStateManager.shadeModel(GL11.GL_SMOOTH); GlStateManager.enableBlend(); GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.colorMask(true, true, true, true); GlStateManager.depthMask(true); GL11.glStencilMask(0x00); GL11.glStencilFunc(GL11.GL_EQUAL, 1, 0xFF); GL11.glBegin(GL11.GL_TRIANGLE_FAN); GlStateManager.color(0F, 0.5F, 0.5F, a); GL11.glVertex2i(centerX, centerY); GlStateManager.color(0F, 1F, 0.5F, a); for (int i = degs; i > 0; i--) { double rad = (i - 90) / 180F * Math.PI; GL11.glVertex2d(centerX + Math.cos(rad) * r, centerY + Math.sin(rad) * r); } GL11.glVertex2i(centerX, centerY); GL11.glEnd(); GlStateManager.disableBlend(); GlStateManager.enableTexture2D(); GlStateManager.shadeModel(GL11.GL_FLAT); GL11.glDisable(GL11.GL_STENCIL_TEST); }
From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java
License:Open Source License
protected void prepareStencilBuffer() { GL11.glDrawBuffer(GL11.GL_BACK);/*from www . j a v a2s . c om*/ GL11.glEnable(GL11.GL_STENCIL_TEST); GL11.glStencilMask(0xff); GL11.glClearStencil(0); GL11.glClear(GL11.GL_STENCIL_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT // | GL11.GL_DEPTH_BUFFER_BIT); GL11.glStencilOp(GL11.GL_REPLACE, GL11.GL_REPLACE, GL11.GL_REPLACE); // to avoid interaction with stencil content GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01); }
From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java
License:Open Source License
public void prepareFrame() { if (this.mc.theWorld != null && !this.mc.skipRenderWorld) { if (reinitPending || isReinitRequired()) { reinit();/*w w w . j a v a 2s.c o m*/ } if (currentEye == Eye.LEFT ^ swapSides) { setupImageOne(); } else { setupImageTwo(); } } else { GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01); } }
From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java
License:Open Source License
protected void setupImage(int stencilFunc) { GL11.glDrawBuffer(GL11.GL_BACK);//from w ww . j a v a 2 s. c om GL11.glStencilFunc(stencilFunc, 1, 0x01); // Clear the screen and depth buffer GL11.glClear(GL11.GL_DEPTH_BUFFER_BIT);// | GL11.GL_COLOR_BUFFER_BIT); }
From source file:zsawyer.mods.stereoscopic3d.renderers.StencilingRenderer.java
License:Open Source License
public void cleanUpAfterFrame() { if (this.mc.theWorld != null && !this.mc.skipRenderWorld) { if (currentEye == Eye.LEFT) { GL11.glFlush();/*from w w w. j a v a 2 s. c o m*/ } else { GL11.glStencilFunc(GL11.GL_ALWAYS, 1, 0x01); } } }