本文整理汇总了Java中net.minecraft.client.renderer.OpenGlHelper类的典型用法代码示例。如果您正苦于以下问题:Java OpenGlHelper类的具体用法?Java OpenGlHelper怎么用?Java OpenGlHelper使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
OpenGlHelper类属于net.minecraft.client.renderer包,在下文中一共展示了OpenGlHelper类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: doRenderLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public void doRenderLayer(EntityIronGolem 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.getHoldRoseTick() != 0)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.rotate(5.0F + 180.0F * ((ModelIronGolem)this.ironGolemRenderer.getMainModel()).ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-0.9375F, -0.625F, -0.9375F);
float f = 0.5F;
GlStateManager.scale(f, -f, f);
int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.ironGolemRenderer.bindTexture(TextureMap.locationBlocksTexture);
blockrendererdispatcher.renderBlockBrightness(Blocks.red_flower.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例2: uploadFloatMatrix
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
private void uploadFloatMatrix()
{
switch (this.uniformType)
{
case 8:
OpenGlHelper.glUniformMatrix2(this.uniformLocation, true, this.uniformFloatBuffer);
break;
case 9:
OpenGlHelper.glUniformMatrix3(this.uniformLocation, true, this.uniformFloatBuffer);
break;
case 10:
OpenGlHelper.glUniformMatrix4(this.uniformLocation, true, this.uniformFloatBuffer);
}
}
示例3: doRenderLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
@Override
public void doRenderLayer(EntityCreeperween entity, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
this.renderEntity.bindTexture(CREEPERWEEN_EYES);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
GlStateManager.depthMask(true);
int i = 61680;
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.renderEntity.getMainModel().render(entity, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
i = entity.getBrightnessForRender();
j = i % 65536;
k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
this.renderEntity.setLightmap(entity);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
}
示例4: uploadInt
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
private void uploadInt()
{
switch (this.uniformType)
{
case 0:
OpenGlHelper.glUniform1(this.uniformLocation, this.uniformIntBuffer);
break;
case 1:
OpenGlHelper.glUniform2(this.uniformLocation, this.uniformIntBuffer);
break;
case 2:
OpenGlHelper.glUniform3(this.uniformLocation, this.uniformIntBuffer);
break;
case 3:
OpenGlHelper.glUniform4(this.uniformLocation, this.uniformIntBuffer);
break;
default:
logger.warn("Uniform.upload called, but count value (" + this.uniformCount + ") is " + " not in the range of 1 to 4. Ignoring.");
}
}
示例5: RenderChunk
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_)
{
for (int i = 0; i < this.mapEnumFacing.length; ++i)
{
this.mapEnumFacing[i] = new BlockPos.MutableBlockPos();
}
this.world = p_i47120_1_;
this.renderGlobal = p_i47120_2_;
this.index = p_i47120_3_;
if (OpenGlHelper.useVbo())
{
for (int j = 0; j < BlockRenderLayer.values().length; ++j)
{
this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例6: renderParticle
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
/**
* Renders the particle
*/
public void renderParticle(VertexBuffer worldRendererIn, Entity entityIn, float partialTicks, float rotationX, float rotationZ, float rotationYZ, float rotationXY, float rotationXZ)
{
float f = ((float)this.age + partialTicks) / (float)this.maxAge;
f = f * f;
double d0 = this.item.posX;
double d1 = this.item.posY;
double d2 = this.item.posZ;
double d3 = this.target.lastTickPosX + (this.target.posX - this.target.lastTickPosX) * (double)partialTicks;
double d4 = this.target.lastTickPosY + (this.target.posY - this.target.lastTickPosY) * (double)partialTicks + (double)this.yOffset;
double d5 = this.target.lastTickPosZ + (this.target.posZ - this.target.lastTickPosZ) * (double)partialTicks;
double d6 = d0 + (d3 - d0) * (double)f;
double d7 = d1 + (d4 - d1) * (double)f;
double d8 = d2 + (d5 - d2) * (double)f;
int i = this.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
d6 = d6 - interpPosX;
d7 = d7 - interpPosY;
d8 = d8 - interpPosZ;
GlStateManager.enableLighting();
this.renderManager.doRenderEntity(this.item, d6, d7, d8, this.item.rotationYaw, partialTicks, false);
}
示例7: renderWitherSkull
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public void renderWitherSkull(Entity entityIn, float partialTicks)
{
double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
Render<Entity> render = this.<Entity>getEntityRenderObject(entityIn);
if (render != null && this.renderEngine != null)
{
int i = entityIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
render.renderName(entityIn, d0 - this.renderPosX, d1 - this.renderPosY, d2 - this.renderPosZ);
}
}
示例8: createBindFramebuffer
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public void createBindFramebuffer(int width, int height)
{
if (!OpenGlHelper.isFramebufferEnabled())
{
this.framebufferWidth = width;
this.framebufferHeight = height;
}
else
{
GlStateManager.enableDepth();
if (this.framebufferObject >= 0)
{
this.deleteFramebuffer();
}
this.createFramebuffer(width, height);
this.checkFramebufferComplete();
OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, 0);
}
}
示例9: doRenderLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public void doRenderLayer(EntityIronGolem entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
if (entitylivingbaseIn.getHoldRoseTick() != 0)
{
BlockRendererDispatcher blockrendererdispatcher = Minecraft.getMinecraft().getBlockRendererDispatcher();
GlStateManager.enableRescaleNormal();
GlStateManager.pushMatrix();
GlStateManager.rotate(5.0F + 180.0F * ((ModelIronGolem)this.ironGolemRenderer.getMainModel()).ironGolemRightArm.rotateAngleX / (float)Math.PI, 1.0F, 0.0F, 0.0F);
GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
GlStateManager.translate(-0.9375F, -0.625F, -0.9375F);
float f = 0.5F;
GlStateManager.scale(0.5F, -0.5F, 0.5F);
int i = entitylivingbaseIn.getBrightnessForRender(partialTicks);
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.ironGolemRenderer.bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
blockrendererdispatcher.renderBlockBrightness(Blocks.RED_FLOWER.getDefaultState(), 1.0F);
GlStateManager.popMatrix();
GlStateManager.disableRescaleNormal();
}
}
示例10: doRenderLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的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();
}
示例11: renderEntityStatic
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public void renderEntityStatic(Entity entityIn, float partialTicks, boolean p_188388_3_)
{
if (entityIn.ticksExisted == 0)
{
entityIn.lastTickPosX = entityIn.posX;
entityIn.lastTickPosY = entityIn.posY;
entityIn.lastTickPosZ = entityIn.posZ;
}
double d0 = entityIn.lastTickPosX + (entityIn.posX - entityIn.lastTickPosX) * (double)partialTicks;
double d1 = entityIn.lastTickPosY + (entityIn.posY - entityIn.lastTickPosY) * (double)partialTicks;
double d2 = entityIn.lastTickPosZ + (entityIn.posZ - entityIn.lastTickPosZ) * (double)partialTicks;
float f = entityIn.prevRotationYaw + (entityIn.rotationYaw - entityIn.prevRotationYaw) * partialTicks;
int i = entityIn.getBrightnessForRender(partialTicks);
if (entityIn.isBurning())
{
i = 15728880;
}
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j, (float)k);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.doRenderEntity(entityIn, d0 - this.renderPosX, d1 - this.renderPosY, d2 - this.renderPosZ, f, partialTicks, p_188388_3_);
}
示例12: RenderChunk
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public RenderChunk(World worldIn, RenderGlobal renderGlobalIn, BlockPos blockPosIn, int indexIn)
{
this.world = worldIn;
this.renderGlobal = renderGlobalIn;
this.index = indexIn;
if (!blockPosIn.equals(this.getPosition()))
{
this.setPosition(blockPosIn);
}
if (OpenGlHelper.useVbo())
{
for (int i = 0; i < EnumWorldBlockLayer.values().length; ++i)
{
this.vertexBuffers[i] = new VertexBuffer(DefaultVertexFormats.BLOCK);
}
}
}
示例13: 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);
}
示例14: renderEntityStatic
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的package包/类
public boolean renderEntityStatic(Entity entity, float partialTicks, boolean p_147936_3_)
{
if (entity.ticksExisted == 0)
{
entity.lastTickPosX = entity.posX;
entity.lastTickPosY = entity.posY;
entity.lastTickPosZ = entity.posZ;
}
double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * (double)partialTicks;
double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * (double)partialTicks;
double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * (double)partialTicks;
float f = entity.prevRotationYaw + (entity.rotationYaw - entity.prevRotationYaw) * partialTicks;
int i = entity.getBrightnessForRender(partialTicks);
if (entity.isBurning())
{
i = 15728880;
}
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
return this.doRenderEntity(entity, d0 - this.renderPosX, d1 - this.renderPosY, d2 - this.renderPosZ, f, partialTicks, p_147936_3_);
}
示例15: doRenderLayer
import net.minecraft.client.renderer.OpenGlHelper; //导入依赖的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)
{
this.dragonRenderer.bindTexture(TEXTURE);
GlStateManager.enableBlend();
GlStateManager.disableAlpha();
GlStateManager.blendFunc(1, 1);
GlStateManager.disableLighting();
GlStateManager.depthFunc(514);
int i = 61680;
int j = i % 65536;
int k = i / 65536;
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)j / 1.0F, (float)k / 1.0F);
GlStateManager.enableLighting();
GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
this.dragonRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
this.dragonRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
GlStateManager.disableBlend();
GlStateManager.enableAlpha();
GlStateManager.depthFunc(515);
}