gpt4 book ai didi

java - OpenGL 1.1 着色和勾画对象轮廓

转载 作者:行者123 更新时间:2023-12-01 04:58:24 25 4
gpt4 key购买 nike

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

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 在调用绘图方法之前过滤图像和/或轮廓。

最佳答案

OpenGL 不是场景图,它基本上只是一些复杂的“笔和纸”。因此,您必须发挥创意并找出一些绘图方案来实现所需的效果。

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

关于java - OpenGL 1.1 着色和勾画对象轮廓,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13735122/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com