Any good DirectX 12 "2D Platform" Tutorials?

Started by
14 comments, last by Dhannanjai 6 years, 7 months ago

Hey everyone,

I was just curious if anyone has any links/pdfs, info, etc. Heck, even a good book, since I can't seem to find one on DirectX 12.....and the Microsoft Online Documentation (though good and thorough) seems to be geared towards developers who are converting projects (and large ones at that...) from DX 11 to DX 12.

I am currently working my way through some of the DirectX 12 samples, and I've figured out a few things....haha, but I'm still just wanting to make a simple 2D game in DirectX 12 for Windows 10. Any help would be appreciated, and of course, if I come up with something, I will post it here as well.

My background in programming is both un-impressive and extensive. The last time I looked at Direct X, was around Direct X version 7, 8 and 9. I moved to Dark GDK for a while, then Direct X 10 and 11 sprang up. I moved to Windows 10, and all my Dark GDK projects (Dark GDK) won't compile on Visual Studio 2015. I've decided to try my hand at the latest and greatest DirectX 12 and would like to start simple and small with 2D stuff. I can also program in many languages, though I prefer C/C++ or C# (learning that one...of course, when does learning stop? haha).

All of my projects have been hobbies, and I just program for fun, however, I am getting older, and if I can actually put something interesting into production, I'll invest a little after the initial demo, and get some help to actually publish a title. Well, cheers.

Thanks,

Jeff

Advertisement
DirectX 12 is not the place to start if you're just wanting to make a 2D game. D3D12 is primarily intended for hardcore graphics engineers. Microsoft is recommending that other developers stick to D3D11.

You're probably better off using DirectXTK which is D3D 11 based.

To answer your question, though: no, there's no good tutorial or book. D3D12 is very new and the community at large is still trying to figure it out. The closest thing you'll find right now are the official samples.

Sean Middleditch – Game Systems Engineer – Join my team!

Alrighty, I was just checking. Perhaps I can write a tutorial on my adventures in learning and creating a 2D tutorial (it's easily possible in 3D). I am actually having a good time, with more successes than frustration (overall).

Thanks,

Jeff

Don't forget D3D little borther: https://msdn.microsoft.com/en-us/library/windows/desktop/dd370990(v=vs.85).aspx

Remember that if you want to use low level APIs (even if they come with one or more layer of abstraction) you will need to handle manually tons of things as you will with Direct3D.

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/
The general approach to creating a 2D game using a 3D API is the same as ever -- textured, screen-aligned quads, batching, etc... But the directions in which D3D 12 reached aren't really things that 2D games needed -- utmost performance by getting closer to the metal. If this is a learning venture have fun, if this is a business venture you'll have a lot more to gain by taking advantage of the larger user base of more-established APIs.

throw table_exception("(? ???)? ? ???");

The general approach to creating a 2D game using a 3D API is the same as ever -- textured, screen-aligned quads, batching, etc... But the directions in which D3D 12 reached aren't really things that 2D games needed -- utmost performance by getting closer to the metal. If this is a learning venture have fun, if this is a business venture you'll have a lot more to gain by taking advantage of the larger user base of more-established APIs.

The only exception I can imagine are mobile games where low-overhead APIs could potentially improve battery life a lot even on 2D games ( : ...But AFIK there are not any D3D12 drivers on Windows 10 mobile yet...

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

The only exception I can imagine are mobile games where low-overhead APIs could potentially improve battery life a lot even on 2D games


That's a valid point to consider, though I don't know how much simpler games stand to gain.

One thing to consider more generally is that Direct3D 12 and Vulkan won't raise your frame rate if you are (or would be) GPU-bound. 90% of the benefit is on the CPU-side, and the biggest gains there only come if you're willing and able to multithread your engine. In fact, most naive ports from 11 to 12 are performing 10-25 *worse* to start and it takes some moderate refactoring to get back to a rough par in terms of frame rate (with the advantage usually being a higher and more stable minimum frame rate and lower CPU load), but it takes significant rework to get those big gains that were promised, and they're mostly only there to be had if you were CPU bound in the first place.

throw table_exception("(? ???)? ? ???");

Completely agree, but do not forgot that low-overhead APIs can potentially been a big dial on mobile, and on UMA systems in general, where the TDP is shared/balanced between CPU and iGPU. Even reducing the CPU overhead can potentially both reduce power consumption and increase GPU performance raising the GPU clock speed. Also, Vulkan looks like having a pretty support for hardware tiled rendering (D3D12 too, but it does not have anything like renderpass).

"Recursion is the first step towards madness." - "Skegg?ld, Skálm?ld, Skildir ro Klofnir!"
Direct3D 12 quick reference: https://github.com/alessiot89/D3D12QuickRef/

Well shiver me timbers. Microsoft to add support for making Xbox One games with XNA-based MonoGame.

Beginner in Game Development?  Read here. And read here.

 

Gonna rock the boat a bit here, but I don't think wanting to make a 2D game is a legitimate reason to not use DX12. If you want to write graphics engines, picking up DX12 from scratch isn't going to be easy, but with enough time you'll learn about a lot of important things that you basically never will otherwise if you constantly shy away because there's an easier way to do things.

UE4 isn't going anywhere any time soon, so the same argument can be made for learning DX11 or pretty much any graphics API. Why bother? In a weird way it creates a vicious cycle as more new programmers are steered away from DX12, UE4 (and Unity and other big name engines) becomes even more entrenched, etc.

Of course, if you have no interest in writing your own graphics engine, then don't write your own graphics engine.

This topic is closed to new replies.

Advertisement