退化的顶点和GL_LINE_STRIP [英] degenerated vertices and GL_LINE_STRIP

查看:265
本文介绍了退化的顶点和GL_LINE_STRIP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在iOS 5.1上

我试图在同一顶点数组中显示几条线,但我想使用退化的顶点将它们分开.但这似乎行不通.在每批顶点之间绘制I线.

I was trying to display several batch of lines in the same vertex array and I wanted to separate them using degenerated vertices. But it does not seem to work. I line is drawn between each batch of vertices.

谷歌搜索这个问题给了我结果,退化的顶点与GL_LINE_STRIP不兼容,但是我不确定.有人可以确认吗?还有什么选择呢?

Googling the problem gave me results that degenerated vertices was not compatible with GL_LINE_STRIP but I'm not really sure about it. Can someone confirm that? And also what's the alternative ?

推荐答案

虽然您不能在线带中使用退化顶点,但是可以使用原始重启索引(通常对于数字类型,可能使用最大索引值),在Direct3D术语中也称为带状切割索引.可以使用glPrimitiveRestartIndex进行配置.

Whereas you can't use degenerate vertices in a line strip, you can use a primitive restart index (usually the maximum index value possible for the numeric type), also called a strip-cut index in Direct3D parlance. It can be configured using glPrimitiveRestartIndex.

这篇关于退化的顶点和GL_LINE_STRIP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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