本文整理汇总了Java中codechicken.lib.render.CCRenderState.reset方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.reset方法的具体用法?Java CCRenderState.reset怎么用?Java CCRenderState.reset使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codechicken.lib.render.CCRenderState
的用法示例。
在下文中一共展示了CCRenderState.reset方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例6: renderItem
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderItem(final IItemRenderer.ItemRenderType type, final ItemStack stack, final Object... data) {
if (!stack.hasTagCompound()) {
return;
}
final String mat = stack.getTagCompound().getString("mat");
final MicroMaterialRegistry.IMicroMaterial material = MicroMaterialRegistry.getMaterial(mat);
if (material == null) {
return;
}
GL11.glPushMatrix();
if (type == IItemRenderer.ItemRenderType.ENTITY) {
GL11.glScaled(0.5, 0.5, 0.5);
}
if (type == IItemRenderer.ItemRenderType.INVENTORY || type == IItemRenderer.ItemRenderType.ENTITY) {
GL11.glTranslatef(-0.5f, -0.5f, -0.5f);
}
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glEnable(3008);
final CCRenderPipeline.PipelineBuilder builder = CCRenderState.pipeline.builder();
CCRenderState.reset();
TextureUtils.bindAtlas(0);
CCRenderState.useNormals = true;
CCRenderState.pullLightmap();
CCRenderState.startDrawing();
final IMicroBlock part = RegisterMicroBlocks.mParts.get(stack.getItemDamage());
if (part != null) {
part.renderItem(stack, material);
}
CCRenderState.draw();
GL11.glPopMatrix();
}
示例7: draw
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void draw(int x, int y, int w, int h) {
CCRenderState.changeTexture(tex);
CCRenderState.reset();
CCRenderState.startDrawing();
int[] sw = new int[]{x, x+seg_w[0], x+w-seg_w[2], x+w};
int[] sh = new int[]{y, y+seg_h[0], y+h-seg_h[2], y+h};
for(int seg = 0; seg < 9; seg++)
drawSeg(sw, sh, seg);
CCRenderState.draw();
}
示例8: renderChest
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void renderChest(int rotation, Frequency freq, double x, double y, double z, int offset, float lidAngle) {
TileEntityRendererDispatcher info = TileEntityRendererDispatcher.instance;
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
renderEndPortal.render(x, y, z, 0, info.entityX, info.entityY, info.entityZ, info.renderEngine);
GlStateManager.color(1, 1, 1, 1);
TextureUtils.changeTexture("enderstorage:textures/enderchest.png");
GlStateManager.pushMatrix();
GlStateManager.enableRescaleNormal();
GlStateManager.color(1, 1, 1, 1);
GlStateManager.translate(x, y + 1.0, z + 1.0F);
GlStateManager.scale(1.0F, -1F, -1F);
GlStateManager.translate(0.5F, 0.5F, 0.5F);
GlStateManager.rotate(rotation * 90, 0.0F, 1.0F, 0.0F);
GlStateManager.translate(-0.5F, -0.5F, -0.5F);
model.chestLid.rotateAngleX = lidAngle;
model.render(freq.hasOwner());
GlStateManager.popMatrix();
GlStateManager.pushMatrix();
GlStateManager.translate(x, y, z);
renderButtons(freq, rotation, lidAngle);
GlStateManager.popMatrix();
double time = ClientUtils.getRenderTime() + offset;
Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + 0.2 + lidAngle * -0.5 + RenderUtils.getPearlBob(time), z + 0.5), new Rotation(time / 3, new Vector3(0, 1, 0)), 0.04);
GlStateManager.disableLighting();
TextureUtils.changeTexture("enderstorage:textures/hedronmap.png");
GlStateManager.pushMatrix();
ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
ccrs.draw();
GlStateManager.popMatrix();
GlStateManager.enableLighting();
}
示例9: renderItem
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
renderWrapped(stack);
double rot = ClientUtils.getRenderTime() / 3F;
double height;
double size;
double updown = (float) Math.sin(((ClientUtils.getRenderTime() % 50) / 25F) * 3.141593) * 0.2;
if (stack.getMetadata() == 0) {
height = 0.9;
size = 0.08;
} else {
height = 0.5;
size = 0.05;
}
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(0.5, height + (updown + 0.3), 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);
disableLighting();
pushMatrix();
TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
CCModelLibrary.icosahedron4.render(ccrs, pearlMat);
ccrs.draw();
popMatrix();
enableLighting();
}
示例10: renderStatic
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderStatic(PartSidedPipe transmitter, int pass)
{
CCRenderState.reset();
CCRenderState.hasColour = true;
CCRenderState.setBrightness(transmitter.world(), transmitter.x(), transmitter.y(), transmitter.z());
for(ForgeDirection side : ForgeDirection.VALID_DIRECTIONS)
{
renderSide(side, transmitter, pass);
}
}
示例11: renderStatic
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderStatic(PartGlowPanel panel)
{
CCRenderState.reset();
CCRenderState.setBrightness(panel.world(), panel.x(), panel.y(), panel.z());
Colour colour = new ColourRGBA(panel.colour.getColor(0), panel.colour.getColor(1), panel.colour.getColor(2), 1);
int side = panel.side.ordinal();
frameModels[side].render(new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon));
lightModels[side].render(new Translation(panel.x(), panel.y(), panel.z()), new IconTransformation(icon), new ColourMultiplier(colour.rgba()));
}
示例12: renderInventoryBlock
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {
//GL11.glPushMatrix();
block.setBlockBoundsForItemRender();
Cuboid6 blockBounds = new Cuboid6(
block.getBlockBoundsMinX(),
block.getBlockBoundsMinY(),
block.getBlockBoundsMinZ(),
block.getBlockBoundsMaxX(),
block.getBlockBoundsMaxY(),
block.getBlockBoundsMaxZ());
model.generateBlock(0, blockBounds);
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
RenderVariation var = ((Carvable) block).getVariation(metadata);
pos.set(0, 0, 0);
CCRenderState.reset();
TextureUtils.bindAtlas(0);
CCRenderState.pullLightmap();
for (int i = 0; i < 6; i++) {
for (int j = 0; j < 4; j++) {
verts[j] = model.verts[j + i * 4];
}
var.setup(verts, i, pos, null, blockBounds);
var.renderSide(verts, i, pos, null, block.getRenderColor(i) << 8 | 0xFF, blockBounds);
}
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
//GL11.glPopMatrix();
}
示例13: render
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void render(TileChunkLoaderBase tile, double x, double y, double z, float partialTicks, int destroyStage, float alpha) {
CCRenderState ccrs = CCRenderState.instance();
ccrs.reset();
ccrs.setBrightness(tile.getWorld(), tile.getPos());
double rot = ClientUtils.getRenderTime() * 2;
double height;
double size;
double updown = (ClientUtils.getRenderTime() % 50) / 25F;
updown = (float) Math.sin(updown * 3.141593);
updown *= 0.2;
if (tile instanceof TileChunkLoader) {
TileChunkLoader ctile = (TileChunkLoader) tile;
rot /= Math.pow(ctile.radius, 0.2);
height = 0.9;
size = 0.08;
} else if (tile instanceof TileSpotLoader) {
height = 0.5;
size = 0.05;
} else {
return;
}
RenderInfo renderInfo = tile.renderInfo;
double active = (renderInfo.activationCounter) / 20D;
if (tile.active && renderInfo.activationCounter < 20) {
active += partialTicks / 20D;
} else if (!tile.active && renderInfo.activationCounter > 0) {
active -= partialTicks / 20D;
}
if (renderInfo.showLasers) {
disableTexture2D();
disableLighting();
disableFog();
drawRays(x, y, z, rot, updown, tile.getPos().getX(), tile.getPos().getY(), tile.getPos().getZ(), tile.getChunks());
enableTexture2D();
enableLighting();
enableFog();
}
rot = ClientUtils.getRenderTime() * active / 3F;
Matrix4 pearlMat = RenderUtils.getMatrix(new Vector3(x + 0.5, y + height + (updown + 0.3) * active, z + 0.5), new Rotation(rot, new Vector3(0, 1, 0)), size);
disableLighting();
pushMatrix();
TextureUtils.changeTexture("chickenchunks:textures/hedronmap.png");
ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
CCModelLibrary.icosahedron7.render(ccrs, pearlMat);
ccrs.draw();
popMatrix();
enableLighting();
}
示例14: renderWorldBlock
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks rendererOld) {
block.setBlockBoundsBasedOnState(world, x, y, z);
Cuboid6 blockBounds = new Cuboid6(
block.getBlockBoundsMinX(),
block.getBlockBoundsMinY(),
block.getBlockBoundsMinZ(),
block.getBlockBoundsMaxX(),
block.getBlockBoundsMaxY(),
block.getBlockBoundsMaxZ());
model.generateBlock(0, blockBounds);
if (block instanceof BlockMarbleSlab)
x = x + 0;
int meta = world.getBlockMetadata(x, y, z);
RenderVariation var = ((Carvable) block).getVariation(meta);
CCRenderState.reset();
//CCRenderState.useModelColours(true);
pos.set(x, y, z);
lightmatrix.locate(world, x, y, z);
switch (var == null ? -1 : var.kind) {
case -1:
return rendererOld.renderStandardBlock(block, x, y, z);
default:
rendererCTM.blockAccess = world;
rendererCTM.renderMaxX = 1.0;
rendererCTM.renderMaxY = 1.0;
rendererCTM.renderMaxZ = 1.0;
for (int i = 0; i < 6; i++) {
for (int j = 3; j > -1 ; j--) {
verts[j] = model.verts[j + i * 4];
}
//Tessellator.instance.setBrightness(world.getLightBrightnessForSkyBlocks(x,y,z,15));
//CCRenderState.pullLightmap();
var.setup(verts, i, pos, world, blockBounds);
var.renderSide(verts, i, pos, lightmatrix, block.colorMultiplier(world, x, y, z) << 8 | 0xFF, blockBounds);
}
}
return true;
}