本文整理汇总了Java中net.minecraft.client.renderer.GlStateManager.depthMask方法的典型用法代码示例。如果您正苦于以下问题:Java GlStateManager.depthMask方法的具体用法?Java GlStateManager.depthMask怎么用?Java GlStateManager.depthMask使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.GlStateManager
的用法示例。
在下文中一共展示了GlStateManager.depthMask方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void doRenderLayer(EntityEvolvedEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
GlStateManager.disableLighting();
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
endermanRenderer.setLightmap(entitylivingbaseIn);
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例2: renderShulkerBox
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public static void renderShulkerBox(ItemStack stack, float lidProgress) {
ModelShulker shulkerBoxModel = new ModelShulker();
GlStateManager.enableDepth();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
GlStateManager.disableCull();
String color = getShulkerColorName(stack);
RenderUtils.bindTexture(new ResourceLocation("ironchest", "textures/model/shulker/" + color + "/shulker_" + color + "" + getShulkerBoxType(stack).modelTexture));
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.translate(0 + 0.5F, 0 + 1.5F, 0 + 0.5F);
GlStateManager.scale(1.0F, -1.0F, -1.0F);
GlStateManager.translate(0.0F, 1.0F, 0.0F);
GlStateManager.scale(0.9995F, 0.9995F, 0.9995F);
GlStateManager.translate(0.0F, -1.0F, 0.0F);
shulkerBoxModel.base.render(0.0625F);
GlStateManager.translate(0.0F, -lidProgress * 0.5F, 0.0F);
GlStateManager.rotate(270.0F * lidProgress, 0.0F, 1.0F, 0.0F);
shulkerBoxModel.lid.render(0.0625F);
GlStateManager.enableCull();
GlStateManager.disableRescaleNormal();
GlStateManager.popMatrix();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例3: renderPumpkinOverlay
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void renderPumpkinOverlay(ScaledResolution scaledRes)
{
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.disableAlpha();
this.mc.getTextureManager().bindTexture(PUMPKIN_BLUR_TEX_PATH);
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例4: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void doRenderLayer(EntityFrienderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale) {
endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
GlStateManager.disableLighting();
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
endermanRenderer.setLightmap(entitylivingbaseIn);
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例5: renderPortal
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderPortal(float timeInPortal, ScaledResolution scaledRes)
{
if (timeInPortal < 1.0F)
{
timeInPortal = timeInPortal * timeInPortal;
timeInPortal = timeInPortal * timeInPortal;
timeInPortal = timeInPortal * 0.8F + 0.2F;
}
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal);
this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.PORTAL.getDefaultState());
float f = textureatlassprite.getMinU();
float f1 = textureatlassprite.getMinV();
float f2 = textureatlassprite.getMaxU();
float f3 = textureatlassprite.getMaxV();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例6: func_180474_b
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void func_180474_b(float p_180474_1_, ScaledResolution p_180474_2_) {
if (p_180474_1_ < 1.0F) {
p_180474_1_ = p_180474_1_ * p_180474_1_;
p_180474_1_ = p_180474_1_ * p_180474_1_;
p_180474_1_ = p_180474_1_ * 0.8F + 0.2F;
}
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
GlStateManager.color(1.0F, 1.0F, 1.0F, p_180474_1_);
this.mc.getTextureManager().bindTexture(TextureMap.locationBlocksTexture);
TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes()
.getTexture(Blocks.portal.getDefaultState());
float f = textureatlassprite.getMinU();
float f1 = textureatlassprite.getMinV();
float f2 = textureatlassprite.getMaxU();
float f3 = textureatlassprite.getMaxV();
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double) p_180474_2_.getScaledHeight(), -90.0D).tex((double) f, (double) f3)
.endVertex();
worldrenderer.pos((double) p_180474_2_.getScaledWidth(), (double) p_180474_2_.getScaledHeight(), -90.0D)
.tex((double) f2, (double) f3).endVertex();
worldrenderer.pos((double) p_180474_2_.getScaledWidth(), 0.0D, -90.0D).tex((double) f2, (double) f1)
.endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex((double) f, (double) f1).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例7: func_177183_a
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void func_177183_a(EntityLivingBase entitylivingbaseIn, T modelbaseIn, float p_177183_3_, float p_177183_4_, float p_177183_5_, float p_177183_6_, float p_177183_7_, float p_177183_8_, float p_177183_9_)
{
float f = (float)entitylivingbaseIn.ticksExisted + p_177183_5_;
this.renderer.bindTexture(ENCHANTED_ITEM_GLINT_RES);
GlStateManager.enableBlend();
GlStateManager.depthFunc(514);
GlStateManager.depthMask(false);
float f1 = 0.5F;
GlStateManager.color(f1, f1, f1, 1.0F);
for (int i = 0; i < 2; ++i)
{
GlStateManager.disableLighting();
GlStateManager.blendFunc(768, 1);
float f2 = 0.76F;
GlStateManager.color(0.5F * f2, 0.25F * f2, 0.8F * f2, 1.0F);
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
float f3 = 0.33333334F;
GlStateManager.scale(f3, f3, f3);
GlStateManager.rotate(30.0F - (float)i * 60.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.translate(0.0F, f * (0.001F + (float)i * 0.003F) * 20.0F, 0.0F);
GlStateManager.matrixMode(5888);
modelbaseIn.render(entitylivingbaseIn, p_177183_3_, p_177183_4_, p_177183_6_, p_177183_7_, p_177183_8_, p_177183_9_);
}
GlStateManager.matrixMode(5890);
GlStateManager.loadIdentity();
GlStateManager.matrixMode(5888);
GlStateManager.enableLighting();
GlStateManager.depthMask(true);
GlStateManager.depthFunc(515);
GlStateManager.disableBlend();
}
示例8: render
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
@Override
public void render(PortalTileEntity te, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
super.render(te, x, y, z, partialTicks, destroyStage, alpha);
if (te.getPortalSide() == null) {
return;
}
GlStateManager.pushMatrix();
GlStateManager.depthMask(true);
GlStateManager.enableBlend();
GlStateManager.disableLighting();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.bindTexture(portal);
long time = System.currentTimeMillis();
angle = (time / 400.0) % 360.0;
float scale = 1.0f;
int start = te.getStart();
if (start < 10) {
scale = start / 10.0f;
} else {
int timeout = te.getTimeout();
if (timeout < 10) {
scale = timeout / 10.0f;
}
}
Face face = faces[te.getPortalSide().ordinal()];
Face rface = revertedfaces[te.getPortalSide().ordinal()];
GlStateManager.translate((float) x + face.ox, (float) y + face.oy, (float) z + face.oz);
GlStateManager.scale(scale, scale, scale);
renderQuadBright(angle, face, rface);
GlStateManager.popMatrix();
}
示例9: renderParticle
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Renders the particle
*/
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
if (this.entity != null)
{
RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
rendermanager.setRenderPosition(Particle.interpPosX, Particle.interpPosY, Particle.interpPosZ);
float f = 0.42553192F;
float f1 = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge;
GlStateManager.depthMask(true);
GlStateManager.enableBlend();
GlStateManager.enableDepth();
GlStateManager.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
float f2 = 240.0F;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240.0F, 240.0F);
GlStateManager.pushMatrix();
float f3 = 0.05F + 0.5F * MathHelper.sin(f1 * (float)Math.PI);
GlStateManager.color(1.0F, 1.0F, 1.0F, f3);
GlStateManager.translate(0.0F, 1.8F, 0.0F);
GlStateManager.rotate(180.0F - entityIn.rotationYaw, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(60.0F - 150.0F * f1 - entityIn.rotationPitch, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(0.0F, -0.4F, -1.5F);
GlStateManager.scale(0.42553192F, 0.42553192F, 0.42553192F);
this.entity.rotationYaw = 0.0F;
this.entity.rotationYawHead = 0.0F;
this.entity.prevRotationYaw = 0.0F;
this.entity.prevRotationYawHead = 0.0F;
rendermanager.doRenderEntity(this.entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks, false);
GlStateManager.popMatrix();
GlStateManager.enableDepth();
}
}
示例10: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityEnderman entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.endermanRenderer.bindTexture(RES_ENDERMAN_EYES);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
GlStateManager.disableLighting();
GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
int i = 61680;
int j = 61680;
int k = 0;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 61680.0F, 0.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().entityRenderer.func_191514_d(true);
if (Config.isShaders())
{
Shaders.beginSpiderEyes();
}
Config.getRenderGlobal().renderOverlayEyes = true;
this.endermanRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
Config.getRenderGlobal().renderOverlayEyes = false;
Minecraft.getMinecraft().entityRenderer.func_191514_d(false);
this.endermanRenderer.setLightmap(entitylivingbaseIn, partialTicks);
GlStateManager.depthMask(true);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例11: renderEffect
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
private void renderEffect(IBakedModel model)
{
GlStateManager.depthMask(false);
GlStateManager.depthFunc(514);
GlStateManager.disableLighting();
GlStateManager.blendFunc(768, 1);
this.textureManager.bindTexture(RES_ITEM_GLINT);
GlStateManager.matrixMode(5890);
GlStateManager.pushMatrix();
GlStateManager.scale(8.0F, 8.0F, 8.0F);
float f = (float)(Minecraft.getSystemTime() % 3000L) / 3000.0F / 8.0F;
GlStateManager.translate(f, 0.0F, 0.0F);
GlStateManager.rotate(-50.0F, 0.0F, 0.0F, 1.0F);
this.renderModel(model, -8372020);
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.scale(8.0F, 8.0F, 8.0F);
float f1 = (float)(Minecraft.getSystemTime() % 4873L) / 4873.0F / 8.0F;
GlStateManager.translate(-f1, 0.0F, 0.0F);
GlStateManager.rotate(10.0F, 0.0F, 0.0F, 1.0F);
this.renderModel(model, -8372020);
GlStateManager.popMatrix();
GlStateManager.matrixMode(5888);
GlStateManager.blendFunc(770, 771);
GlStateManager.enableLighting();
GlStateManager.depthFunc(515);
GlStateManager.depthMask(true);
this.textureManager.bindTexture(TextureMap.locationBlocksTexture);
}
示例12: renderPortal
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
protected void renderPortal(float timeInPortal, ScaledResolution scaledRes)
{
if (timeInPortal < 1.0F)
{
timeInPortal = timeInPortal * timeInPortal;
timeInPortal = timeInPortal * timeInPortal;
timeInPortal = timeInPortal * 0.8F + 0.2F;
}
GlStateManager.disableAlpha();
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.color(1.0F, 1.0F, 1.0F, timeInPortal);
this.mc.getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
TextureAtlasSprite textureatlassprite = this.mc.getBlockRendererDispatcher().getBlockModelShapes().getTexture(Blocks.PORTAL.getDefaultState());
float f = textureatlassprite.getMinU();
float f1 = textureatlassprite.getMinV();
float f2 = textureatlassprite.getMaxU();
float f3 = textureatlassprite.getMaxV();
Tessellator tessellator = Tessellator.getInstance();
VertexBuffer vertexbuffer = tessellator.getBuffer();
vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
vertexbuffer.pos(0.0D, (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f, (double)f3).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), (double)scaledRes.getScaledHeight(), -90.0D).tex((double)f2, (double)f3).endVertex();
vertexbuffer.pos((double)scaledRes.getScaledWidth(), 0.0D, -90.0D).tex((double)f2, (double)f1).endVertex();
vertexbuffer.pos(0.0D, 0.0D, -90.0D).tex((double)f, (double)f1).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.enableAlpha();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
}
示例13: doRenderLayer
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void doRenderLayer(EntityDragon entitylivingbaseIn, float p_177141_2_, float p_177141_3_, float partialTicks, float p_177141_5_, float p_177141_6_, float p_177141_7_, float scale)
{
if (entitylivingbaseIn.deathTicks > 0)
{
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
RenderHelper.disableStandardItemLighting();
float f = ((float)entitylivingbaseIn.deathTicks + partialTicks) / 200.0F;
float f1 = 0.0F;
if (f > 0.8F)
{
f1 = (f - 0.8F) / 0.2F;
}
Random random = new Random(432L);
GlStateManager.disableTexture2D();
GlStateManager.shadeModel(7425);
GlStateManager.enableBlend();
GlStateManager.blendFunc(770, 1);
GlStateManager.disableAlpha();
GlStateManager.enableCull();
GlStateManager.depthMask(false);
GlStateManager.pushMatrix();
GlStateManager.translate(0.0F, -1.0F, -2.0F);
for (int i = 0; (float)i < (f + f * f) / 2.0F * 60.0F; ++i)
{
GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 0.0F, 1.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F, 0.0F, 1.0F, 0.0F);
GlStateManager.rotate(random.nextFloat() * 360.0F + f * 90.0F, 0.0F, 0.0F, 1.0F);
float f2 = random.nextFloat() * 20.0F + 5.0F + f1 * 10.0F;
float f3 = random.nextFloat() * 2.0F + 1.0F + f1 * 2.0F;
worldrenderer.begin(6, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(0.0D, 0.0D, 0.0D).color(255, 255, 255, (int)(255.0F * (1.0F - f1))).endVertex();
worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
worldrenderer.pos(0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
worldrenderer.pos(0.0D, (double)f2, (double)(1.0F * f3)).color(255, 0, 255, 0).endVertex();
worldrenderer.pos(-0.866D * (double)f3, (double)f2, (double)(-0.5F * f3)).color(255, 0, 255, 0).endVertex();
tessellator.draw();
}
GlStateManager.popMatrix();
GlStateManager.depthMask(true);
GlStateManager.disableCull();
GlStateManager.disableBlend();
GlStateManager.shadeModel(7424);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.enableTexture2D();
GlStateManager.enableAlpha();
RenderHelper.enableStandardItemLighting();
}
}
示例14: loadShader
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
public void loadShader(float p_148042_1_)
{
this.preLoadShader();
this.framebufferIn.unbindFramebuffer();
float f = (float)this.framebufferOut.framebufferTextureWidth;
float f1 = (float)this.framebufferOut.framebufferTextureHeight;
GlStateManager.viewport(0, 0, (int)f, (int)f1);
this.manager.addSamplerTexture("DiffuseSampler", this.framebufferIn);
for (int i = 0; i < this.listAuxFramebuffers.size(); ++i)
{
this.manager.addSamplerTexture((String)this.listAuxNames.get(i), this.listAuxFramebuffers.get(i));
this.manager.getShaderUniformOrDefault("AuxSize" + i).set((float)((Integer)this.listAuxWidths.get(i)).intValue(), (float)((Integer)this.listAuxHeights.get(i)).intValue());
}
this.manager.getShaderUniformOrDefault("ProjMat").set(this.projectionMatrix);
this.manager.getShaderUniformOrDefault("InSize").set((float)this.framebufferIn.framebufferTextureWidth, (float)this.framebufferIn.framebufferTextureHeight);
this.manager.getShaderUniformOrDefault("OutSize").set(f, f1);
this.manager.getShaderUniformOrDefault("Time").set(p_148042_1_);
Minecraft minecraft = Minecraft.getMinecraft();
this.manager.getShaderUniformOrDefault("ScreenSize").set((float)minecraft.displayWidth, (float)minecraft.displayHeight);
this.manager.useShader();
this.framebufferOut.framebufferClear();
this.framebufferOut.bindFramebuffer(false);
GlStateManager.depthMask(false);
GlStateManager.colorMask(true, true, true, true);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_COLOR);
worldrenderer.pos(0.0D, (double)f1, 500.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)f, (double)f1, 500.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos((double)f, 0.0D, 500.0D).color(255, 255, 255, 255).endVertex();
worldrenderer.pos(0.0D, 0.0D, 500.0D).color(255, 255, 255, 255).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.colorMask(true, true, true, true);
this.manager.endShader();
this.framebufferOut.unbindFramebuffer();
this.framebufferIn.unbindFramebufferTexture();
for (Object object : this.listAuxFramebuffers)
{
if (object instanceof Framebuffer)
{
((Framebuffer)object).unbindFramebufferTexture();
}
}
}
示例15: renderVignette
import net.minecraft.client.renderer.GlStateManager; //导入方法依赖的package包/类
/**
* Renders a Vignette arount the entire screen that changes with light level.
*/
private void renderVignette(float p_180480_1_, ScaledResolution p_180480_2_)
{
if (Config.isVignetteEnabled())
{
p_180480_1_ = 1.0F - p_180480_1_;
p_180480_1_ = MathHelper.clamp_float(p_180480_1_, 0.0F, 1.0F);
WorldBorder worldborder = this.mc.theWorld.getWorldBorder();
float f = (float)worldborder.getClosestDistance(this.mc.thePlayer);
double d0 = Math.min(worldborder.getResizeSpeed() * (double)worldborder.getWarningTime() * 1000.0D, Math.abs(worldborder.getTargetSize() - worldborder.getDiameter()));
double d1 = Math.max((double)worldborder.getWarningDistance(), d0);
if ((double)f < d1)
{
f = 1.0F - (float)((double)f / d1);
}
else
{
f = 0.0F;
}
this.prevVignetteBrightness = (float)((double)this.prevVignetteBrightness + (double)(p_180480_1_ - this.prevVignetteBrightness) * 0.01D);
GlStateManager.disableDepth();
GlStateManager.depthMask(false);
GlStateManager.tryBlendFuncSeparate(0, 769, 1, 0);
if (f > 0.0F)
{
GlStateManager.color(0.0F, f, f, 1.0F);
}
else
{
GlStateManager.color(this.prevVignetteBrightness, this.prevVignetteBrightness, this.prevVignetteBrightness, 1.0F);
}
this.mc.getTextureManager().bindTexture(vignetteTexPath);
Tessellator tessellator = Tessellator.getInstance();
WorldRenderer worldrenderer = tessellator.getWorldRenderer();
worldrenderer.begin(7, DefaultVertexFormats.POSITION_TEX);
worldrenderer.pos(0.0D, (double)p_180480_2_.getScaledHeight(), -90.0D).tex(0.0D, 1.0D).endVertex();
worldrenderer.pos((double)p_180480_2_.getScaledWidth(), (double)p_180480_2_.getScaledHeight(), -90.0D).tex(1.0D, 1.0D).endVertex();
worldrenderer.pos((double)p_180480_2_.getScaledWidth(), 0.0D, -90.0D).tex(1.0D, 0.0D).endVertex();
worldrenderer.pos(0.0D, 0.0D, -90.0D).tex(0.0D, 0.0D).endVertex();
tessellator.draw();
GlStateManager.depthMask(true);
GlStateManager.enableDepth();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
}
}