java类net.minecraft.client.renderer.OpenGlHelper的实例源码

ShaderUniform.java 文件源码 项目:BaseClient 阅读 23 收藏 0 点赞 0 评论 0
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);
    }
}
LayerCreeperweenEyes.java 文件源码 项目:Halloween 阅读 21 收藏 0 点赞 0 评论 0
@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();
}
ShaderUniform.java 文件源码 项目:Backmemed 阅读 23 收藏 0 点赞 0 评论 0
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);
    }
}
ShaderUniform.java 文件源码 项目:BaseClient 阅读 27 收藏 0 点赞 0 评论 0
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.");
    }
}
RenderChunk.java 文件源码 项目:CustomWorldGen 阅读 26 收藏 0 点赞 0 评论 0
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);
        }
    }
}
ParticleItemPickup.java 文件源码 项目:CustomWorldGen 阅读 21 收藏 0 点赞 0 评论 0
/**
 * 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);
}
RenderManager.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
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);
    }
}
Framebuffer.java 文件源码 项目:Backmemed 阅读 31 收藏 0 点赞 0 评论 0
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);
    }
}
LayerIronGolemFlower.java 文件源码 项目:Backmemed 阅读 23 收藏 0 点赞 0 评论 0
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();
    }
}
Framebuffer.java 文件源码 项目:DecompiledMinecraft 阅读 30 收藏 0 点赞 0 评论 0
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);
    }
}
LayerEndermanEvolvedEyes.java 文件源码 项目:EndermanEvolution 阅读 19 收藏 0 点赞 0 评论 0
@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();
}
ParticleItemPickup.java 文件源码 项目:Backmemed 阅读 30 收藏 0 点赞 0 评论 0
/**
 * 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);
}
RenderManager.java 文件源码 项目:CustomWorldGen 阅读 23 收藏 0 点赞 0 评论 0
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_);
}
RenderChunk.java 文件源码 项目:BaseClient 阅读 25 收藏 0 点赞 0 评论 0
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);
        }
    }
}
QuantumMirrorRenderer.java 文件源码 项目:Solar 阅读 18 收藏 0 点赞 0 评论 0
@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);
}
RenderManager.java 文件源码 项目:DecompiledMinecraft 阅读 21 收藏 0 点赞 0 评论 0
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_);
}
ShaderUniform.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
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);
    }
}
LayerEnderDragonEyes.java 文件源码 项目:DecompiledMinecraft 阅读 27 收藏 0 点赞 0 评论 0
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);
}
LayerEndermanEyes.java 文件源码 项目:DecompiledMinecraft 阅读 24 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityEnderman 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.endermanRenderer.bindTexture(field_177203_a);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(1, 1);
    GlStateManager.disableLighting();
    GlStateManager.depthMask(!entitylivingbaseIn.isInvisible());
    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.endermanRenderer.getMainModel().render(entitylivingbaseIn, p_177141_2_, p_177141_3_, p_177141_5_, p_177141_6_, p_177141_7_, scale);
    this.endermanRenderer.func_177105_a(entitylivingbaseIn, partialTicks);
    GlStateManager.depthMask(true);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
}
LayerIronGolemFlower.java 文件源码 项目:DecompiledMinecraft 阅读 21 收藏 0 点赞 0 评论 0
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();
    }
}
RenderManager.java 文件源码 项目:BaseClient 阅读 21 收藏 0 点赞 0 评论 0
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_);
}
LsdMod.java 文件源码 项目:Wurst-MC-1.12 阅读 22 收藏 0 点赞 0 评论 0
@Override
public void onDisable()
{
    if(!OpenGlHelper.shadersSupported)
    {
        wurst.events.remove(UpdateListener.class, this);
        WPlayer.removePotionEffect(WPotionEffects.NAUSEA);
        return;
    }

    if(mc.entityRenderer.theShaderGroup != null)
    {
        mc.entityRenderer.theShaderGroup.deleteShaderGroup();
        mc.entityRenderer.theShaderGroup = null;
    }
}
RenderManager.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
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 render = this.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);
    }
}
LayerEnderDragonEyes.java 文件源码 项目:CustomWorldGen 阅读 22 收藏 0 点赞 0 评论 0
public void doRenderLayer(EntityDragon entitylivingbaseIn, float limbSwing, float limbSwingAmount, float partialTicks, float ageInTicks, float netHeadYaw, float headPitch, float scale)
{
    this.dragonRenderer.bindTexture(TEXTURE);
    GlStateManager.enableBlend();
    GlStateManager.disableAlpha();
    GlStateManager.blendFunc(GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ONE);
    GlStateManager.disableLighting();
    GlStateManager.depthFunc(514);
    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);
    this.dragonRenderer.getMainModel().render(entitylivingbaseIn, limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scale);
    this.dragonRenderer.setLightmap(entitylivingbaseIn, partialTicks);
    GlStateManager.disableBlend();
    GlStateManager.enableAlpha();
    GlStateManager.depthFunc(515);
}
RenderUtils.java 文件源码 项目:BaseClient 阅读 27 收藏 0 点赞 0 评论 0
public static void enableLighting() {
    GL11.glDisable((int)3042);
    GL11.glEnable((int)3553);
    GL11.glDisable((int)2848);
    GL11.glDisable((int)3042);
    OpenGlHelper.setActiveTexture((int)OpenGlHelper.lightmapTexUnit);
    GL11.glMatrixMode((int)5890);
    GL11.glLoadIdentity();
    float var3 = 0.0039063f;
    GL11.glScalef((float)var3, (float)var3, (float)var3);
    GL11.glTranslatef((float)8.0f, (float)8.0f, (float)8.0f);
    GL11.glMatrixMode((int)5888);
    GL11.glTexParameteri((int)3553, (int)10241, (int)9729);
    GL11.glTexParameteri((int)3553, (int)10240, (int)9729);
    GL11.glTexParameteri((int)3553, (int)10242, (int)10496);
    GL11.glTexParameteri((int)3553, (int)10243, (int)10496);
    GL11.glColor4f((float)1.0f, (float)1.0f, (float)1.0f, (float)1.0f);
    OpenGlHelper.setActiveTexture((int)OpenGlHelper.defaultTexUnit);
}
TileEntityRendererDispatcher.java 文件源码 项目:Backmemed 阅读 30 收藏 0 点赞 0 评论 0
public void renderTileEntity(TileEntity tileentityIn, float partialTicks, int destroyStage)
{
    if (tileentityIn.getDistanceSq(this.entityX, this.entityY, this.entityZ) < tileentityIn.getMaxRenderDistanceSquared())
    {
        RenderHelper.enableStandardItemLighting();
        boolean flag = true;

        if (Reflector.ForgeTileEntity_hasFastRenderer.exists())
        {
            flag = !this.drawingBatch || !Reflector.callBoolean(tileentityIn, Reflector.ForgeTileEntity_hasFastRenderer, new Object[0]);
        }

        if (flag)
        {
            int i = this.worldObj.getCombinedLight(tileentityIn.getPos(), 0);
            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);
        }

        BlockPos blockpos = tileentityIn.getPos();
        this.renderTileEntityAt(tileentityIn, (double)blockpos.getX() - staticPlayerX, (double)blockpos.getY() - staticPlayerY, (double)blockpos.getZ() - staticPlayerZ, partialTicks, destroyStage);
    }
}
EntityPickupFX.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    float f = ((float)this.age + partialTicks) / (float)this.maxAge;
    f = f * f;
    double d0 = this.field_174840_a.posX;
    double d1 = this.field_174840_a.posY;
    double d2 = this.field_174840_a.posZ;
    double d3 = this.field_174843_ax.lastTickPosX + (this.field_174843_ax.posX - this.field_174843_ax.lastTickPosX) * (double)partialTicks;
    double d4 = this.field_174843_ax.lastTickPosY + (this.field_174843_ax.posY - this.field_174843_ax.lastTickPosY) * (double)partialTicks + (double)this.field_174841_aA;
    double d5 = this.field_174843_ax.lastTickPosZ + (this.field_174843_ax.posZ - this.field_174843_ax.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 / 1.0F, (float)k / 1.0F);
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    d6 = d6 - interpPosX;
    d7 = d7 - interpPosY;
    d8 = d8 - interpPosZ;
    this.field_174842_aB.renderEntityWithPosYaw(this.field_174840_a, (double)((float)d6), (double)((float)d7), (double)((float)d8), this.field_174840_a.rotationYaw, partialTicks);
}
Framebuffer.java 文件源码 项目:CustomWorldGen 阅读 21 收藏 0 点赞 0 评论 0
public void bindFramebuffer(boolean p_147610_1_)
{
    if (OpenGlHelper.isFramebufferEnabled())
    {
        OpenGlHelper.glBindFramebuffer(OpenGlHelper.GL_FRAMEBUFFER, this.framebufferObject);

        if (p_147610_1_)
        {
            GlStateManager.viewport(0, 0, this.framebufferWidth, this.framebufferHeight);
        }
    }
}
SeeingStoneHandler.java 文件源码 项目:Etheric 阅读 22 收藏 0 点赞 0 评论 0
private static void setLightmap() {
    AbstractClientPlayer abstractclientplayer = Minecraft.getMinecraft().player;
    int i = Minecraft.getMinecraft().world.getCombinedLight(new BlockPos(abstractclientplayer.posX,
            abstractclientplayer.posY + (double) abstractclientplayer.getEyeHeight(), abstractclientplayer.posZ),
            0);
    float f = (float) (i & 65535);
    float f1 = (float) (i >> 16);
    OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f, f1);
}
ShaderHandler.java 文件源码 项目:Etheric 阅读 19 收藏 0 点赞 0 评论 0
public int loadProgram(String vsh, String fsh) {
    if (OpenGlHelper.shadersSupported) {
        int vertexShader = createShader(vsh, OpenGlHelper.GL_VERTEX_SHADER);
        int fragmentShader = createShader(fsh, OpenGlHelper.GL_FRAGMENT_SHADER);
        int program = OpenGlHelper.glCreateProgram();
        OpenGlHelper.glAttachShader(program, vertexShader);
        OpenGlHelper.glAttachShader(program, fragmentShader);
        OpenGlHelper.glLinkProgram(program);
        return program;
    }
    return 0;
}


问题


面经


文章

微信
公众号

扫码关注公众号