ฉันควรศึกษา OpenGL ต่อไปหรือเพียงแค่เปลี่ยนเป็น DirectX เพื่อให้ฉันมีโอกาสได้งานทำในอุตสาหกรรมเกมมากขึ้น [ปิด]


29

ฉันได้เรียนรู้การเขียนโปรแกรมกราฟิกมาระยะหนึ่งแล้วโดยใช้ OpenGL และ Linux ฉันค่อนข้างคุ้นเคยกับแนวคิดส่วนใหญ่แล้ว แต่ฉันต้องการที่จะเพิ่มพูนความรู้ของฉันและในที่สุดก็มีอาชีพด้านการพัฒนาเกมโดยเฉพาะการพัฒนาโปรแกรมเกม

สำหรับฉันแล้วดูเหมือนว่าสตูดิโอเกมส่วนใหญ่สร้างเกมสำหรับ Windows โดยใช้ DirectX

แก้ไข: ฉันรู้ว่าคำถาม OpenGL กับ DirectX ได้รับการถามที่นี่มาก่อน แต่ฉันไม่พบคำตอบในมุมมองที่ฉันต้องการ

แก้ไข 2: หลังจากอ่านคำตอบ / ความคิดเห็นทั้งหมดฉันตัดสินใจดำน้ำลึกลงไปในกราฟิกด้วย OpenGL / GLSL แต่ฉันจะลองเล่นกับ DX ด้วยเช่นกันเพื่อทำความเข้าใจพื้นฐานของ API ฉันอยากจะขอบคุณทุกคนสำหรับคำตอบและข้อมูลเชิงลึกที่คุณให้กับฉัน


รุ่นทั่วไปของคำถามนี้อาจให้ผลตอบที่ดีบางอย่างที่programmers.stackexchange.com ...
Macke

1
โดยทั่วไปฉันได้รับการสอนจุดที่ดีกว่าของ DX shaders โดยผู้ชาย OpenGL ที่ไม่เคยทำ HLSL ตราบใดที่คุณรู้ว่า "shader ส่วน" หมายถึง "pixel shader" แนวความคิดค่อนข้างเหมือนกัน P
drxzcl

IIRC, DirectX ทำเหมือน OpenGL มากกว่าในรุ่น 8 หรือ 9 ก่อนหน้านี้ DirectX บางครั้งก็ถูกวิจารณ์ว่าเป็นเรื่องยากที่จะใช้งานโดยไม่จำเป็น API ยังคงแตกต่างกัน แต่วิธีการทั่วไปควรคล้ายกันมาก ข้อจำกัดความรับผิดชอบ - ฉันไม่ใช่ผู้เชี่ยวชาญเช่นกัน
Steve314

@Macke - คำแนะนำด้านอาชีพปิดหัวข้อ @ โปรแกรมเมอร์ นี่อาจเป็นคำถามที่เฉพาะเจาะจงเกินไป แต่คำถามทั่วไปเกี่ยวกับอาชีพจะอยู่ในหัวข้อ @ Professional Matters (ปัจจุบันมีให้บริการในพื้นที่ 51)โปรดไปและให้คำมั่นที่จะสนับสนุน SE นี้
ชาด

อัตราต่อรองที่ท่วมท้นคือแม้ว่าคุณจะเข้าสู่อุตสาหกรรมคุณจะไม่เป็นโปรแกรมเมอร์กราฟิกและมันจะไม่สำคัญอย่างน้อยถ้าคุณรู้จัก API ตัวใดตัวหนึ่งทั้งอื่น ๆ หรือไม่มีเลย นอกเหนือจากนั้นขึ้นอยู่กับ บริษัท และโครงการ D3D เป็นวิธีที่ใช้กันอย่างแพร่หลายในพื้นที่ PC, GL | ES มีความโดดเด่นอย่างสมบูรณ์ในพื้นที่มือถือและคอนโซลทั้งหมดใช้ API ที่เป็นกรรมสิทธิ์ซึ่งคุณไม่สามารถเรียนรู้ด้วยตนเองได้
Sean Middleditch

คำตอบ:


28

มันไม่สำคัญหรอก แนวคิดหลักเหมือนกันทั้งคู่โดยเฉพาะอย่างยิ่งในขณะนี้ที่เฉดพิกเซลเป็นบรรทัดฐาน และเนื่องจากเกมส่วนใหญ่เป็นหลายแพลตฟอร์มพวกเขาอาจจะใช้คุณลักษณะย่อยที่มีความคล้ายคลึงกันในทั้งสองภาษา ตราบใดที่คุณสามารถเขียนเฉดสีใน glsl หรือ hlsl คุณก็จะสบายดี

ดังที่กล่าวไปแล้วว่าจำนวน "การพัฒนาเอ็นจิ้นเกม" มีน้อย บริษัท ส่วนใหญ่ใช้บางอย่างนอกชั้นวาง สำหรับตำแหน่งที่มีอยู่แม้น้อยกว่านั้นคือระดับรายการ โปรแกรมเมอร์เกมระดับเริ่มต้นส่วนใหญ่ไม่ได้เขียนโค้ดใด ๆ ที่เกี่ยวข้องกับกราฟิก (นอกเหนือจากอาจจะเป็น shaders) เพราะมันถูกแยกออกไป


1
What do the most entry level programmers do? In large, medium or small studios?
Quazi Irfan

That's a separate question. gamedev.stackexchange.com/questions/5538/…
Tetrad

1
Just to add a more general answer, in my experience junior programmers tend to start off in gameplay, ui, hud and work up from there, gameplay is a popular entry point.
JuniorDeveloper1208

Asset integration menus and UI are even more common entry points from my experience.
Coyote

Guys, let's not start a long thread about that particular question in the comments here. Those are perfectly good answers to the question I linked to.
Tetrad

10

It all depends on the job you want/will get. You probably think about a job in the PC market where DX is king. Just remember that most AAA companies aim for the console market where APIs are quite specific.

The PS3 for example has proprietary extensions to its OpenGL ES implementation.

OpenGL is growing in the mobile space. Now it's available on all modern platforms but Windows Phone 7.

Currently Only OpenGL ES is available in this space. But more Powerful PowerVR chips are coming with support for OpenGL 4 and DX11.

Your OpenGL skills are gold. You can reconvert to DX to land a job which requires that. But in the meantime remember that OpenGL is king on the quantity of devices and platforms where it is available.


Edit: Additionally more and more companies tend to use existing engines and often even core game developers are more and more screened from the low level APIs. It's always better to have a good knowledge of native APIs when you are facing bugs and strange behavior on specific platforms. But it all comes down to the concepts, and as others pointed out DX and OpenGL at the core will require knowledge of the same concepts.


Edit: As you are already familiar with OpenGL and probably shaders you should try OpenCL... This API has the potential of becoming the next big thing in parallel computing.

I'm mentioning it as the OpenCL kernels use datatype that are interoperable with OpenGL and are simple to understand for OpenGL devs. Have a look at that and see if you can acquire some experience with a great general computing solution (currently being integrated into bullet physics for example).


OpenGL being an industry standard it inspired other libs and APIs. You shouldn't neglect its importance. But on the other hand you should not stop at one thing and if I were you I would have a look at higher level APIs and engines which abstract OpenGL and DirectX.
Coyote

I am familiar with OpenCL. I've been working on a side project, building a physics engine(rudimentary, mostly for learning purposes) and I've used a little bit of OpenCL to make it faster but haven't gotten amazing results yet(in some cases I even made it worse)
adivasile

That's a sign of a good try ;) Have a look at the implementation in the bullet engine. Anyhow, good luck with your projects.
Coyote

7

I agree, that it doesn't really matter which API you learn. It's important to know the basic concepts.

When looking at game development, Windows is not the only target platform. As I've heard, Apple is growing as a target platform, but the consoles are really important as well. Consoles normally have their own specialized graphics API (I think they're doing that just to bother us). While the console APIs tend to have more in common with OpenGL than with DirectX, it's still not a huge difference.

Go with whatever works for you.


1
XBox probably does stuff the DirectX way... ?
Macke

Yes, PS3 uses PSGL. But, X360 used DirectX as they are on PC, though not sure about it, just a guess.
Quazi Irfan

I have not experience on the Xbox, but according to Wikipedia its API is based on DirectX. On PS3, PSGL is only one of the available APIs.
mrbinary

X360 uses an API that is close to DX9, with a few quirks to accommodate the fact that it has a relatively small amount of relatively fast memory.
drxzcl

6

How about the perspective of a Game Development Professor?

If you have the basics of OpenGL down then by ALL means venture into the world of DirectX (note going into DX) that Dx9 is still being used in development for compatibility reasons, as older platforms (specifically XP) don't support the newer graphics pipeline in Dx10 and Dx11. (that should read as a recommendation of starting in Dx9 and then noting the differences in Dx10 and then 11 as you progress) That will also make you more rounded.

Ideally you will want to spend some quality time in HLSL and CG (Note that these two seeming different shader languages are actually the same language (one is branded by Microsoft and the other by Nvidia) understanding how vertex and fragment (pixel) shaders work will be a huge asset to you and any game company that you go to work for (assuming that youre working on rendering systems or subsystems and not AI code. ;-)

Ogre3D is an open source rendering engine that supports both graphics subsystems (OpenGL / DirectX) and is used in many games... because the source is freely available you may enjoy digging through it and seeing by comparison how calls to OpenGL differ from calls to DirectX.

I would also recommend that because you have already spent some time in OpenGL that you poke at WebGL which looks like its going to blow up in the very near future.

Hope that Helps!


I wouldn't say WebGL would blow up in the future, at least not in any near future. Its just another way to render 3d on browsers without any plugin.
Quazi Irfan

With major vendors adding HTML5 and JS support to their products (Visual Studio) and companies like Adobe rolling out Edge (HTML5 JS Flash killer?) I think that were going to see a lot more web based content that takes advantage of the hardware acceleration.
Robert French

4

I read recently that John Carmack recommends DirectX for the simple fact that Microsoft, for awhile, played catch-up to openGL and by doing so they created a competitive product and pushed the envelope while openGL folks spent time arguing and doing design by committee allowing DirectX to become polished and, I guess, easier to work with but sticking with openGL.

http://www.tomshardware.com/news/john-Carmack-DirectX-OpenGL-API-Doom,12372.html

Maybe another option to consider if you like graphics in general and for what it's worith is what's going on in the embedded space.

I work in the embedded space using both Linux and WinCE. I was former Ford SYNC architect (was there for 6 years) and now I work on GM's CUE (GM's answer to Ford SYNC). Ford SYNC doesn't use openGL or DirectX. Ford, instead, opted for Flash & Action script; what Flash does under the hood I'm not sure but it's slow as hell; JD Powers gave it poor rating. GM's CUE is all Linux and openGL ES and although the GM CUE has a newer iMX processor the performance of animations in openGL on Linux are staggering. CUE/openGL is much faster. Again, Ford crippled their system with Adobe Flash.

So, if you're looking to make it in games but are concerned about the competitive nature but still love this type of work, maybe look at options that broaden your resume. It has been my experience that, at least in the embedded world, WinCE doesn't seem to use DirectX all that much. (WinCE has slightly different API than NT might be part of that reason). OpenGL is everywhere in the embedded world and people are doing more things such as tablets, automobile infotainment is hot right now, and of course smart phones...


+1 for mentioning the embedded space. I hadn't thought about going into graphics for embedded systems(except for mobile platforms), but after doing a little research I found it to be choice worth considering. I did have an interest for embedded platforms a few years ago, but other stuff got in the way, so I wound up abandoning it pretty early on.
adivasile

2

I'd say it probably good on your resume to be able to say you have worked with both, regardless of which you've specialized in.

I say so because, as with anything, it's more about general techniques than API/syntax knowledge beyond a certain point. You need to be able to do stuff, and know your way around, but you don't have to have implemented huge pieces of stuff in both API:s. (Thats O(n*m), which doesn't scale...). Knowing the APIs a bit, and knowing different tecniques (i.e. O(n+m)) works, and will be helpful.

Of course, you will score bonuses for doing something "advanced" in DX too, since it shows you have some deeper API knowledge, but you need some advanced techniques in any case, to prove that you know how the boxes should be connected (ignoring the specfic magic words you have to say to get it done).

It's the same with any API (3d or otherwise), or any programming language, really.


1

I found that DirectX is harder to learn and therefore a better skill. Directx usually has better support from board manufacturers, however, microsoft does not release that many updates to take advantage of those advances (and only a select subpopulation of hardcore gamers really use those boards). Regarding game development, all the major game platforms use their own proprietary graphics engines ... xbox -> DirectX Box :) Knowing 3D concepts, meshes, lighting, transformations, etc, is a skill that is the same for all of them.


I have found very little conceptual difference between DX9-ish and "modern" openGl (without using glBegin). I would appreciate your thoughts as to why one of the two is "easier" or "harder" than the other.
drxzcl

1
I actually find that OpenGL is easier to pick up the really fundamental basics in, but as soon as you move on to VBOs and shaders, D3D becomes much easier (the lack of extensions makes it more consistent across a broader hardware base too).
Maximus Minimus

That's my experience too, hence the question.
drxzcl

1

If you know one you can easily pick up the other.

If you know OpenGL you can easily program for smart phones (android and iPhone) plus win/Linux/mac.

DirectX is only Win/Xbox. So unless you want to target Xbox, I'd say stay with OpenGL since it can target more platforms.


-4

I prefer OPENGL. Consider for example, Android the mobile operating system uses OPENGL. There are so many game engines that are developed based on the OPENGL platform.

โดยการใช้ไซต์ของเรา หมายความว่าคุณได้อ่านและทำความเข้าใจนโยบายคุกกี้และนโยบายความเป็นส่วนตัวของเราแล้ว
Licensed under cc by-sa 3.0 with attribution required.