pouët.net

Advice on learning DirectX/3D graphics programming

category: code [glöplog]
Ah, that's exactly the kind of advice I was looking for! Much appreciated. :)

So assuming I won't ever be able to produce high-end demos using every state-of-the-art API feature, what version of DirectX would you recommend to start with? I'm seeking some balance between complexity being not too overwhelming, version still recent enough so that it won't cause too much pain to make the transition to a more current versions later, and device support being at a good level in, say, a year or so.

Judging from the last posts, maybe I shouldn't start with DX 11?
added on the 2014-03-20 10:49:48 by Kylearan Kylearan
"Device support" meaning desktop PCs, by the way, not mobile phones/tablets.
added on the 2014-03-20 10:50:43 by Kylearan Kylearan
Quote:
Judging from the last posts, maybe I shouldn't start with DX 11?


Problem is, DX10 is nearly the same as DX11. They are both quite low-level, and have quite a steep learning curve.
So that means you'd get all the way back to DX9 if you want something different.
Another thing to consider is that DX11 is the only API that also works on tablets and smartphones.

I think it depends... If you don't know ANYTHING about 3D graphics at all, using legacy OpenGL or DX9 makes things simpler, because there's the fixed function pipeline, which gives you all sorts of hardwired lighting and transformation options. This way you can 'ease into' working with shaders, replacing the fixed function stuff with shaders gradually.
Modern OpenGL or DX10+ requires you to do everything with shaders from the start, so you need to know how to write your own matrix stack, how to write shaders that transform and project your geometry, before you even get anything on screen at all.

Having said that, the DX SDK comes with some very simple tutorials to get you started. So if you know some basic linear algebra, it should not be too difficult to go down that road either.

At any rate, the transition from DX9 to DX10+ is huge. Pretty much requires you to rewrite and re-think your entire design.
Going from legacy OpenGL to modern shader-based OpenGL is also quite a big step... but unlike DX9 and DX10+, you still use the same API, so you get a slightly more gradual transition. It's just a lot nastier, because the same functions have different behaviour depending on which extensions you use.
added on the 2014-03-20 11:21:48 by Scali Scali
3D programming isn't so much about knowing APIs as it is about grasping concepts and algorithms. Pick something reasonably recent, and you'll be fine. Your time is better spent banging out code than pondering over what API to use.
added on the 2014-03-20 11:32:51 by kusma kusma
Learning DirectX has at least one implicit advantage over OpenGL: the correlation between its syntax with the generic GPU pipeline. It's definitely a good thing to learn what happens in an Input Assembler, Tessellator, Rasterizer and Output Merger. DX's syntax efficiently encodes the relevant part of the GPU pipeline as 2 capital letters (IA, RS, OM, ...).

I don't want to argue about which of the two APIs is best suited for what, I just wanted to emphasize that particular advantage when learning anew.
added on the 2014-03-20 11:38:07 by xTr1m xTr1m
as i always point out when this kind of debate comes up - the choice of api from an ease of use perspective is almost irrelevant after a couple of weeks of boilerplate work, because youll have wrapped it all anyway.
what does matter is - the portabilty/compatibility/performance (delete as appropriate based on what you care about).. and most of all the shading language and quality of the shader compiler. because doing graphics / demos you'll be writing shaders constantly from day 1 onwards.

in that last aspect - the shading language and compiler - dx11 wins against everything hands down imo. (having worked with various)
added on the 2014-03-20 11:44:37 by smash smash
I'd advise using DirectX11 despite the steep learning curve. It's true that 9 is way easier for beginners but you inadvertantly _will_ arrive at the point where it doesn't cut it anymore and then you'll have to basically throw everything away and start anew. DirectX11 pretty much requires you to have nailed down all the concepts about 3D graphics and how a GPU gererally works before you can even get a single polygon on screen but the great thing about it is that it won't really get any harder than that, and every new feature you add is just adding features and not rewriting stuff you did before. Which is a plus in my book.

Just use DX11, and carefully study the examples to get a hold of what's all that stuff with resources, surfaces, buffers, shaders, state objects, etc. At some point it will just all fall together and make sense, and from then on it's mostly smooth sailing. :)
added on the 2014-03-20 11:47:14 by kb_ kb_
I heard NeHe has a great DX6 section though.
added on the 2014-03-20 12:06:21 by gloom gloom
Do most PCs support DX11 stuff? If that's the case, go with that. On the other hand, if that's win 8 only or most cards won't support it or something, what's the most recent widely supported DX? From what scali said, I'd avoid dx9 now if possible.

Only thing i'll add re. opengl/dx is that dx will lock you into windows. That's OK now, but keep in mind where things are going with mobile, the PC market etc., and consider what platforms you might want to use in a few years time when you're getting good. If you think you'll still want to do PC stuff and you're happy with windows, go with DX.
added on the 2014-03-20 12:22:40 by psonice psonice
DX11 == Windows 7 or Vista with updates, so really safe to use now that noone cares about XP anymore...
Quote:
Do most PCs support DX11 stuff?


Yes, an up-to-date Vista machine will support DX11, as will any newer version of Windows.
As for hardware: D3D11 has 'downlevel' modes, allowing you to use the D3D11 API on DX10 or DX9-level hardware (obviously within the limits of their capabilities).
I have successfully run D3D11 code on an Intel Q35 IGP and a Radeon 1800XTX, to give you some idea.
added on the 2014-03-20 12:38:30 by Scali Scali
Thanks, all - that was very helpful. I'll go with DX11. After I've finished my prod for Revision, that is...
added on the 2014-03-20 16:45:08 by Kylearan Kylearan
Quote:
Quote:
People have a right to use what they want. Don't they?

Sure, and people also have a right to offer actual good advice.


Someone who never coded a demo telling people how to do stuff.
That's rich.
added on the 2014-03-20 18:30:22 by mudlord mudlord
I heard sarcasms by people who never coded a single demo are useless and depressing.
added on the 2014-03-20 18:33:41 by rez rez
rez: Ah, so I am automatically entitled to using sarcasm and giving sane advice to people in this thread just because I've coded a horrible software-rendered FreeBASIC demo once, and gloom isn't. Yay! \o/
@Saga: No, probably not :D

In fact, I'm probably too naive, but I will never understand why people has to make negative comments and/or makes "fun" about others people when they try but they fail :(
added on the 2014-03-20 19:27:47 by rez rez
pls no
added on the 2014-03-20 19:48:02 by Gargaj Gargaj
Maybe you don't care about complex matrix stacks for a start. Why don't you give a try to Shadertoy or Rendermonkey to check if you feel comfortable with shaders?
Why do you want to be a top elite for a start? Forget the latest papers, "demo or die" is stronger than "elite or die".
added on the 2014-03-20 20:36:39 by Soundy Soundy
Quote:
(And yeah, DX12 announcement is due any time now, your DX11 plan is going to be obsolete fast :D)


http://blogs.msdn.com/b/directx/archive/2014/03/20/directx-12.aspx
Quote:
We are targeting Holiday 2015 games.


You'll be safe for a while :)
added on the 2014-03-20 21:03:04 by Scali Scali
Quote:
We are targeting Holiday 2015 demos.


Better get started now ;)
added on the 2014-03-20 23:41:11 by psonice psonice

login