如何编写“材料模块”用于 3D 渲染?
在某些时候,我想为我的 3D 渲染引擎编写某种类型的动态材质处理模块。它应该是可移植的(GL、D3D 等)。当我说“动态”时,我指的是能够加载材质定义和数据运行时的模块(通过我的资源管理模块)。
材质模块应该处理基本的图元:纹理、法线贴图、片段着色器等等。
我该如何开始?反复试验肯定会产生两三个完全毫无价值的原型,我宁愿跳过。您能给我指出一些好的、甚至很棒的设计/实现/教程/文章,它们可能对我的探索有帮助吗?
At some point I would like to write some type of dynamic material-handling module for my 3D rendering engine. It should be portable (GL, D3D, etc). And when I say "dynamic" I mean a module that is able to load material definitions and data runtime (through my resource management module).
The material module should cope with basic primitives: textures, normal maps, fragment shaders, and so on and so forth.
How do I start? Trial and error is sure to result in two or three totally worthless prototypes, which I would prefer to skip. Could you point me at some good, or even great, design/implementation/tutorial/article that might help me in my quest?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我首先查看免费提供的 Blender 代码。
另外,看看这本书:3d 计算机图形
我发现它非常有帮助在解释基本原理时
I'd start by looking at the freely available Blender code.
Also, have a look at this book: 3d Computer Graphics
I found it enormously helpful at explaining the fundamentals
这是一个非常大的话题;构建一个高效的材料系统一开始很难,但加上你希望它是可移植的和动态的,而且它实际上并没有比这更复杂的了。
值得一看的地方(Google 会找到所有这些):
建议:
Thats a really big topic; architecting an efficient material system is hard to begin with, but add in that you want it to be portable AND dynamic, and it doesn't really get much more complex than that.
Places to look (Google will find all these):
Advice: