int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); spinningCube.render(1F / 16F);
public static void disableLightmap() { lastLightMapX = OpenGlHelper.lastBrightnessX; lastLightMapY = OpenGlHelper.lastBrightnessY; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240f, 240f); }
/** * Render an item in 2D. */ public static void renderItem2d( ItemStack itemStack, float scale ) { if( !itemStack.isEmpty() ) { OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, 240.f, 240.0f ); GlStateManager.pushMatrix(); // The Z-scaling by 0.0001 causes the model to be visually "flattened" // This cannot replace a proper projection, but it's cheap and gives the desired // effect at least from head-on GlStateManager.scale( scale / 32.0f, scale / 32.0f, 0.0001f ); // Position the item icon at the top middle of the panel GlStateManager.translate( -8, -11, 0 ); RenderItem renderItem = Minecraft.getMinecraft().getRenderItem(); renderItem.renderItemAndEffectIntoGUI( itemStack, 0, 0 ); GlStateManager.popMatrix(); } }
@Override @SideOnly(Side.CLIENT) public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); Helper.rotateIfSneaking(player); boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty(); GlStateManager.rotate(180F, 1F, 0F, 0F); GlStateManager.translate(-0.26F, -0.4F, armor ? 0.2F : 0.15F); GlStateManager.scale(0.5F, 0.5F, 0.5F); for(TextureAtlasSprite icon : new TextureAtlasSprite[] { MiscellaneousIcons.INSTANCE.bloodPendantChain, MiscellaneousIcons.INSTANCE.bloodPendantGem }) { float f = icon.getMinU(); float f1 = icon.getMaxU(); float f2 = icon.getMinV(); float f3 = icon.getMaxV(); IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 32F); Color color = new Color(Minecraft.getMinecraft().getItemColors().colorMultiplier(stack, 1)); GL11.glColor3ub((byte) color.getRed(), (byte) color.getGreen(), (byte) color.getBlue()); int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); } GL11.glColor3ub((byte) 255, (byte) 255, (byte) 255); } }
int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); GlStateManager.color(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha);
protected int setPixieBrightness(EntityPixie par1EntityPixie, int par2, float par3) { if (par2 != 0) return -1; else { bindTexture(getEntityTexture(par1EntityPixie)); float f1 = 1.0F; GlStateManager.enableBlend(); GlStateManager.disableAlpha(); GlStateManager.blendFunc(GL11.GL_ONE, GL11.GL_ONE); if (par1EntityPixie.isInvisible()) GlStateManager.depthMask(false); else GlStateManager.depthMask(true); char c0 = 61680; int j = c0 % 65536; int k = c0 / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, j / 1.0F, k / 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); GlStateManager.color(1.0F, 1.0F, 1.0F, f1); return 1; } }
rx = 20F; ry = -(float) ((Math.sin((double) (player.ticksExisted + partialTicks) * (flying ? 0.4F : 0.2F)) + 0.6F) * (flying ? 30F : 5F)); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); break; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); h = -0.1F; rz = 0F; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); rz = 180F; rx = 0F; GlStateManager.popMatrix(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lbx, lby);
int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); GlStateManager.color(0.6F + (float) ((Math.cos((ClientTickHandler.ticksInGame + f) / 6D) + 1D) / 5D), 0.1F, 0.9F, alpha);
/** * Configure the light map so that whatever is rendered next is rendered at * full brightness, regardless of environment brightness. Useful for rendering * overlays that should be emissive to also be visible in the dark. */ @SideOnly(Side.CLIENT) public static void ignoreLighting() { OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); }
protected void enableLighting(int b) { int u = b % 65536; int v = b / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, u, v); GlStateManager.enableLighting(); } }
@Override @SideOnly(Side.CLIENT) public void onPlayerBaubleRender(ItemStack stack, EntityPlayer player, RenderType type, float partialTicks) { if(type == RenderType.BODY) { Helper.rotateIfSneaking(player); boolean armor = !player.getItemStackFromSlot(EntityEquipmentSlot.CHEST).isEmpty(); GlStateManager.translate(0F, armor ? -0.07F : -0.01F, 0F); float s = 1F / 16F; GlStateManager.scale(s, s, s); if(model == null) model = new ModelCloak(); GlStateManager.enableLighting(); GlStateManager.enableRescaleNormal(); Minecraft.getMinecraft().renderEngine.bindTexture(getCloakTexture()); model.render(1F); int light = 15728880; int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); Minecraft.getMinecraft().renderEngine.bindTexture(getCloakGlowTexture()); model.render(1F); } }
float f3 = icon.getMaxV(); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); GlStateManager.disableLighting(); IconHelper.renderIconIn3D(Tessellator.getInstance(), f1, f2, f, f3, icon.getIconWidth(), icon.getIconHeight(), 1F / 16F);
public static void setupLightmapCoords(@Nonnull BlockPos pos, @Nonnull World world) { float f = world.getLight(pos); int l = RenderUtil.getLightBrightnessForSkyBlocks(world, pos, 0); int l1 = l % 65536; int l2 = l / 65536; GlStateManager.color(f, f, f); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, l1, l2); }
int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); Minecraft.getMinecraft().getRenderItem().renderItem(stack, ItemCameraTransforms.TransformType.NONE); GlStateManager.popMatrix();
int lightmapX = light % 65536; int lightmapY = light / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lightmapX, lightmapY); float alpha = (float) Math.sin(ClientTickHandler.ticksInGame / 20D) / 2F + 0.5F; GlStateManager.color(1F, 1F, 1F, alpha + 0.183F);
private void setLightmap(EntityPlayerSP player) { int i = this.mc.world.getCombinedLight(new BlockPos(player.posX, player.posY + (double) player.getEyeHeight(), player.posZ), 0); float f = (float) (i & 65535); float f1 = (float) (i >> 16); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f, f1); }
private void renderTotemIcon(EntityTotemOfHolding entity) { OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); Minecraft mc = Minecraft.getMinecraft(); mc.renderEngine.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE); AtlasSpriteHelper.renderIconThicc(TotemOfHolding.totemSprite, 1F / 16F); }
public void fixLighting(TileEntity te) { int ambLight = getWorld().getCombinedLight(te.getPos().offset(EnumFacing.UP), 0); if (ambLight == 0) { ambLight = 15728656;//if there is a block above blocking light, dont make it dark } int lu = ambLight % 65536; int lv = ambLight / 65536; OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lu / 1.0F, lv / 1.0F); //end of 'fix lighting' }
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); GlStateManager.shadeModel(GL11.GL_SMOOTH); OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240, 240); GlStateManager.disableLighting(); GlStateManager.disableCull();
final int var12 = br / 65536; OpenGlHelper.setLightmapTextureCoords( OpenGlHelper.lightmapTexUnit, var11, var12 );