Java Code Examples for org.lwjgl.opengl.GL11#glPolygonOffset()

The following examples show how to use org.lwjgl.opengl.GL11#glPolygonOffset() . 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: MixinRenderEntityItem.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("HEAD"))
private void injectChamsPre(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getItemsValue().get()) {
        GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPolygonOffset(1.0F, -1000000F);
    }
}
 
Example 2
Source File: MixinRenderEntityItem.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("RETURN"))
private void injectChamsPost(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getItemsValue().get()) {
        GL11.glPolygonOffset(1.0F, 1000000F);
        GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
    }
}
 
Example 3
Source File: MixinTileEntityChestRenderer.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "renderTileEntityAt", at = @At("HEAD"))
private void injectChamsPre(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getChestsValue().get()) {
        GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPolygonOffset(1.0F, -1000000F);
    }
}
 
Example 4
Source File: MixinTileEntityChestRenderer.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "renderTileEntityAt", at = @At("RETURN"))
private void injectChamsPost(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getChestsValue().get()) {
        GL11.glPolygonOffset(1.0F, 1000000F);
        GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
    }
}
 
Example 5
Source File: MixinRendererLivingEntity.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("HEAD"))
private <T extends EntityLivingBase> void injectChamsPre(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getTargetsValue().get() && EntityUtils.isSelected(entity, false)) {
        GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPolygonOffset(1.0F, -1000000F);
    }
}
 
Example 6
Source File: MixinRendererLivingEntity.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("RETURN"))
private <T extends EntityLivingBase> void injectChamsPost(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getTargetsValue().get() && EntityUtils.isSelected(entity, false)) {
        GL11.glPolygonOffset(1.0F, 1000000F);
        GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
    }
}
 
Example 7
Source File: MixinRenderEntityItem.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("HEAD"))
private void injectChamsPre(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getItemsValue().get()) {
        GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPolygonOffset(1.0F, -1000000F);
    }
}
 
Example 8
Source File: MixinRenderEntityItem.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("RETURN"))
private void injectChamsPost(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getItemsValue().get()) {
        GL11.glPolygonOffset(1.0F, 1000000F);
        GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
    }
}
 
Example 9
Source File: MixinTileEntityChestRenderer.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "renderTileEntityAt", at = @At("HEAD"))
private void injectChamsPre(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getChestsValue().get()) {
        GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPolygonOffset(1.0F, -1000000F);
    }
}
 
Example 10
Source File: MixinTileEntityChestRenderer.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "renderTileEntityAt", at = @At("RETURN"))
private void injectChamsPost(CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getChestsValue().get()) {
        GL11.glPolygonOffset(1.0F, 1000000F);
        GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
    }
}
 
Example 11
Source File: MixinRendererLivingEntity.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("HEAD"))
private <T extends EntityLivingBase> void injectChamsPre(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getTargetsValue().get() && EntityUtils.isSelected(entity, false)) {
        GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
        GL11.glPolygonOffset(1.0F, -1000000F);
    }
}
 
Example 12
Source File: MixinRendererLivingEntity.java    From LiquidBounce with GNU General Public License v3.0 5 votes vote down vote up
@Inject(method = "doRender", at = @At("RETURN"))
private <T extends EntityLivingBase> void injectChamsPost(T entity, double x, double y, double z, float entityYaw, float partialTicks, CallbackInfo callbackInfo) {
    final Chams chams = (Chams) LiquidBounce.moduleManager.getModule(Chams.class);

    if (chams.getState() && chams.getTargetsValue().get() && EntityUtils.isSelected(entity, false)) {
        GL11.glPolygonOffset(1.0F, 1000000F);
        GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
    }
}
 
Example 13
Source File: RenderWitherCat.java    From EnderZoo with Creative Commons Zero v1.0 Universal 5 votes vote down vote up
@Override
public void doRenderLayer(EntityWitherCat cat, float p_177201_2_, float p_177201_3_, float p_177201_4_, float p_177201_5_, float p_177201_6_,
    float p_177201_7_, float p_177201_8_) {

  float blendFactor = 1.0F;
  float scale = cat.getScale();
  blendFactor = 1 - (cat.getAngryScale() - scale);

  if (blendFactor > 0) {
    bindTexture(angryTexture);

    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_CONSTANT_ALPHA, GL11.GL_ONE_MINUS_CONSTANT_ALPHA);

    GL14.glBlendColor(1.0f, 1.0f, 1.0f, blendFactor);

    GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
    GL11.glPolygonOffset(-1, -1);

    char c0 = 61680;
    int j = c0 % 65536;
    int k = c0 / 65536;
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F);
    GL11.glEnable(GL11.GL_LIGHTING);

    getMainModel().render(cat, p_177201_2_, p_177201_3_, p_177201_5_, p_177201_6_, p_177201_7_, p_177201_8_);
    setLightmap(cat);
  }

}