🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

DirectX 12 resource (

Started by
6 comments, last by Dirk Gregorius 2 years, 4 months ago

I want to up my render skills a bit and look into DirectX 12 (coming from OpenGL). What are the best resources for DX 12?

Thanks!

Advertisement

Hopefully one of the resident DX12 experts (which I am defiantly NOT) will come along and give you some better information . My take is that DX12 documentation is somewhat scant in that it's hard to find information that gives you the big picture.

There is Frank Luna's book of course (which I have) but it's just kind of so so compared to his previous books.

There is this site: https://www.braynzarsoft.net/

There is this from Microsoft: https://github.com/microsoft/DirectX-Graphics-Samples

This site has a lot of stuff too: https://www.3dgep.com/

Finally there is the Discord server and people are actually quite helpful there.

You can of course get yourself going with this, however my main issue is DX12 is far more wide open and low level than previous versions. There are MANY ways to handle things and figuring out the best one is not always so easy.

Just as an example, you have things like descriptor heaps that reference resources. You can have one. You can have one for each set of frame resources. Or you can have some other combination. I have even seen people write sort of memory managers for them, which is something that I ended up doing. But there are different ways to do that too. Apparently on some hardware you want to switch between descriptor heaps as little a possible

Then you have root signatures and basically all the options that go along with those. Programming DX12 is an endless list of design decisions you have to make. If you use it like DX11 it's not so bad, but the minute you try to decouple the GPU from the CPU by using a rotating set of frame resources as most sources recommend, the complexity kind of explodes. The main issue is you have to make sure that resources are kept around while they are still needed. You may think you are done with something on the CPU but the GPU may still be using it.

My particular app (which was previously in DX11) was multithreaded to begin with, so sending and deleting meshes from the GPU was done asynchronously and separately from the render thread. However with DX12 the rendering can be two or three frames ahead so all this stuff has to be synced up.

I guess you can master all this, but there is a lot more to think about than in OpenGL. As I'm sure you know you also have the option of Vulkan. There seems to be more critical mass round that so it might be something to consider. The main reason I went with DX12 is I like the shader debugging in DirectX. Good luck.

Gnollrunner said:
Finally there is the Discord server and people are actually quite helpful there.

LOL

🙂🙂🙂🙂🙂<←The tone posse, ready for action.

Thanks Gnollrunner! I pretty much agree. I am looking into DX12 since I am interested in DXR. Otherwise I would prefer very much using DX11. I looked at the Samples folder and there is something called DX11 on DX12. But no one knows if you can use DXR this way.

I also looked at Vulkan which now also has at RT Ray-Raytracing interface, but I don't I am not sure that I want to invest time into learning Vulkan. PC and XBox are both DX12. PS is GNM (which has a shading language similar to HLSL iirc). Apple is Metal. It seems Vulkan is pretty much dead and their API looks insane, but I am happy to learn otherwise,..

If I needed to learn the low-level details, I would do the following:

  1. First: Read through the Microsoft SDK examples, stepping through them in the debugger, reading the documentation page for each interface and method call it makes.
  2. Second: Read through the Unreal Engine DX12 back-end renderer (or some other existing engine renderer with DX12 back-end that I can read the source for) and do the same thing – figure out where the objects are coming from, where they're going, what they contain, and what they all mean.
  3. Third: Come up with some small challenge, such as “procedurally generate a fly-through of some fractal function,” and implement it on top of DX12 based on what I think I know.

I've done device drivers and media processing and distributed systems in the past. I'm already good with asynchronous programming, with synchronization and barriers, and with 3D graphics, so there may be other kinds of skills/patterns that you don't have, that aren't covered by this path, but would be needed. Hopefully the other resources would get you there.

Because of how complex the model needs to be to support the needs of current high-end renderers, this is a massive beast to actually learn in detail – it will require dedication and time. (The same can be said for Vulkan, btw.)

enum Bool { True, False, FileNotFound };

Dirk Gregorius said:
PC and XBox are both DX12. PS is GNM (which has a shading language similar to HLSL iirc). Apple is Metal. It seems Vulkan is pretty much dead and their API looks insane, but I am happy to learn otherwise,..

Well, we can say PC is Vulkan too, and Stadia or mobile is Vulkan exclusively. Apple has a Vulkan implementation on top of Metal.
I hope SteamDeck becomes very successful, so Valve might give SteamBox 2.0 another try? At this point Vulkan would have better cross platform in practice without doubt.

I have not used DX12, but my impression is it's a bit simpler than Vulkan. Vulkan still uses GLSL though, so not sure which path is easier coming from OpenGL.
Frustration guaranteed in either case i guess :D

Thanks guys! Regarding my steps I did 1). I haven't done 2), and I prefer not to look at Unreal, but I am looking at Filament instead which is more like what I am interested in. For 3) I want to write a basic PBR renderer based on a stripped down Filament (but PC only) and eventually play around with RTRT. Often for these kinds of projects all you need is finding the right example. When I learned physics we had the ODE and later Box2D. I studied animation last year and it was quite painful to learn in the beginning because you need to find and pickup pieces from all over the internet. This all changed when Bobby Anguelov published his animation streams and Kroeger. Then it was a couple of weeks and everything made sense. Unfortunately there is nothing sane out there for rendering or at least I haven't found it yet.

This topic is closed to new replies.

Advertisement