Jump to content

  • Log In with Google      Sign In   
  • Create Account

Direct3D11 used for 2D games?


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
5 replies to this topic

#1 RoundPotato   Members   -  Reputation: 126

Like
0Likes
Like

Posted 12 May 2013 - 06:34 AM

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.


Edited by RoundPotato, 12 May 2013 - 06:34 AM.


Sponsor:

#2 mhagain   Crossbones+   -  Reputation: 7979

Like
3Likes
Like

Posted 12 May 2013 - 07:23 AM

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......


It appears that the gentleman thought C++ was extremely difficult and he was overjoyed that the machine was absorbing it; he understood that good C++ is difficult but the best C++ is well-nigh unintelligible.


#3 RoundPotato   Members   -  Reputation: 126

Like
0Likes
Like

Posted 12 May 2013 - 07:45 AM

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.



#4 SeraphLance   Members   -  Reputation: 1411

Like
2Likes
Like

Posted 12 May 2013 - 01:59 PM

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).


Edited by SeraphLance, 12 May 2013 - 02:01 PM.


#5 RoundPotato   Members   -  Reputation: 126

Like
0Likes
Like

Posted 12 May 2013 - 02:44 PM

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.



#6 LordRhys   Members   -  Reputation: 355

Like
0Likes
Like

Posted 29 May 2013 - 09:48 AM

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




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS