当前位置: 首页>>代码示例>>Java>>正文


Java VertexBuffer类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.VertexBuffer的典型用法代码示例。如果您正苦于以下问题:Java VertexBuffer类的具体用法?Java VertexBuffer怎么用?Java VertexBuffer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


VertexBuffer类属于net.minecraft.client.renderer包,在下文中一共展示了VertexBuffer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderBoxOutline

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
private static void renderBoxOutline(BlockPos pos) {
    net.minecraft.client.renderer.RenderHelper.disableStandardItemLighting();
    Minecraft.getMinecraft().entityRenderer.disableLightmap();
    GlStateManager.disableTexture2D();
    GlStateManager.disableBlend();
    GlStateManager.disableLighting();
    GlStateManager.disableAlpha();
    GlStateManager.glLineWidth(2);
    GlStateManager.color(1, 1, 1);

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer buffer = tessellator.getBuffer();
    float mx = pos.getX();
    float my = pos.getY();
    float mz = pos.getZ();
    buffer.begin(GL11.GL_LINES, DefaultVertexFormats.POSITION_COLOR);
    RenderHelper.renderHighLightedBlocksOutline(buffer, mx, my, mz, .9f, .7f, 0, 1);

    tessellator.draw();

    Minecraft.getMinecraft().entityRenderer.enableLightmap();
    GlStateManager.enableTexture2D();
}
 
开发者ID:McJty,项目名称:interactionwheel,代码行数:24,代码来源:RenderHandler.java

示例2: pushEntity

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
public static void pushEntity(IBlockState blockState, BlockPos blockPos, IBlockAccess blockAccess, VertexBuffer wrr)
{
    Block block = blockState.getBlock();
    int i;
    int j;

    if (blockState instanceof BlockStateBase)
    {
        BlockStateBase blockstatebase = (BlockStateBase)blockState;
        i = blockstatebase.getBlockId();
        j = blockstatebase.getMetadata();
    }
    else
    {
        i = Block.getIdFromBlock(block);
        j = block.getMetaFromState(blockState);
    }

    i = BlockAliases.getMappedBlockId(i, j);
    int i1 = block.getRenderType(blockState).ordinal();
    int k = ((i1 & 65535) << 16) + (i & 65535);
    int l = j & 65535;
    wrr.sVertexBuilder.pushEntity(((long)l << 32) + (long)k);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:SVertexBuilder.java

示例3: endAddVertex

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
public static void endAddVertex(VertexBuffer wrr)
{
    SVertexBuilder svertexbuilder = wrr.sVertexBuilder;

    if (svertexbuilder.vertexSize == 14)
    {
        if (wrr.drawMode == 7 && wrr.vertexCount % 4 == 0)
        {
            svertexbuilder.calcNormal(wrr, wrr.getBufferSize() - 4 * svertexbuilder.vertexSize);
        }

        long i = svertexbuilder.entityData[svertexbuilder.entityDataIndex];
        int j = wrr.getBufferSize() - 14 + 12;
        wrr.rawIntBuffer.put(j, (int)i);
        wrr.rawIntBuffer.put(j + 1, (int)(i >> 32));
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:SVertexBuilder.java

示例4: renderBox

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
private void renderBox(Tessellator p_190055_1_, VertexBuffer p_190055_2_, double p_190055_3_, double p_190055_5_, double p_190055_7_, double p_190055_9_, double p_190055_11_, double p_190055_13_, int p_190055_15_, int p_190055_16_, int p_190055_17_)
{
    GlStateManager.glLineWidth(2.0F);
    p_190055_2_.begin(3, DefaultVertexFormats.POSITION_COLOR);
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_7_).color((float)p_190055_16_, (float)p_190055_16_, (float)p_190055_16_, 0.0F).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_7_).color(p_190055_16_, p_190055_17_, p_190055_17_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_7_).color(p_190055_17_, p_190055_17_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_7_).color(p_190055_17_, p_190055_16_, p_190055_17_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_3_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_13_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_11_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_7_).color(p_190055_16_, p_190055_16_, p_190055_16_, p_190055_15_).endVertex();
    p_190055_2_.pos(p_190055_9_, p_190055_5_, p_190055_7_).color((float)p_190055_16_, (float)p_190055_16_, (float)p_190055_16_, 0.0F).endVertex();
    p_190055_1_.draw();
    GlStateManager.glLineWidth(1.0F);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:26,代码来源:TileEntityStructureRenderer.java

示例5: renderQuadColorSlow

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
public static void renderQuadColorSlow(VertexBuffer wr, BakedQuad quad, int auxColor)
{
    ItemConsumer cons;
    if(wr == Tessellator.getInstance().getBuffer())
    {
        cons = getItemConsumer();
    }
    else
    {
        cons = new ItemConsumer(new VertexBufferConsumer(wr));
    }
    float b = (float)(auxColor & 0xFF) / 0xFF;
    float g = (float)((auxColor >>> 8) & 0xFF) / 0xFF;
    float r = (float)((auxColor >>> 16) & 0xFF) / 0xFF;
    float a = (float)((auxColor >>> 24) & 0xFF) / 0xFF;

    cons.setAuxColor(r, g, b, a);
    quad.pipe(cons);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:20,代码来源:LightUtil.java

示例6: renderParticle

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的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 = this.particleTexture.getMinU();
    float f1 = this.particleTexture.getMaxU();
    float f2 = this.particleTexture.getMinV();
    float f3 = this.particleTexture.getMaxV();
    float f4 = 0.5F;
    float f5 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)partialTicks - interpPosX);
    float f6 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)partialTicks - interpPosY);
    float f7 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)partialTicks - interpPosZ);
    int i = this.getBrightnessForRender(partialTicks);
    int j = i >> 16 & 65535;
    int k = i & 65535;
    worldRendererIn.pos((double)(f5 - rotationX * 0.5F - rotationXY * 0.5F), (double)(f6 - rotationZ * 0.5F), (double)(f7 - rotationYZ * 0.5F - rotationXZ * 0.5F)).tex((double)f1, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
    worldRendererIn.pos((double)(f5 - rotationX * 0.5F + rotationXY * 0.5F), (double)(f6 + rotationZ * 0.5F), (double)(f7 - rotationYZ * 0.5F + rotationXZ * 0.5F)).tex((double)f1, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
    worldRendererIn.pos((double)(f5 + rotationX * 0.5F + rotationXY * 0.5F), (double)(f6 + rotationZ * 0.5F), (double)(f7 + rotationYZ * 0.5F + rotationXZ * 0.5F)).tex((double)f, (double)f2).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
    worldRendererIn.pos((double)(f5 + rotationX * 0.5F - rotationXY * 0.5F), (double)(f6 - rotationZ * 0.5F), (double)(f7 + rotationYZ * 0.5F - rotationXZ * 0.5F)).tex((double)f, (double)f3).color(this.particleRed, this.particleGreen, this.particleBlue, 1.0F).lightmap(j, k).endVertex();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:22,代码来源:Barrier.java

示例7: renderLitParticles

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
public void renderLitParticles(Entity entityIn, float partialTick)
{
    float f = 0.017453292F;
    float f1 = MathHelper.cos(entityIn.rotationYaw * 0.017453292F);
    float f2 = MathHelper.sin(entityIn.rotationYaw * 0.017453292F);
    float f3 = -f2 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F);
    float f4 = f1 * MathHelper.sin(entityIn.rotationPitch * 0.017453292F);
    float f5 = MathHelper.cos(entityIn.rotationPitch * 0.017453292F);

    for (int i = 0; i < 2; ++i)
    {
        Queue<Particle> queue = this.fxLayers[3][i];

        if (!queue.isEmpty())
        {
            Tessellator tessellator = Tessellator.getInstance();
            VertexBuffer vertexbuffer = tessellator.getBuffer();

            for (Particle particle : queue)
            {
                particle.renderParticle(vertexbuffer, entityIn, partialTick, f1, f5, f2, f3, f4);
            }
        }
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:26,代码来源:ParticleManager.java

示例8: drawItemBackground

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
private void drawItemBackground(int x, int z, int textureX, int textureY)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(Gui.STAT_ICONS);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double)(x + 0), (double)(z + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(textureX + 0) * 0.0078125F), (double)((float)(textureY + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(x + 18), (double)(z + 18), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(textureX + 18) * 0.0078125F), (double)((float)(textureY + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(x + 18), (double)(z + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(textureX + 18) * 0.0078125F), (double)((float)(textureY + 0) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(x + 0), (double)(z + 0), (double)GuiCreateFlatWorld.this.zLevel).tex((double)((float)(textureX + 0) * 0.0078125F), (double)((float)(textureY + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:18,代码来源:GuiCreateFlatWorld.java

示例9: compileDisplayList

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
/**
 * Compiles a GL display list for this model
 */
private void compileDisplayList(float scale)
{
    if (this.displayList == 0)
    {
        this.savedScale = scale;
        this.displayList = GLAllocation.generateDisplayLists(1);
    }

    GlStateManager.glNewList(this.displayList, 4864);
    VertexBuffer vertexbuffer = Tessellator.getInstance().getBuffer();

    for (int i = 0; i < this.cubeList.size(); ++i)
    {
        ((ModelBox)this.cubeList.get(i)).render(vertexbuffer, scale);
    }

    for (int j = 0; j < this.spriteList.size(); ++j)
    {
        ModelSprite modelsprite = (ModelSprite)this.spriteList.get(j);
        modelsprite.render(Tessellator.getInstance(), scale);
    }

    GlStateManager.glEndList();
    this.compiled = true;
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:29,代码来源:ModelRenderer.java

示例10: drawSprite

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
/**
 * Draws a sprite from assets/textures/gui/container/stats_icons.png
 */
private void drawSprite(int p_146527_1_, int p_146527_2_, int p_146527_3_, int p_146527_4_)
{
    GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
    this.mc.getTextureManager().bindTexture(STAT_ICONS);
    float f = 0.0078125F;
    float f1 = 0.0078125F;
    int i = 18;
    int j = 18;
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 18), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 18) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 18), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 18) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    vertexbuffer.pos((double)(p_146527_1_ + 0), (double)(p_146527_2_ + 0), (double)this.zLevel).tex((double)((float)(p_146527_3_ + 0) * 0.0078125F), (double)((float)(p_146527_4_ + 0) * 0.0078125F)).endVertex();
    tessellator.draw();
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:21,代码来源:GuiStats.java

示例11: renderPathLine

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
public void renderPathLine(float p_190067_1_, Path p_190067_2_)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);

    for (int i = 0; i < p_190067_2_.getCurrentPathLength(); ++i)
    {
        PathPoint pathpoint = p_190067_2_.getPathPointFromIndex(i);

        if (this.addDistanceToPlayer(pathpoint) <= 40.0F)
        {
            float f = (float)i / (float)p_190067_2_.getCurrentPathLength() * 0.33F;
            int j = i == 0 ? 0 : MathHelper.hsvToRGB(f, 0.9F, 0.9F);
            int k = j >> 16 & 255;
            int l = j >> 8 & 255;
            int i1 = j & 255;
            vertexbuffer.pos((double)pathpoint.xCoord - this.xo + 0.5D, (double)pathpoint.yCoord - this.yo + 0.5D, (double)pathpoint.zCoord - this.zo + 0.5D).color(k, l, i1, 255).endVertex();
        }
    }

    tessellator.draw();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:24,代码来源:DebugRendererPathfinding.java

示例12: renderParticle

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的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.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
    f = MathHelper.clamp_float(f, 0.0F, 1.0F);
    this.particleScale = this.oSize * f;
    super.renderParticle(worldRendererIn, entityIn, partialTicks, rotationX, rotationZ, rotationYZ, rotationXY, rotationXZ);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:11,代码来源:ParticleCrit.java

示例13: renderOverlay

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
/**
 * Utility method for rendering a texture as the front-side overlay
 * over a specified horizontal area.
 *
 * @param texture the texture to use to render the overlay.
 * @param u0      the lower end of the vertical area to render at.
 * @param u1      the upper end of the vertical area to render at.
 */
public void renderOverlay(final ResourceLocation texture, final float u0, final float u1) {
    Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
    final Tessellator t = Tessellator.getInstance();
    final VertexBuffer r = t.getBuffer();
    r.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
    r.pos(u0, v1, 0).tex(u0, v1).endVertex();
    r.pos(u1, v1, 0).tex(u1, v1).endVertex();
    r.pos(u1, v0, 0).tex(u1, v0).endVertex();
    r.pos(u0, v0, 0).tex(u0, v0).endVertex();
    t.draw();
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:20,代码来源:RackMountableRenderEvent.java

示例14: renderOverlayFromAtlas

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
/**
 * Utility method for rendering an atlas texture as the front-side overlay
 * over a specified horizontal area.
 *
 * @param texture the atlas texture to use to render the overlay.
 * @param u0      the lower end of the vertical area to render at.
 * @param u1      the upper end of the vertical area to render at.
 */
public void renderOverlayFromAtlas(final ResourceLocation texture, final float u0, final float u1) {
    Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.LOCATION_BLOCKS_TEXTURE);
    final TextureAtlasSprite icon = Minecraft.getMinecraft().getTextureMapBlocks().getAtlasSprite(texture.toString());
    final Tessellator t = Tessellator.getInstance();
    final VertexBuffer r = t.getBuffer();
    r.begin(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
    r.pos(u0, v1, 0).tex(icon.getInterpolatedU(u0 * 16), icon.getInterpolatedV(v1 * 16)).endVertex();
    r.pos(u1, v1, 0).tex(icon.getInterpolatedU(u1 * 16), icon.getInterpolatedV(v1 * 16)).endVertex();
    r.pos(u1, v0, 0).tex(icon.getInterpolatedU(u1 * 16), icon.getInterpolatedV(v0 * 16)).endVertex();
    r.pos(u0, v0, 0).tex(icon.getInterpolatedU(u0 * 16), icon.getInterpolatedV(v0 * 16)).endVertex();
    t.draw();
}
 
开发者ID:Herobone,项目名称:HeroUtils,代码行数:21,代码来源:RackMountableRenderEvent.java

示例15: drawTexturedModalRect

import net.minecraft.client.renderer.VertexBuffer; //导入依赖的package包/类
/**
 * Draws a texture rectangle using the texture currently bound to the TextureManager
 */
public void drawTexturedModalRect(int xCoord, int yCoord, TextureAtlasSprite textureSprite, int widthIn, int heightIn)
{
    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    vertexbuffer.begin(7, DefaultVertexFormats.POSITION_TEX);
    vertexbuffer.pos((double)(xCoord + 0), (double)(yCoord + heightIn), (double)this.zLevel).tex((double)textureSprite.getMinU(), (double)textureSprite.getMaxV()).endVertex();
    vertexbuffer.pos((double)(xCoord + widthIn), (double)(yCoord + heightIn), (double)this.zLevel).tex((double)textureSprite.getMaxU(), (double)textureSprite.getMaxV()).endVertex();
    vertexbuffer.pos((double)(xCoord + widthIn), (double)(yCoord + 0), (double)this.zLevel).tex((double)textureSprite.getMaxU(), (double)textureSprite.getMinV()).endVertex();
    vertexbuffer.pos((double)(xCoord + 0), (double)(yCoord + 0), (double)this.zLevel).tex((double)textureSprite.getMinU(), (double)textureSprite.getMinV()).endVertex();
    tessellator.draw();
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:15,代码来源:Gui.java


注:本文中的net.minecraft.client.renderer.VertexBuffer类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。