OpenGL 1.1着色和大纲对象

时间:2012-12-06 00:40:32

标签: java opengl-es opengl-es-1.1

我正在为我的世界制作mod并且我正在添加夜视但是有没有办法可以使用滤镜更改每个模型的渲染?

GL11.glDisable(GL11.GL_TEXTURE_2D);
    Tessellator var7 = Tessellator.instance;
    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    var7.startDrawingQuads();
    var7.setTranslation(par1, par3, par5);
    var7.setNormal(0.0F, 0.0F, -1.0F);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ);
    var7.setNormal(0.0F, 0.0F, 1.0F);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ);
    var7.setNormal(0.0F, -1.0F, 0.0F);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ);
    var7.setNormal(0.0F, 1.0F, 0.0F);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ);
    var7.setNormal(-1.0F, 0.0F, 0.0F);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.minX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ);
    var7.setNormal(1.0F, 0.0F, 0.0F);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.minZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.maxY, par0AxisAlignedBB.maxZ);
    var7.addVertex(par0AxisAlignedBB.maxX, par0AxisAlignedBB.minY, par0AxisAlignedBB.maxZ);
    var7.setTranslation(0.0D, 0.0D, 0.0D);
    var7.draw();
    GL11.glEnable(GL11.GL_TEXTURE_2D);

在此代码中允许OpenGL在调用绘图方法之前过滤图像和/或轮廓。

1 个答案:

答案 0 :(得分:0)

OpenGL不是一个场景图,它基本上只是一些复杂的“笔和纸”。因此,您可以获得创意并找出一些能够带来理想效果的绘图方案。

Tesselator类不是OpenGL的一部分;如果我不得不猜测,它可能是Minecraft代码的一部分。肯定可以像你想要的那样添加这样的效果,但它并不像“扔几个开关”那么简单。我建议你先从头开始编写一些OpenGL编码,以了解OpenGL的工作原理。这将为您提供更好的修改复杂程序的起点。