用于 OpenGL3.1 的分层 COLLADA 加载器语境

发布于 2024-10-16 09:05:36 字数 600 浏览 10 评论 0原文

哪些层有助于有效地实现这一点?最好是这样,我能够将下面列出的这三个组件与早期层一起使用,并在进行过程中对其余部分进行编码。

我正在编写一个 COLLADA 加载库以与我的图形引擎一起使用。当然,我一开始就注意到这似乎是一项相当艰巨的任务。我现在打算编写库来使用不同的层。

我还不明白 COLLADA。我假设可能有:

  • 几何层
  • 着色器层
  • 纹理层

即使这些我不确定,也可能需要成为不同类型的分层方案的一部分。

旁注,我很可能会使用 irrXML 或这个 有趣的 XML 库 我刚刚读到此处阅读文件,除非另有建议。

What layers would aid in implementing this efficiently? Preferably such that I am able to get these three components listed below up with the early layers and code the rest as I go.

I am writing a COLLADA loading library to use with my graphics engine. So of course as soon as I began I notice this seems to be a rather large task. I now intend to write the library to use different layers.

I do not yet understand COLLADA. I'm assuming there may be:

  • Geometry layer
  • Shader layer
  • Texure Layer

Even these I'm unsure of, may need to be part of a different sort of layering scheme.

Side note, I will most likely be using irrXML or this interesting XML library I just read about here to read the files unless advised otherwise.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

任谁 2024-10-23 09:05:37

您是否知道开放资产导入库http://assimp.sourceforge.net/)?它对 Collada 加载和图形引擎中的目标使用有相当不错的支持。自己编写一个 Collada 加载器不仅很困难,而且还需要很长时间才能使其足够稳定以供生产使用,主要是因为格式非常复杂(或者,正如 Assimp 的 Collada 加载器的主要作者开玩笑所说的那样:几乎图灵完备),每个出口商都有自己奇怪的习惯。

如果您需要其他功能,您可以基于 Assimp 的 Collada 加载器进行工作,并添加您需要的内容(BSD 许可证,只要注明来源即可使用)。

注意:我与该项目有关联,因此并不公正。但在我们编写自己的 Collada 加载程序时经历了可怕的经历之后,我只是觉得必须警告你......

旁注,我很可能会使用 irrXML

我们也使用它。 如果你真的从头开始,就不要。使用 DOM 解析器,例如 TinyXML。 Collada 很复杂,但定义非常明确,SAX 解析器只会强化工作,因为您必须自己构建文档树(并且您*将**需要一个类似于完整文档的数据结构 - Collada 元素是高度互连的。要从中读取有意义的内容,需要解决各种交叉引用)。

Are you aware of Open Asset Import Library (http://assimp.sourceforge.net/)? It has quite decent support for Collada loading and targets use in graphics engines. Writing a collada loader on your own is not only hard, it also takes ages to get it stable enough for productive use, mostly because the format is terribly complex (or, as the primary author of Assimp's Collada loader jokingly put is: almost turing-complete) and every exporter has its own strange habits.

If you need additional features, you can base your work on Assimp's Collada loader and add just what you need (BSD license, you may take it as long as you attribute the source).

Note: I am affliated with the project and thus not unbiased. But after the horrible experiences we made with writing our own Collada loader, I just feel like having to warn you …

Side note, I will most likely be using irrXML

We use it too. Should you really start from scratch, don't. Use a DOM parser, such as TinyXML. Collada is complex but very well-defined, a SAX parser just hardens the work since you have to build the document tree on your own (and you *will** need a data structure to resemble the full document - Collada elements are highly interconnected. To read something meaningful out of them, various cross references need to be resolved).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文