本文整理汇总了Java中net.minecraft.client.renderer.vertex.VertexFormatElement.EnumUsage方法的典型用法代码示例。如果您正苦于以下问题:Java VertexFormatElement.EnumUsage方法的具体用法?Java VertexFormatElement.EnumUsage怎么用?Java VertexFormatElement.EnumUsage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类net.minecraft.client.renderer.vertex.VertexFormatElement
的用法示例。
在下文中一共展示了VertexFormatElement.EnumUsage方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: applyVertexDataForType
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
private void applyVertexDataForType(int index, VertexFormatElement.EnumUsage type, UnpackedBakedQuad.Builder builder) {
switch (type) {
case POSITION:
builder.put(index, x, y, z, 1);
break;
case UV:
builder.put(index, u, v, 0, 1);
break;
case COLOR:
builder.put(index, r, g, b, a);
break;
case NORMAL:
builder.put(index, nX, nY, nZ, 0);
break;
case PADDING:
//TODO: figure this one out
builder.put(index);
break;
case GENERIC:
//TODO: figure this one out
builder.put(index);
}
}
示例2: transformUnpackedVertexDataElement
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
public final void transformUnpackedVertexDataElement(VertexFormatElement.EnumUsage type, float[] data, Vector4f temp) {
switch (type) {
case POSITION:
case NORMAL:
this.matrices.transform(data[0], data[1], data[2], 1, temp);
data[0] = temp.x;
data[1] = temp.y;
data[2] = temp.z;
break;
case COLOR:
data[0] = getRed();
data[1] = getGreen();
data[2] = getBlue();
data[3] = getAlpha();
break;
}
}
示例3: draw
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void draw(VertexBuffer vertexBufferIn)
{
if (vertexBufferIn.getVertexCount() > 0)
{
VertexFormat vertexformat = vertexBufferIn.getVertexFormat();
int i = vertexformat.getNextOffset();
ByteBuffer bytebuffer = vertexBufferIn.getByteBuffer();
List<VertexFormatElement> list = vertexformat.getElements();
for (int j = 0; j < list.size(); ++j)
{
VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j);
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int k = vertexformatelement.getType().getGlConstant();
int l = vertexformatelement.getIndex();
bytebuffer.position(vertexformat.getOffset(j));
// moved to VertexFormatElement.preDraw
vertexformatelement.getUsage().preDraw(vertexformat, j, i, bytebuffer);
}
GlStateManager.glDrawArrays(vertexBufferIn.getDrawMode(), 0, vertexBufferIn.getVertexCount());
int i1 = 0;
for (int j1 = list.size(); i1 < j1; ++i1)
{
VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1);
VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage();
int k1 = vertexformatelement1.getIndex();
// moved to VertexFormatElement.postDraw
vertexformatelement1.getUsage().postDraw(vertexformat, i1, i, bytebuffer);
}
}
vertexBufferIn.reset();
}
示例4: renderBlockLayer
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
private void renderBlockLayer(BlockRenderLayer layer) {
if (OpenGlHelper.useVbo()) {
GlStateManager.glEnableClientState(32884);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.glEnableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.glEnableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.glEnableClientState(32886);
}
this.chunkContainer.renderLayer(layer);
if (OpenGlHelper.useVbo()) {
for (VertexFormatElement element : DefaultVertexFormats.BLOCK.getElements()) {
VertexFormatElement.EnumUsage usage = element.getUsage();
int index = element.getIndex();
switch (usage) {
case POSITION:
GlStateManager.glDisableClientState(32884);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + index);
GlStateManager.glDisableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case COLOR:
GlStateManager.glDisableClientState(32886);
GlStateManager.resetColor();
}
}
}
}
示例5: func_181679_a
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
public void func_181679_a(WorldRenderer p_181679_1_)
{
if (p_181679_1_.getVertexCount() > 0)
{
VertexFormat vertexformat = p_181679_1_.getVertexFormat();
int i = vertexformat.getNextOffset();
ByteBuffer bytebuffer = p_181679_1_.getByteBuffer();
List<VertexFormatElement> list = vertexformat.getElements();
for (int j = 0; j < list.size(); ++j)
{
VertexFormatElement vertexformatelement = (VertexFormatElement)list.get(j);
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int k = vertexformatelement.getType().getGlConstant();
int l = vertexformatelement.getIndex();
bytebuffer.position(vertexformat.func_181720_d(j));
switch (vertexformatelement$enumusage)
{
case POSITION:
GL11.glVertexPointer(vertexformatelement.getElementCount(), k, i, bytebuffer);
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + l);
GL11.glTexCoordPointer(vertexformatelement.getElementCount(), k, i, bytebuffer);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case COLOR:
GL11.glColorPointer(vertexformatelement.getElementCount(), k, i, bytebuffer);
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
break;
case NORMAL:
GL11.glNormalPointer(k, i, bytebuffer);
GL11.glEnableClientState(GL11.GL_NORMAL_ARRAY);
}
}
GL11.glDrawArrays(p_181679_1_.getDrawMode(), 0, p_181679_1_.getVertexCount());
int i1 = 0;
for (int j1 = list.size(); i1 < j1; ++i1)
{
VertexFormatElement vertexformatelement1 = (VertexFormatElement)list.get(i1);
VertexFormatElement.EnumUsage vertexformatelement$enumusage1 = vertexformatelement1.getUsage();
int k1 = vertexformatelement1.getIndex();
switch (vertexformatelement$enumusage1)
{
case POSITION:
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + k1);
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case COLOR:
GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
GlStateManager.resetColor();
break;
case NORMAL:
GL11.glDisableClientState(GL11.GL_NORMAL_ARRAY);
}
}
}
p_181679_1_.reset();
}
示例6: renderBlockLayer
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
private void renderBlockLayer(EnumWorldBlockLayer blockLayerIn)
{
this.mc.entityRenderer.enableLightmap();
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
}
this.renderContainer.renderChunkLayer(blockLayerIn);
if (OpenGlHelper.useVbo())
{
for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements())
{
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int i = vertexformatelement.getIndex();
switch (vertexformatelement$enumusage)
{
case POSITION:
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i);
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case COLOR:
GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
GlStateManager.resetColor();
}
}
}
this.mc.entityRenderer.disableLightmap();
}
示例7: renderBlockLayer
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
private void renderBlockLayer(EnumWorldBlockLayer blockLayerIn)
{
this.mc.entityRenderer.enableLightmap();
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
}
if (Config.isShaders())
{
ShadersRender.preRenderChunkLayer();
}
this.renderContainer.renderChunkLayer(blockLayerIn);
if (Config.isShaders())
{
ShadersRender.postRenderChunkLayer();
}
if (OpenGlHelper.useVbo())
{
for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements())
{
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int i = vertexformatelement.getIndex();
switch (RenderGlobal.RenderGlobal$2.field_178037_a[vertexformatelement$enumusage.ordinal()])
{
case 1:
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
break;
case 2:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i);
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case 3:
GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
GlStateManager.resetColor();
}
}
}
this.mc.entityRenderer.disableLightmap();
}
示例8: renderBlockLayer
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
private void renderBlockLayer(EnumWorldBlockLayer blockLayerIn)
{
this.mc.entityRenderer.enableLightmap();
if (OpenGlHelper.useVbo())
{
GL11.glEnableClientState(GL11.GL_VERTEX_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
GL11.glEnableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GL11.glEnableClientState(GL11.GL_COLOR_ARRAY);
}
this.renderContainer.renderChunkLayer(blockLayerIn);
if (OpenGlHelper.useVbo())
{
for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements())
{
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int i = vertexformatelement.getIndex();
switch (RenderGlobal.RenderGlobal$2.field_178037_a[vertexformatelement$enumusage.ordinal()])
{
case 1:
GL11.glDisableClientState(GL11.GL_VERTEX_ARRAY);
break;
case 2:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i);
GL11.glDisableClientState(GL11.GL_TEXTURE_COORD_ARRAY);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case 3:
GL11.glDisableClientState(GL11.GL_COLOR_ARRAY);
GlStateManager.resetColor();
}
}
}
this.mc.entityRenderer.disableLightmap();
}
示例9: renderBlockLayer
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
private void renderBlockLayer(BlockRenderLayer blockLayerIn)
{
this.mc.entityRenderer.enableLightmap();
if (OpenGlHelper.useVbo())
{
GlStateManager.glEnableClientState(32884);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.glEnableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.glEnableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.glEnableClientState(32886);
}
if (Config.isShaders())
{
ShadersRender.preRenderChunkLayer(blockLayerIn);
}
this.renderContainer.renderChunkLayer(blockLayerIn);
if (Config.isShaders())
{
ShadersRender.postRenderChunkLayer(blockLayerIn);
}
if (OpenGlHelper.useVbo())
{
for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements())
{
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int i = vertexformatelement.getIndex();
switch (vertexformatelement$enumusage)
{
case POSITION:
GlStateManager.glDisableClientState(32884);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.glDisableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case COLOR:
GlStateManager.glDisableClientState(32886);
GlStateManager.resetColor();
}
}
}
this.mc.entityRenderer.disableLightmap();
}
示例10: renderBlockLayer
import net.minecraft.client.renderer.vertex.VertexFormatElement; //导入方法依赖的package包/类
@SuppressWarnings("incomplete-switch")
private void renderBlockLayer(BlockRenderLayer blockLayerIn)
{
this.mc.entityRenderer.enableLightmap();
if (OpenGlHelper.useVbo())
{
GlStateManager.glEnableClientState(32884);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.glEnableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.lightmapTexUnit);
GlStateManager.glEnableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
GlStateManager.glEnableClientState(32886);
}
this.renderContainer.renderChunkLayer(blockLayerIn);
if (OpenGlHelper.useVbo())
{
for (VertexFormatElement vertexformatelement : DefaultVertexFormats.BLOCK.getElements())
{
VertexFormatElement.EnumUsage vertexformatelement$enumusage = vertexformatelement.getUsage();
int i = vertexformatelement.getIndex();
switch (vertexformatelement$enumusage)
{
case POSITION:
GlStateManager.glDisableClientState(32884);
break;
case UV:
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit + i);
GlStateManager.glDisableClientState(32888);
OpenGlHelper.setClientActiveTexture(OpenGlHelper.defaultTexUnit);
break;
case COLOR:
GlStateManager.glDisableClientState(32886);
GlStateManager.resetColor();
}
}
}
this.mc.entityRenderer.disableLightmap();
}