本文整理汇总了Java中codechicken.lib.render.CCRenderState.useNormals方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.useNormals方法的具体用法?Java CCRenderState.useNormals怎么用?Java CCRenderState.useNormals使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codechicken.lib.render.CCRenderState
的用法示例。
在下文中一共展示了CCRenderState.useNormals方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: 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();
}
示例2: 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();
}
示例3: renderMicroFace
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
public void renderMicroFace(Vertex5[] verts, int side, Vector3 pos,
LightMatrix lightMatrix, IMicroMaterialRender part) {
icontr.bindPart(part);
((BlockPillarUVTransform) icontr).bindSide(side);
((BlockPillarUVTransform) icontr).update();
UV uv = new UV();
Tessellator t = Tessellator.instance;
for (int i = 0; i < 4; i++) {
if (CCRenderState.useNormals()) {
Vector3 n = Rotation.axes[side % 6];
t.setNormal((float) n.x, (float) n.y, (float) n.z);
}
Vertex5 vert = verts[i];
if (lightMatrix != null) {
LC lc = LC.computeO(vert.vec, side);
if (CCRenderState.useModelColours())
lightMatrix.setColour(t, lc, getColour(part));
lightMatrix.setBrightness(t, lc);
} else {
if (CCRenderState.useModelColours())
CCRenderState.vertexColour(getColour(part));
}
icontr.transform(uv.set(vert.uv));
t.addVertexWithUV(vert.vec.x + pos.x, vert.vec.y + pos.y, vert.vec.z + pos.z, uv.u, uv.v);
}
}
示例4: renderSide
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public boolean renderSide(Vertex5[] verts, int side, Vector3 pos,
LightMatrix lightMatrix, int color, Cuboid6 bounds) {
UV uv = new UV();
Tessellator t = Tessellator.instance;
int lim=4;
int start=0;
int change=1;
int p=BlockGlassCarvable.pass;
for (int i = start; i != lim; i+=change) {
int s=p==1?(side%2==0)?side%6+1:side%6-1:side%6;
if (CCRenderState.useNormals()) {
Vector3 n = Rotation.axes[side% 6];
t.setNormal((float) n.x, (float) n.y, (float) n.z);
}
Vertex5 vert = verts[i];
if (lightMatrix != null) {
LC lc = LC.compute(vert.vec, s);
if (CCRenderState.useModelColours())
lightMatrix.setColour(t, lc, color);
lightMatrix.setBrightness(t, lc);
} else {
if (CCRenderState.useModelColours())
CCRenderState.vertexColour(color);
}
apply(uv.set(vert.uv));
if(p==1)
t.addVertexWithUV(vert.vec.x + pos.x+microAdjust[side % 6].x,
vert.vec.y + pos.y+microAdjust[side % 6].y,
vert.vec.z + pos.z+microAdjust[side % 6].z, uv.u, uv.v);
else
t.addVertexWithUV(vert.vec.x + pos.x, vert.vec.y + pos.y, vert.vec.z + pos.z, uv.u, uv.v);
}
return true;
}