使用 c++ 从头开始在 3D 游戏中创建效果和 DirectX
所以标题就这么说了。我找不到任何有关如何在 3D 游戏中实际构建效果的信息。稍后我可能会坚持使用某些引擎,但为了理解整个事情,我这次需要自己尝试一下。我发现了一些关于粒子系统的信息,这可能是正确的方法,但 Google 上的 DirectX 和粒子系统之间的任何其他连接都会给出 3DSmax 等结果。
因此,如果您能为我指出一些教程或解释它,我将不胜感激... 最后一种可能性是向我指出一些专注于这个东西的简单引擎(我真的不想通过大量代码并理解这个引擎是如何工作的,我只需要看看他们如何实现这个 FX 东西)。
谢谢
PS:另一种可能性是如果你知道讨论这个问题的好书。它可能更复杂,但除了教程之外,书籍通常写得更基础,所以这也是一个不错的选择
So the title says it. I couldn't find any info on how actualy build effects into 3D game. I'll maybe stick to some engine later, but for understanding of this whole thing I would need to try it on my own for this time. I found a few about particle systems which may be the right way but any other connection between DirectX and particle systems on google gave results as 3DSmax and etc.
So I would be thankful if you would point me on some tutorials for this, or explaining it...
Last possibilitie would be pointing me on some simple engine focused on this thing (I don't really want to fight through tons of code and understanding how this engine works, I just need to see how they implement this FX stuff).
Thanks
PS: the other possibilitie would be if you know about good book discusing this. It can be more complex but apart from tutorial, books are usually wrote more basicly so this would be also nice way to go
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
首先:粒子效果只是一种效果,最好指定粒子引擎这个词:p。
其次:搜索Gamedev的文章,如果你想要这样的东西,它确实是最好的资源。您可以在讨论板上找到大量文章,甚至可以找到大量链接和有用信息。我可以链接到的两篇文章是 NeHe 关于 OpenGL 中粒子的课程,它不是 directx,但 NeHe 的 OpenGL 教程非常好。我还找到了一个用于 directx8 和 VB (所以有点旧) 。
请记住,如果您无法自行优化,粒子引擎通常会严重影响性能,因此请尝试查看开源游戏引擎(例如 OGRE)以了解其实现方式,甚至更好的特定粒子引擎。
First of all: particle effects are just one kind of effects, it's better you specify the word particle engine :p.
Secondly: search int he articles of Gamedev, it's really the best resource if you want things like this. You can find lots of articles and even better, tons of links, and useful information on the discussion boards. Two articles I can link to is the NeHe lesson about particles in OpenGL, it's not directx but NeHe tutorials for OpenGL are very good. I also found one for directx8 and VB (so a little bit older).
Keep in mind though that a particle engine is often a huge performance hit if you can't optimize it yourself, so try to look at open source game engines (e.g. OGRE) on how they implement it or even better, specific particle engines.
您需要下载 microsoft DirectX SDK。
除此之外,您还应该尝试 NVidia SDK。
您也可以尝试 ATI SDK。全部研究一下。
除此之外...还有几本关于 OpenGL 的书籍:“红皮书” 、“蓝皮书”、橙皮书 。 Francis Hill 的 《使用 OpenGL 的计算机图形》 也是一本非常好的文章。
获取此信息并开始阅读。
这个问题太宽泛了。有灯光效果、粒子系统、后处理效果、物理(也是效果),甚至角色动画也是效果。目前尚不清楚你所说的是哪种影响。
他们或多或少是平等的。你可以在两者中做同样的事情。两者都尝试一下,然后选择您更喜欢的一个。 OpenGL 更适合玩耍和实验(因为您可以轻松绘制三角形,而不会弄乱硬件缓冲区),可在更多平台上使用,而且 GLSL 比 HLSL 更好(因为它不会“编译成程序集”)。 DirectX从一开始就以性能为导向,在XBox360上可用,第9版实际上还不错。 openGL更“抽象”,DirectX更接近硬件。
您需要选择目标、选择平台、选择 API、研究可用技术并开始编写代码。想知道“哪一个更好”是浪费时间。 3D 知识和算法同样适用于这两个 API。
You need to download microsoft DirectX SDK.
In addition to it, you should try NVidia SDK.
You may also try ATI SDK. Study them all.
In addition to them... there are couple of books on OpenGL: "Red Book", "Blue Book", Orange Book . "Computer graphics using OpenGL" by Francis Hill is also a very good one.
Get this info, and start reading.
This question is too broad. There are lighting effects, particle systems, post-processing effects, physics (which are also effects), and even character animation is an effect. It is unclear what kind of effects you are talking about.
They are more or less equal. You can do same things in both of them. Try both and pick one you liked more. OpenGL is better for playing around and experimenting (because you can easily draw triangle without messing with hardware buffers), available on larger selection of platforms, plus GLSL is better than HLSL (because it doesn't "compile into assembly"). DirectX is geared towards performance from the beginning, available on XBox360, and 9th version was actually good. openGL is more "abstract" and DirectX is closer to hardware.
You need to select goal, select platform, select your API, research available technologies, and start writing code. Wondering "which one is better" is a waste of time. 3D knowledge and algorithm are equally applicable to both APIs.
我觉得OpenGL是学习的最佳选择。 Glut 是免费提供的,并且具有实现粒子引擎所需的所有功能。另外,还有大量在线示例代码。我喜欢函数的样子。易于记忆和逻辑使用
OpenGL is the best bet to learn I feel. Glut is available free of cost and has all the functions you need to implement a particle engine. Plus theres loads of sample code online. I like the way functions are . Easy to remember and use logically
学习 D3D9.0c/D3D10 的最佳书籍由 Frank Luna 编写。只要把他放到亚马逊或谷歌上,你就会得到结果。他教授如何从头开始构建成熟的游戏引擎。
The best books for learning D3D9.0c/D3D10 are by Frank Luna. Just put him in to amazon or google and you'll get results. He teaches how to build a fully-fledged game engine from scratch.