本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper.lastBrightnessY方法的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper.lastBrightnessY方法的具体用法?Java OpenGlHelper.lastBrightnessY怎么用?Java OpenGlHelper.lastBrightnessY使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.OpenGlHelper
的用法示例。
在下文中一共展示了OpenGlHelper.lastBrightnessY方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderStack
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
@Override
public void renderStack(double x, double y, double z, float partialTicks) {
float tick = RenderHelper.getRenderWorldTime(partialTicks);
final float prevU = OpenGlHelper.lastBrightnessX;
final float prevV = OpenGlHelper.lastBrightnessY;
ItemStack stack = SpecialModelRenderer.getTempItemRenderer();
if(!stack.isEmpty()) {
GlStateManager.pushMatrix();
GLHelper.lightMap(255F, 255F);
GlStateManager.translate(x + 0.5D, y + 0.38D, z + 0.5D);
GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
RenderHelper.renderItemStack(stack);
GlStateManager.popMatrix();
}
GLHelper.disableDepth();
renderModel(tick, x, y, z);
GLHelper.enableDepth();
GLHelper.lightMap(prevU, prevV);
}
示例2: renderLightMap
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void renderLightMap(float skullRotation, float skullPitch, EntityLivingBase entity) {
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
GlStateManager.depthMask(true);
float brightnessX = OpenGlHelper.lastBrightnessX;
float brightnessY = OpenGlHelper.lastBrightnessY;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680, 0);
if (entity != null && entity instanceof EntityLivingBase) {
render(skullRotation, skullPitch, entity);
}
else {
render(skullRotation, skullPitch, null);
}
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, brightnessX, brightnessY);
GlStateManager.disableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.popMatrix();
}
示例3: renderTile
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
@Override
void renderTile(TileQuantumMirror mirror, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
float tick = RenderHelper.getRenderWorldTime(partialTicks);
int layer = MinecraftForgeClient.getRenderPass();
final float prevU = OpenGlHelper.lastBrightnessX;
final float prevV = OpenGlHelper.lastBrightnessY;
switch(layer) {
case 0:
Optional<UUID> optional = mirror.getKey();
if(optional.isPresent()) {
ItemStack stack = QuantumHandler.getEntanglementStack(optional.get(), 0);
if(stack.isEmpty()) break;
GlStateManager.pushMatrix();
GLHelper.lightMap(255F, 255F);
GlStateManager.translate(x + 0.5, y + 0.38, z + 0.5);
GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
RenderHelper.renderItemStack(stack);
GlStateManager.popMatrix();
}
break;
case 1:
renderModel(tick, x, y, z);
break;
}
GLHelper.lightMap(prevU, prevV);
}
示例4: renderModel
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
private void renderModel(EnumFacing facing, double x, double y, double z, float partialTicks) {
float tick = RenderHelper.getRenderWorldTime(partialTicks);
final float prevU = OpenGlHelper.lastBrightnessX;
final float prevV = OpenGlHelper.lastBrightnessY;
bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
//Top
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5D, y + 0.5D, z + 0.5D);
if(facing != null && facing != EnumFacing.UP && facing != EnumFacing.DOWN) {
GlStateManager.rotate(90F, facing == EnumFacing.NORTH || facing == EnumFacing.SOUTH ? 1F : 0F, 0F, facing == EnumFacing.EAST || facing == EnumFacing.WEST ? 1F : 0F);
}
GlStateManager.pushMatrix();
GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
BlockBaker.render(BlockBaker.VACUUM_TOP);
GlStateManager.popMatrix();
//Middle
GlStateManager.disableLighting();
GLHelper.lightMap(255F, 255F);
BlockBaker.render(BlockBaker.VACUUM_PIECE);
GLHelper.lightMap(prevU, prevV);
GlStateManager.enableLighting();
//Bottom
GlStateManager.pushMatrix();
GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, -1F, 0F);
BlockBaker.render(BlockBaker.VACUUM_BOTTOM);
GlStateManager.popMatrix();
GlStateManager.popMatrix();
}
示例5: renderLightMapOnPlayerHead
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
public void renderLightMapOnPlayerHead(World world, EntityLivingBase wearer) {
GlStateManager.pushMatrix();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_ONE, GL11.GL_ONE);
GlStateManager.depthMask(true);
float brightnessX = OpenGlHelper.lastBrightnessX;
float brightnessY = OpenGlHelper.lastBrightnessY;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680, 0);
head.render(0.01F);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, brightnessX, brightnessY);
GlStateManager.disableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.popMatrix();
}
示例6: renderModel
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
private void renderModel(@Nullable EnumFacing facing, float tick, boolean active, double x, double y, double z, float partialTicks) {
final float prevU = OpenGlHelper.lastBrightnessX;
final float prevV = OpenGlHelper.lastBrightnessY;
bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
GlStateManager.pushMatrix();
GlStateManager.translate(x + 0.5D, y + 0.5D, z + 0.5D);
if(facing != null && facing != EnumFacing.DOWN) {
switch(facing) {
case UP:
GlStateManager.rotate(180F, 1F, 0F, 0F);
break;
case NORTH:
GlStateManager.rotate(90F, 1F, 0F, 0F);
break;
case SOUTH:
GlStateManager.rotate(90F, -1F, 0F, 0F);
break;
case WEST:
GlStateManager.rotate(90F, 0F, 0F, -1F);
break;
case EAST:
GlStateManager.rotate(90F, 0F, 0F, 1F);
break;
}
}
//Top & Bottom
GlStateManager.pushMatrix();
GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, 1F, 0F);
BlockBaker.render(BlockBaker.TRANSLOCATOR_BASE);
GlStateManager.popMatrix();
if(active) {
GlStateManager.disableLighting();
GLHelper.lightMap(255F, 255F);
}
//Middle
GlStateManager.pushMatrix();
GlStateManager.rotate(partialTicks + tick * 0.5F % 360F, 0F, -1F, 0F);
BlockBaker.render(BlockBaker.TRANSLOCATOR_CENTER);
GlStateManager.popMatrix();
//Piece
GlStateManager.pushMatrix();
GlStateManager.translate(0, 0.25F, 0F);
RenderHelper.makeUpDownTranslation(tick, 0.05F, 1F, 0F);
/*--- Outwards ---*/
GlStateManager.pushMatrix();
GlStateManager.scale(0.425F, 0.425F, 0.425F);
GlStateManager.rotate(partialTicks + tick * 0.75F % 360F, 0F, 1F, 0F);
GlStateManager.rotate(partialTicks + tick * 0.75F % 720F, 1F, 0F, 0F);
GlStateManager.rotate(partialTicks + tick * 0.75F % 360F, 0F, 0F, 1F);
BlockBaker.render(BlockBaker.TRANSLOCATOR_PIECE_RING);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(0.75F, 0.75F, 0.75F);
GlStateManager.rotate(partialTicks + tick % 360F, 0F, -1F, 0F);
GlStateManager.rotate(partialTicks + tick % 720F, -1F, 0F, 0F);
GlStateManager.rotate(partialTicks + tick % 360F, 0F, 0F, -1F);
BlockBaker.render(BlockBaker.TRANSLOCATOR_PIECE_RING);
GlStateManager.popMatrix();
/*--- Inwards ---*/
GlStateManager.popMatrix();
if(active) {
GLHelper.lightMap(prevU, prevV);
GlStateManager.enableLighting();
}
GlStateManager.popMatrix();
}
示例7: renderModel
import net.minecraft.client.renderer.OpenGlHelper; //导入方法依赖的package包/类
private void renderModel(double x, double y, double z, float partialTicks) {
int tick = (int) Minecraft.getMinecraft().world.getTotalWorldTime();
GlStateManager.pushMatrix();
GlStateManager.disableCull();
GlStateManager.translate(x + 0.5D, y + 0.5D, z + 0.5D);
GlStateManager.rotate(tick % 360, 0, 1, tick % 720);
GlStateManager.rotate(30.0f * (float) Math.sin(Math.toRadians(partialTicks / 15f + tick / 15 % 360)), 1, 0, 0);
for(int layer = 0; layer < 3; layer++) {
float relativeTime = ((float) tick - ((float) layer * 145F)) * 0.05F;
float size = MathHelper.sin(relativeTime);
size = (size < 0 ? -size : size);
size += 0.2F;
size *= 0.4F;
double uvMin = 0.3125D;
SpriteLibrary.GRAVITY_INHIBITOR.bindManager();
RenderHelper.renderCube(size, uvMin, 1 - uvMin, uvMin, 1 - uvMin);
SpriteLibrary.GRAVITY_INHIBITOR_OVERLAY.bindManager();
Tuple<Double, Double> uv = SpriteLibrary.GRAVITY_INHIBITOR_OVERLAY.getUVFrame((int) ((float) tick * 0.45F));
double uOffset = SpriteLibrary.GRAVITY_INHIBITOR_OVERLAY.getU();
double u = uv.getFirst();
double vOffset = SpriteLibrary.GRAVITY_INHIBITOR_OVERLAY.getV();
double v = uv.getSecond();
double uMin = u + uvMin / 2F;
double uMax = u + uOffset - uvMin / 2F;
double vMin = v + uvMin / 4F;
double vMax = v + vOffset - uvMin / 4F;
final float prevU = OpenGlHelper.lastBrightnessX;
final float prevV = OpenGlHelper.lastBrightnessY;
GlStateManager.disableLighting();
GLHelper.lightMap(255F, 255F);
RenderHelper.renderCube(size, uMin, uMax, vMin, vMax);
GLHelper.lightMap(prevU, prevV);
GlStateManager.enableLighting();
}
GlStateManager.enableCull();
GlStateManager.popMatrix();
}