當前位置: 首頁>>代碼示例>>Java>>正文


Java GL14.glBlendColor方法代碼示例

本文整理匯總了Java中org.lwjgl.opengl.GL14.glBlendColor方法的典型用法代碼示例。如果您正苦於以下問題:Java GL14.glBlendColor方法的具體用法?Java GL14.glBlendColor怎麽用?Java GL14.glBlendColor使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.lwjgl.opengl.GL14的用法示例。


在下文中一共展示了GL14.glBlendColor方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: renderItemGlow

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
public void renderItemGlow(EntityLivingBase entity, ItemStack drop, ItemCameraTransforms.TransformType transform, EnumHandSide hand,
        int glowColor) {

    // enchantments mess up the rendering
    ItemStack drop2 = drop.copy();
    if (drop2.hasEffect()) {
        removeEnch(drop2.getTagCompound());
    }
    float red = (glowColor >> 16 & 255) / 255.0F;
    float green = (glowColor >> 8 & 255) / 255.0F;
    float blue = (glowColor & 255) / 255.0F;
    float alpha = 0.2F;

    pushMatrix();
    disableLighting();

    GL14.glBlendColor(red, green, blue, alpha);

    RenderItem renderItem = Minecraft.getMinecraft().getRenderItem();
    ((IRenderItem) renderItem).useTransparency(true);

    scale(1.1, 1.1, 1.1);

    translate(0, .01, .01);
    renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT);
    translate(.01, -.01, -.02);
    renderItem.renderItem(drop, entity, transform, hand == EnumHandSide.LEFT);

    ((IRenderItem) renderItem).useTransparency(false);
    enableLighting();
    popMatrix();

    // I hate rendering
}
 
開發者ID:MineLittlePony,項目名稱:MineLittlePony,代碼行數:35,代碼來源:LayerHeldPonyItem.java

示例2: doRenderLayer

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
@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);
  }

}
 
開發者ID:SleepyTrousers,項目名稱:EnderZoo,代碼行數:31,代碼來源:RenderWitherCat.java

示例3: renderItemLabel

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
private void renderItemLabel(@Nonnull ItemStack itemLabel, double globalScale) {
  if (!itemLabel.isEmpty()) {
    RenderManager renderManager = Minecraft.getMinecraft().getRenderManager();
    RenderItem itemRenderer = Minecraft.getMinecraft().getRenderItem();

    GlStateManager.pushMatrix();
    GlStateManager.translate(0.5f, 0.75f, 0.5f);
    // TODO: This doesn't work that well with 3D items, find a rotation that does
    GlStateManager.rotate(-renderManager.playerViewY, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate((renderManager.options.thirdPersonView == 2 ? -1 : 1) * renderManager.playerViewX, 1.0F, 0.0F, 0.0F);
    GlStateManager.scale(globalScale, globalScale, globalScale);
    GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);

    RenderHelper.enableStandardItemLighting();

    IBakedModel bakedmodel = itemRenderer.getItemModelWithOverrides(itemLabel, (World) null, (EntityLivingBase) null);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_CONSTANT_COLOR, GlStateManager.SourceFactor.ONE.factor,
        GlStateManager.DestFactor.ZERO.factor);
    GL14.glBlendColor(itemBlend.x, itemBlend.y, itemBlend.z, itemBlend.w);
    bakedmodel = ForgeHooksClient.handleCameraTransforms(bakedmodel, ItemCameraTransforms.TransformType.GUI, false);
    itemRenderer.renderItem(itemLabel, NullHelper.notnullF(bakedmodel, "handleCameraTransforms returned null!"));

    RenderHelper.disableStandardItemLighting();

    GL14.glBlendColor(1, 1, 1, 1);
    GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    GlStateManager.popMatrix();
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:31,代碼來源:TravelEntitySpecialRenderer.java

示例4: renderBlock

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
public void renderBlock(@Nonnull BlockPos pos, IBlockAccess blockAccess, double globalScale, boolean highlight) {
  VertexBuffer tes = Tessellator.getInstance().getBuffer();
  BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();

  GlStateManager.pushMatrix();
  GlStateManager.translate(0.5f, 0.5f, 0.5f);
  GlStateManager.scale(globalScale, globalScale, globalScale);
  GlStateManager.translate(-0.5f, -0.5f, -0.5f);
  IBlockState state = blockAccess.getBlockState(pos).getActualState(blockAccess, pos);
  IBakedModel ibakedmodel = blockrendererdispatcher.getModelForState(state);
  state = state.getBlock().getExtendedState(state, blockAccess, pos);

  tes.setTranslation(-pos.getX(), -pos.getY(), -pos.getZ());
  Vector4f color = highlight ? selectedBlockBlend : blockBlend;

  GlStateManager.color(1, 1, 1, 1);
  GlStateManager.tryBlendFuncSeparate(GL11.GL_SRC_ALPHA, GL11.GL_CONSTANT_COLOR, GlStateManager.SourceFactor.ONE.factor,
      GlStateManager.DestFactor.ZERO.factor);
  GL14.glBlendColor(color.x, color.y, color.z, color.w);

  tes.begin(GL11.GL_QUADS, DefaultVertexFormats.BLOCK);
  for (BlockRenderLayer layer : BlockRenderLayer.values()) {
    if (state.getBlock().canRenderInLayer(state, NullHelper.notnullJ(layer, "BlockRenderLayer value was null!"))) {
      ForgeHooksClient.setRenderLayer(layer);
      blockrendererdispatcher.getBlockModelRenderer().renderModel(blockAccess, ibakedmodel, state, pos, tes, false);
    }
  }
  ForgeHooksClient.setRenderLayer(null);
  Tessellator.getInstance().draw();

  GL14.glBlendColor(1, 1, 1, 1);
  GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
  tes.setTranslation(0, 0, 0);

  GlStateManager.popMatrix();
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:37,代碼來源:TravelEntitySpecialRenderer.java

示例5: setGlStateForPass

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
private void setGlStateForPass(int layer, boolean isNeighbour) {

    GlStateManager.color(1, 1, 1);
    if (isNeighbour) {

      GlStateManager.enableDepth();
      GlStateManager.enableBlend();
      float alpha = 1f;
      float col = 1f;

      GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_CONSTANT_COLOR);
      GL14.glBlendColor(col, col, col, alpha);
      return;
    }

    if (layer == 0) {
      GlStateManager.enableDepth();
      GlStateManager.disableBlend();
      GlStateManager.depthMask(true);
    } else {
      GlStateManager.enableBlend();
      GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
      GlStateManager.depthMask(false);

    }

  }
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:28,代碼來源:IoConfigRenderer.java

示例6: glBlendColor

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
@Override
public void glBlendColor(float red, float green, float blue, float alpha) {
	GL14.glBlendColor(red, green, blue, alpha);
}
 
開發者ID:surgeplay,項目名稱:glow,代碼行數:5,代碼來源:GLCore.java

示例7: glBlendColor

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
public void glBlendColor (float red, float green, float blue, float alpha) {
	GL14.glBlendColor(red, green, blue, alpha);
}
 
開發者ID:Arcnor,項目名稱:gdx-backend-jglfw,代碼行數:4,代碼來源:JglfwGL20.java

示例8: glBlendColor

import org.lwjgl.opengl.GL14; //導入方法依賴的package包/類
@Override
public void glBlendColor(float red, float green, float blue, float alpha) {
  GL14.glBlendColor(red, green, blue, alpha);
}
 
開發者ID:playn,項目名稱:playn,代碼行數:5,代碼來源:LWJGLGL20.java


注:本文中的org.lwjgl.opengl.GL14.glBlendColor方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。