Direct3D11 used for 2D games?

Started by
4 comments, last by LordRhys 10 years, 10 months ago

Hey,

I hear people saying Direct2D is to be thrown in the trashcan and Direct3D is used to make 2D games.

Is it because you can make the third dimension constant ? If so that's a 33% overhead, would it be possible to throw it out ? And all of this using Direct3D ?

Cheers.

Advertisement

It's not an additional overhead. The calculation is exactly the same in both cases - a mul (position, matrix) (or mul (matrix, position) depending on your major-ness preferences) calculation. Position can be stored as two components (x and y) in your vertex buffer, and when it's moved into a shader register the extra "0, 1" will be automatically added to it.

Drawing 2D stuff on-screen using the same pipeline as for 3D stuff is something that's been done successfully and without any additional problems or overheads since at least Quake in 1996. Why do you think it would be a problem today?

Some kind of reference for this alleged junking of Direct2D would be nice as well......

Direct3D has need of instancing, but we do not. We have plenty of glVertexAttrib calls.

It's not an additional overhead. The calculation is exactly the same in both cases - a mul (position, matrix) (or mul (matrix, position) depending on your major-ness preferences) calculation. Position can be stored as two components (x and y) in your vertex buffer, and when it's moved into a shader register the extra "0, 1" will be automatically added to it.

Good to know, thanks (although in extreme cases I believe that automatic addition is the overhead).

Drawing 2D stuff on-screen using the same pipeline as for 3D stuff is something that's been done successfully and without any additional problems or overheads since at least Quake in 1996. Why do you think it would be a problem today?

Simple, because I don't know a thing about it.

Some kind of reference for this alleged junking of Direct2D would be nice as well......

Well, it's just floating around including some suggestions at these forums, so I imagine the overall picture.

Direct2D is literally built on top of Direct3D. There's no way around it other than either running it over the CPU (always a bad idea) or invoking some special code paths in the driver (that don't exist). Also, I don't think Direct2D is going away any time soon:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370987(v=vs.85).aspx

Direct2D is a user-mode library that is built using the Direct3D 10.1 API. This means that Direct2D applications benefit from hardware-accelerated rendering on modern mainstream GPUs. Hardware acceleration is also achieved on earlier Direct3D 9 hardware by using Direct3D 10-level-9 rendering. This combination provides excellent performance on graphics hardware on existing Windows PCs.

Note Starting with Windows 8, Direct2D is built using the Direct3D 11.1 API.

The reason to use Direct2D over Direct3D is a matter of convenience. If anything, D3D would be faster because you have more control over the API calls (though this is unlikely to be actually meaningful).

Direct2D is literally built on top of Direct3D. There's no way around it other than either running it over the CPU (always a bad idea) or invoking some special code paths in the driver (that don't exist). Also, I don't think Direct2D is going away any time soon:

http://msdn.microsoft.com/en-us/library/windows/desktop/dd370987(v=vs.85).aspx

Direct2D is a user-mode library that is built using the Direct3D 10.1 API. This means that Direct2D applications benefit from hardware-accelerated rendering on modern mainstream GPUs. Hardware acceleration is also achieved on earlier Direct3D 9 hardware by using Direct3D 10-level-9 rendering. This combination provides excellent performance on graphics hardware on existing Windows PCs.

Note Starting with Windows 8, Direct2D is built using the Direct3D 11.1 API.

The reason to use Direct2D over Direct3D is a matter of convenience. If anything, D3D would be faster because you have more control over the API calls (though this is unlikely to be actually meaningful).

Well I changed my overall picture, I now see it as a "convenience layer" over Direct3D. Also you reassured usage of Direct3D for 2D.

Thank you, you narrowed direction in which I am planning on building beautiful bridges.

As a matter of fact MS just updated Direct2D to version 1.1 and it is a major component of use in HTML 5 and other web graphics especially for some of the things being done for Win8

This topic is closed to new replies.

Advertisement