简体   繁体   English

使用C ++和DirectX从零开始在3D游戏中创建效果

[英]Creating effects in 3D game from scratch, using c++ and DirectX

So the title says it. 标题就是这样。 I couldn't find any info on how actualy build effects into 3D game. 我找不到有关如何在3D游戏中实际建立效果的任何信息。 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. 我发现一些关于粒子系统的方法可能是正确的方法,但是DirectX和Google上的粒子系统之间的任何其他连接都给出了3DSmax等结果。

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). 因此,如果您能为我提供一些指导性的教程或对其进行解释,我将不胜感激。最后一个可能性是使我指向专注于此问题的一些简单引擎(我并不是很想花很多时间编写代码,了解此引擎的工作原理后,我只需要查看他们如何实现此FX东西即可。

Thanks 谢谢

PS: the other possibilitie would be if you know about good book discusing this. PS:另一种可能是,如果您知道一本好书来解决这个问题。 It can be more complex but apart from tutorial, books are usually wrote more basicly so this would be also nice way to go 它可能更复杂,但是除了教程之外,书籍通常写得更基础,因此这也是不错的选择

First of all: particle effects are just one kind of effects, it's better you specify the word particle engine :p. 首先:粒子特效只是一种特效,最好指定粒子引擎:p一词。

Secondly: search int he articles of Gamedev , it's really the best resource if you want things like this. 其次:在Gamedev的文章中搜索 ,如果您想要这样的东西,那的确是最好的资源。 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. 我可以链接的两篇文章是有关OpenGL中的粒子NeHe课程 ,它不是DirectX的,但是OpenGL的NeHe教程非常好。 I also found one for directx8 and VB (so a little bit older). 我还发现了一个用于Directx8和VB的 (太旧了)。

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 (eg OGRE) on how they implement it or even better, specific particle engines. 请记住,如果您无法自行优化粒子引擎,通常会对性能造成很大的影响,所以请尝试研究开源游戏引擎(例如OGRE)如何实现它甚至更好的特定粒子引擎。

So I would be thankful if you would point me on some tutorials for this 因此,如果您能为此指出一些教程,我将不胜感激。

You need to download microsoft DirectX SDK . 您需要下载Microsoft DirectX SDK In addition to it, you should try NVidia SDK . 除此之外,您应该尝试NVidia SDK You may also try ATI SDK . 您也可以尝试ATI SDK Study them all. 研究他们全部。

In addition to them... there are couple of books on OpenGL: "Red Book" , "Blue Book" , Orange Book . 除了它们...在OpenGL上还有几本书: “ Red Book”“ Blue Book”Orange Book "Computer graphics using OpenGL" by Francis Hill is also a very good one. 弗朗西斯·希尔(Francis Hill)的“使用OpenGL的计算机图形学”也是一个很好的例子。

Get this info, and start reading. 获取此信息,然后开始阅读。

how actualy build effects into 3D game 实际上如何在3D游戏中建立效果

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. 目前尚不清楚您在谈论哪种效果。

What do you think is better DirectX or OpenGL. 您认为更好的DirectX或OpenGL。

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"). OpenGL更适合玩耍和实验(因为您可以轻松绘制三角形而不会弄乱硬件缓冲区),可在更多平台上使用,而且GLSL比HLSL更好(因为它不会“编译成汇编语言”)。 DirectX is geared towards performance from the beginning, available on XBox360, and 9th version was actually good. DirectX从一开始就着眼于性能,可以在XBox360上使用,而第9版确实不错。 openGL is more "abstract" and DirectX is closer to hardware. openGL更“抽象”,而DirectX更接近硬件。

If you could use the factors as simplicity, area of usage, performance, number of examples and resources etc 如果可以使用这些因素,例如简单性,使用范围,性能,示例数量和资源等

  1. If you want simplicity, you should forget about making game engine. 如果您想要简单,则应该忘记制作游戏引擎。 You'll have to learn quite a lot of things if you want to deal with 3D. 如果要处理3D,则必须学习很多东西。
  2. Both DirectX and OpenGL are used for making 3d-related products. DirectX和OpenGL均用于制作3D相关产品。
  3. You can get good performance with both DirectX and OpenGL, and get poor performance if you don't know what you're doing. 使用DirectX和OpenGL可以获得良好的性能,如果您不知道自己在做什么,则性能会很差。
  4. Both DirectX and OpenGL have insane amount of examples and books - just search for it. DirectX和OpenGL都有大量的示例和书籍-只需搜索即可。 They weren't made yesterday, so enough information is already available. 它们不是昨天制作的,因此已经有足够的信息。

You need to select goal, select platform, select your API, research available technologies, and start writing code. 您需要选择目标,选择平台,选择API,研究可用的技术并开始编写代码。 Wondering "which one is better" is a waste of time. 想知道“哪个更好”是浪费时间。 3D knowledge and algorithm are equally applicable to both APIs. 3D知识和算法同样适用于两种API。

OpenGL is the best bet to learn I feel. OpenGL是我感觉最好的选择。 Glut is available free of cost and has all the functions you need to implement a particle engine. Glut是免费提供的,具有实现粒子引擎所需的所有功能。 Plus theres loads of sample code online. 另外还有在线示例代码。 I like the way functions are . 我喜欢函数的方式。 Easy to remember and use logically 易于记忆和逻辑使用

The best books for learning D3D9.0c/D3D10 are by Frank Luna. 学习D3D9.0c / D3D10的最佳书籍是Frank Luna。 Just put him in to amazon or google and you'll get results. 只需将他放到亚马逊或Google中,您就会得到结果。 He teaches how to build a fully-fledged game engine from scratch. 他教授如何从头开始构建成熟的游戏引擎。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM