英文:
OpenGL Java -- Bulk creation of VBOs
问题
我一直在按照这个 OpenGL 教程进行学习,在将其从 C++ 移植到 Java 时尽力而为,但这让我想知道批量生产 VBOs 的最佳方法是什么。教程中建议使用 VAOs 来存储 VBOs 以备将来使用,然而 LWJGL 论坛表示 VAOs 已被弃用,而推荐直接使用许多许多个 VBOs 或者只制作少量 VBOs,然后重用它们。
无论哪种情况,最佳实现方式是什么?我应该一次性创建所有 VBOs,放在一个类中吗?还是应该创建 Java 类来进一步自动化和抽象这项工作?如果我需要制作许多许多个 VBOs,那么这额外的层次肯定会增加相当多的延迟吧?
无论哪种方式,我都会欣赏任何建议!我对 OpenGL 还不熟悉,但对其原理有相当好的掌握 —— 只是不知道如何实际使用它们!
附:我对 OpenGL 版本没有特定要求。目前我使用的是 3.3 版,但如果有更优版本,我愿意切换。
英文:
I have been following this tutorial for OpenGL, porting it into java from their C++ as best I can but it prompted me to wonder what the best way of mass-producing VBOs is. The tutorial says to use VAOs to store VBOs for later use, however the LWJGL forums say that VAOs are deprecated in favor of simply using many, many VBOs or making just a few, then reusing them.
In either case, how would be the best way to implement this? Should I create each one all at once, in one class? Or should I make java classes to automate and abstract that work further? If I am needing make many, many VBOs, surely that extra layer would add considerable lag?
Either way, any advice is appreciated! I am new to OpenGL, however have a pretty good grip on its workings -- just not how to actually use them!
Ps.: I have no specific requirements for OpenGL version. Currently I am using 3.3, but if another version is optimal, then I would happily switch.
专注分享java语言的经验与见解,让所有开发者获益!
评论