形状之间的LWJGL随机线 [英] LWJGL random lines inbenween shapes

查看:111
本文介绍了形状之间的LWJGL随机线的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想删除游戏中的四边形之间的随机线:

I have random lines inbetween my quads in my game which I would like to remove:

在多维数据集之间似乎有线.有谁知道如何删除它们?我正在使用openGL.

as you can see, there appear to be lines inbetween the cubes. Does anyone know how to remove them? I am using openGL.

我的意思是,是否存在诸如glEnable之类的OpenGL函数来解决此问题?

What I mean is is there any OpenGL functions such as glEnable to fix this?

推荐答案

我猜您在图像上有所有纹理?

I'm guessing you have all of your textures on on image?

在块边缘附近,OpenGL正在对附近的像素进行采样以使其平滑,因此在污垢块的边缘,您可以看到它略微褪色成石块

Near the edge of the block, OpenGL is sampling nearby pixels to make it smooth, so on the edge of your dirt block you can see it slightly fading into a stone block

尝试此版本的lwjgl:

try the lwjgl version of this:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST)

(以上内容在c ++中)

(the above is in in c++)

这将为您提供像我的世界一样的像素化效果

This will give you the pixelated effect like minecraft

请查看此以获取更多信息 http://gregs-blog.com/2008/01/17/opengl-texture-filter-parameters-explained/

Take a look at this for some more info http://gregs-blog.com/2008/01/17/opengl-texture-filter-parameters-explained/

这篇关于形状之间的LWJGL随机线的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆