本文整理汇总了Java中codechicken.lib.render.CCRenderState.draw方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.draw方法的具体用法?Java CCRenderState.draw怎么用?Java CCRenderState.draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codechicken.lib.render.CCRenderState
的用法示例。
在下文中一共展示了CCRenderState.draw方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: 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();
}
示例4: 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();
}
示例5: 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();
}
示例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: drawOverlayTex
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void drawOverlayTex(int x, int y, int w, int h, float zLevel) {
GlStateManager.color(1, 1, 1, 1);
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.optionsBackground);
WorldRenderer r = CCRenderState.startDrawing();
r.addVertexWithUV(x, y, zLevel, 0, 0);
r.addVertexWithUV(x, y + h, zLevel, 0, h / 16D);
r.addVertexWithUV(x + w, y + h, zLevel, w / 16D, h / 16D);
r.addVertexWithUV(x + w, y, zLevel, w / 16D, 0);
CCRenderState.draw();
}
示例9: 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();
}
示例10: 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();
}
示例11: renderItem
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@Override
public void renderItem(ItemStack stack, TransformType transformType) {
GlStateManager.pushMatrix();
TextureUtils.changeTexture("translocator:textures/model/tex.png");
CCRenderState ccrs = CCRenderState.instance();
ccrs.startDrawing(4, DefaultVertexFormats.POSITION_TEX_COLOR_NORMAL);
TileTranslocatorRenderer.renderAttachment(ccrs, 2, stack.getItemDamage(), 1D, 0, 0.0D, 0.0D, 0.5D);
ccrs.draw();
GlStateManager.popMatrix();
}
示例12: drawOverlayTex
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public static void drawOverlayTex(int x, int y, int w, int h, float zLevel) {
GlStateManager.color(1, 1, 1, 1);
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.OPTIONS_BACKGROUND);
CCRenderState ccrs = CCRenderState.instance();
BufferBuilder buffer = ccrs.startDrawing(GL11.GL_QUADS, DefaultVertexFormats.POSITION_TEX);
buffer.pos(x, y, zLevel).tex(0, 0).endVertex();
buffer.pos(x, y + h, zLevel).tex(0, h / 16D).endVertex();
buffer.pos(x + w, y + h, zLevel).tex(w / 16D, h / 16D).endVertex();
buffer.pos(x + w, y, zLevel).tex(w / 16D, 0).endVertex();
ccrs.draw();
}
示例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: drawLiquidSpiral
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
private void drawLiquidSpiral(CCRenderState ccrs, int src, int dst, FluidStack stack, double start, double end, double time, double theta0, double x, double y, double z) {
RenderUtils.preFluidRender();
TextureAtlasSprite tex = RenderUtils.prepareFluidRender(stack, 255);
VertexBuffer vertexBuffer = ccrs.startDrawing(7, DefaultVertexFormats.POSITION_TEX);
vertexBuffer.setTranslation(x, y, z);
Vector3[] last = new Vector3[] { new Vector3(), new Vector3(), new Vector3(), new Vector3() };
Vector3[] next = new Vector3[] { new Vector3(), new Vector3(), new Vector3(), new Vector3() };
double tess = 0.05;
Vector3 a = getPerp(src, dst);
boolean rev = sum(a.copy().crossProduct(getPathNormal(src, dst, 0))) != sum(sideVec[src]);
for (double di = end; di <= start; di += tess) {
Vector3 b = getPathNormal(src, dst, di);
Vector3 c = getPath(src, dst, di);
if (rev) {
b.negate();
}
double r = (2 * di - time / 10 + theta0 + dst / 6) * 2 * Math.PI;
double sz = 0.1;
Vector3 p = c.add(a.copy().multiply(MathHelper.sin(r) * sz)).add(b.copy().multiply(MathHelper.cos(r) * sz));
double s1 = 0.02;
double s2 = -0.02;
next[0].set(p).add(a.x * s1 + b.x * s1, a.y * s1 + b.y * s1, a.z * s1 + b.z * s1);
next[1].set(p).add(a.x * s2 + b.x * s1, a.y * s2 + b.y * s1, a.z * s2 + b.z * s1);
next[2].set(p).add(a.x * s2 + b.x * s2, a.y * s2 + b.y * s2, a.z * s2 + b.z * s2);
next[3].set(p).add(a.x * s1 + b.x * s2, a.y * s1 + b.y * s2, a.z * s1 + b.z * s2);
if (di > end) {
double u1 = tex.getInterpolatedU(Math.abs(di) * 16);
double u2 = tex.getInterpolatedU(Math.abs(di - tess) * 16);
for (int i = 0; i < 4; i++) {
int j = (i + 1) % 4;
Vector3 axis = next[j].copy().subtract(next[i]);
double v1 = tex.getInterpolatedV(Math.abs(next[i].scalarProject(axis)) * 16);
double v2 = tex.getInterpolatedV(Math.abs(next[j].scalarProject(axis)) * 16);
vertexBuffer.pos(next[i].x, next[i].y, next[i].z).tex(u1, v1).endVertex();
vertexBuffer.pos(next[j].x, next[j].y, next[j].z).tex(u1, v2).endVertex();
vertexBuffer.pos(last[j].x, last[j].y, last[j].z).tex(u2, v2).endVertex();
vertexBuffer.pos(last[i].x, last[i].y, last[i].z).tex(u2, v1).endVertex();
}
}
Vector3[] tmp = last;
last = next;
next = tmp;
}
ccrs.draw();
vertexBuffer.setTranslation(0, 0, 0);
RenderUtils.postFluidRender();
}