本文整理汇总了Java中codechicken.lib.render.CCRenderState类的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState类的具体用法?Java CCRenderState怎么用?Java CCRenderState使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
CCRenderState类属于codechicken.lib.render包,在下文中一共展示了CCRenderState类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderItem
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void renderItem(final ItemStack item, final MicroMaterialRegistry.IMicroMaterial material) {
final Vector3 pos = new Vector3(0.5, 0.5, 0.5);
if (PartSphere.faces_inv == null) {
this.calcSphere(0.5, 0.5, PartSphere.faces_inv = new ArrayList<Vertex5[]>());
LogHelper.debug("Calculated faces " + PartSphere.faces_inv.size(), new Object[0]);
}
CCRenderState.setModel((CCRenderState.IVertexSource)this.face);
for (final Vertex5[] f : PartSphere.faces_inv) {
this.face.lcComputed = false;
this.face.verts[0].set(f[0]);
this.face.verts[1].set(f[1]);
this.face.verts[2].set(f[2]);
this.face.verts[3].set(f[3]);
this.face.side = f[0].uv.tex;
material.renderMicroFace(pos, -1, this.getBounds());
}
}
示例2: renderSphere
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public void renderSphere(final Vector3 pos, final int pass, final MicroMaterialRegistry.IMicroMaterial m) {
if (PartSphere.faces == null) {
this.calcSphere(0.25, 0.25, PartSphere.faces = new ArrayList<Vertex5[]>());
LogHelper.debug("Calculated " + PartSphere.faces.size(), new Object[0]);
}
CCRenderState.setModel((CCRenderState.IVertexSource)this.face);
for (final Vertex5[] f : PartSphere.faces) {
this.face.verts[0].set(f[0]);
this.face.verts[1].set(f[1]);
this.face.verts[2].set(f[2]);
this.face.verts[3].set(f[3]);
this.face.side = f[0].uv.tex;
m.renderMicroFace(pos, pass, this.getBounds());
}
}
示例3: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
GL11.glColor4f(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
GL11.glPushMatrix();
GL11.glTranslatef(j + 5, k + 16, 0);
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
recipehandler.drawBackground(i);
GL11.glTranslatef(0, 65, 0);
}
GL11.glPopMatrix();
}
示例4: drawGuiContainerBackgroundLayer
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
protected void drawGuiContainerBackgroundLayer(float f, int mx, int my) {
GlStateManager.color(1, 1, 1, 1);
CCRenderState.changeTexture("nei:textures/gui/recipebg.png");
int j = (width - xSize) / 2;
int k = (height - ySize) / 2;
drawTexturedModalRect(j, k, 0, 0, xSize, ySize);
GlStateManager.pushMatrix();
GlStateManager.translate(j + 5, k + 16, 0);
IRecipeHandler recipehandler = currenthandlers.get(recipetype);
for (int i = page * recipehandler.recipiesPerPage(); i < recipehandler.numRecipes() && i < (page + 1) * recipehandler.recipiesPerPage(); i++) {
recipehandler.drawBackground(i);
GlStateManager.translate(0, 65, 0);
}
GlStateManager.popMatrix();
}
示例5: drawOverlayGrad
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
public static void drawOverlayGrad(int x1, int x2, int y1, int y2, float zLevel) {
GlStateManager.disableTexture2D();
GlStateManager.disableCull();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
WorldRenderer r = CCRenderState.startDrawing();
r.setColorRGBA_I(0, 255);
r.addVertex(x2, y1, zLevel);
r.addVertex(x1, y1, zLevel);
r.setColorRGBA_I(0, 0);
r.addVertex(x1, y2, zLevel);
r.addVertex(x2, y2, zLevel);
CCRenderState.draw();
GlStateManager.disableBlend();
GlStateManager.enableCull();
GlStateManager.enableTexture2D();
}
示例6: renderItem
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
public void renderItem(ItemStack item, TransformType transformType) {
GlStateManager.pushMatrix();
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
ccrs.pullLightmap();
Frequency frequency = Frequency.readFromStack(item);
FluidStack fluidStack = TankSynchroniser.getClientLiquid(frequency);
RenderTileEnderTank.renderTank(ccrs, 2, 0F, frequency, 0, 0, 0, 0);
if (fluidStack != null && RenderUtils.shouldRenderFluid(fluidStack)) {
RenderTileEnderTank.renderLiquid(fluidStack, 0, 0, 0);
}
//Fixes issues with inventory rendering.
//The Portal renderer modifies blend and disables it.
//Vanillas inventory relies on the fact that items don't modify gl so it never bothers to set it again.
GlStateManager.enableBlend();
GlStateManager.tryBlendFuncSeparate(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA, GlStateManager.SourceFactor.ONE, GlStateManager.DestFactor.ZERO);
GlStateManager.popMatrix();
}
示例7: bakeQuads
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
public List<BakedQuad> bakeQuads(EnumFacing face, IExtendedBlockState state) {
BakingVertexBuffer buffer = BakingVertexBuffer.create();
Triple<Integer, Integer, UVTransformation> worldData = getWorldTransforms(state);
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
ccrs.startDrawing(0x7, DefaultVertexFormats.ITEM, buffer);
models[worldData.getLeft()][worldData.getMiddle()].render(ccrs, worldData.getRight());
buffer.finishDrawing();
List<BakedQuad> quads = buffer.bake();
if (face == null && !shouldCull()) {
return quads;
} else if (face != null) {
return VertexDataUtils.sortFaceData(quads).get(face);
}
return ImmutableList.of();
}
示例8: bakeItemQuads
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
public List<BakedQuad> bakeItemQuads(EnumFacing face, ItemStack stack) {
BakingVertexBuffer buffer = BakingVertexBuffer.create();
Triple<Integer, Integer, UVTransformation> worldData = getItemTransforms(stack);
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
ccrs.startDrawing(0x7, DefaultVertexFormats.ITEM, buffer);
models[worldData.getLeft()][worldData.getMiddle()].render(ccrs, worldData.getRight());
buffer.finishDrawing();
List<BakedQuad> quads = buffer.bake();
if (face == null && !shouldCull()) {
return quads;
} else if (face != null) {
return VertexDataUtils.sortFaceData(quads).get(face);
}
return ImmutableList.of();
}
示例9: drawOverlayGrad
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
public static void drawOverlayGrad(int x1, int x2, int y1, int y2, float zLevel) {
GlStateManager.disableTexture2D();
GlStateManager.disableCull();
GlStateManager.enableBlend();
GlStateManager.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GlStateManager.shadeModel(GL11.GL_SMOOTH);
CCRenderState ccrs = CCRenderState.instance();
BufferBuilder buffer = ccrs.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_COLOR);
buffer.pos(x2, y1, zLevel).color(0, 0, 0, 255).endVertex();
buffer.pos(x1, y1, zLevel).color(0, 0, 0, 255).endVertex();
buffer.pos(x1, y2, zLevel).color(0, 0, 0, 0).endVertex();
buffer.pos(x2, y2, zLevel).color(0, 0, 0, 0).endVertex();
ccrs.draw();
GlStateManager.disableBlend();
GlStateManager.enableCull();
GlStateManager.enableTexture2D();
}
示例10: renderContents
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
public void renderContents(PartHeatTransmitter transmitter, Vector3 pos)
{
push();
CCRenderState.reset();
CCRenderState.useNormals = true;
CCRenderState.startDrawing();
GL11.glTranslated(pos.x, pos.y, pos.z);
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
renderHeatSide(side, transmitter);
}
MekanismRenderer.glowOn();
MekanismRenderer.cullFrontFace();
CCRenderState.draw();
MekanismRenderer.disableCullFace();
MekanismRenderer.glowOff();
pop();
}
示例11: renderItem
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
public void renderItem(int metadata)
{
TextureUtils.bindAtlas(0);
CCRenderState.reset();
CCRenderState.startDrawing();
CCRenderState.hasColour = true;
EnumColor c = EnumColor.DYES[metadata];
Colour colour = new ColourRGBA(c.getColor(0), c.getColor(1), c.getColor(2), 1);
Colour white = new ColourRGBA(1.0, 1.0, 1.0, 1.0);
for(int i = 4; i < 5; i++)
{
frameModels[i].render(new IconTransformation(icon), new ColourMultiplier(white.rgba()));
lightModels[i].render(new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
}
CCRenderState.draw();
}
示例12: renderStatic
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
public void renderStatic(Vector3 pos, LazyLightMatrix lm, int pass) {
IBlockAccess access = new PartMetaAccess(this);
VariationCTMX var = (VariationCTMX) base.getVariation(meta);
Tessellator.instance.setColorOpaque(255, 255, 255);
CCRenderState.useModelColours(false);
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 4; j++) {
verts[j] = carpetModel.verts[j + i * 4];
}
var.setup(verts, i, pos, access, bounds);
var.renderSide(verts, i, pos, lm.lightMatrix(), 0xFFFFFFF, bounds);
}
}
示例13: renderStatic
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
public boolean renderStatic(Vector3 pos, BlockRenderLayer layer, CCRenderState ccrs) {
if (layer == BlockRenderLayer.SOLID) {
RenderWireless.renderWorld(ccrs, this);
return true;
}
return false;
}
示例14: render
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
public void render(ItemStack stack, MapData data, boolean inFrame) {
WirelessMapNodeStorage mapstorage = RedstoneEtherAddons.client().getMapNodes();
if (stack == null || stack.getItem() != ModItems.itemWirelessMap) {
return;
}
ClientMapInfo mapinfo = RedstoneEtherAddons.client().getMPMapInfo((short) stack.getItemDamage());
if (mapinfo == null) {
return;
}
CCRenderState ccrs = CCRenderState.instance();
GlStateManager.disableTexture2D();
GlStateManager.disableDepth();
GlStateManager.enableBlend();
GlStateManager.blendFunc(SourceFactor.ONE, DestFactor.ONE_MINUS_SRC_ALPHA);
float light = 1;
int xCenter = mapinfo.xCenter;
int zCenter = mapinfo.zCenter;
int scale = mapinfo.scale;
ccrs.startDrawing(0x07, DefaultVertexFormats.POSITION_COLOR);
renderPass(ccrs, xCenter, zCenter, scale, mapstorage, 0.75F, 1F, light * 0.5F);
renderPass(ccrs, xCenter, zCenter, scale, mapstorage, 0.6F, 1F, light);
ccrs.draw();
GlStateManager.enableTexture2D();
GlStateManager.enableDepth();
GlStateManager.disableBlend();
}
示例15: drawForeground
import codechicken.lib.render.CCRenderState; //导入依赖的package包/类
@Override
public void drawForeground(int recipe) {
GL11.glColor4f(1, 1, 1, 1);
GL11.glDisable(GL11.GL_LIGHTING);
if (this.getGuiTexture() != null && !this.getGuiTexture().isEmpty() && this.progressBar != null) {
CCRenderState.changeTexture(getGuiTexture());
drawProgressBar(progressBar.posX, progressBar.posY, progressBar.textureX, progressBar.textureY, progressBar.width, progressBar.height, progressBar.ticks, progressBar.direction);
}
drawExtras(recipe);
}