Goombert
|
|
Posted on: July 28, 2013, 05:33:28 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
After trying this several times with DirectX 10 and failing, I decided to give DX one more chance to be a part of our game engine, and it finally worked with DX9. The headers and libraries are distributed with MingW for DX9 so no need to install the Windows or DirectX SDK, if you are on Windows you will simply be able to switch it under API settings and use it. Now of course not all functions have been implemented, the implementation status is listed below. This will increase the compatibility of ENIGMA on native Windows platforms and for those people Micro$hit likes to screw over with bad OpenGL support.
So we are now looking particularly for Windows users to help implement the graphics functions for DirectX. There's a lot of functions to be done, varying in difficulty so people from all skill-levels should be able to help. I am going to be writing a ton of the code as well, your help is going to be appreciated.
Currently Implemented: Sprites: Full support Backgrounds: Full support Models: Full support Primitives: Full support Tiles: No Support Fog: Experimental Support Transformations: Almost full support Projections: Full support Views: Experimental Support Curves: No support Standard Draw: Almost full support Lighting: Experimental Support Shaders: Limited or Buggy support Text and Font: Full support Particle Effects: No support Surfaces: Almost full support Texture: Limited or Buggy support Blend Modes and Color: Full support Vertex Formats: No support
|
|
« Last Edit: November 29, 2013, 06:46:36 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
forthevin
|
|
Reply #2 Posted on: July 29, 2013, 05:03:00 pm |
|
|
Joined: Jun 2012
Posts: 167
|
Very nice, having DirectX set up and working will make further development on it much easier. While it in principle ought to be enough to be able to use OpenGL, that may not be the best solution on Windows for a given game, and supporting DirectX will give them the choice of which graphics system to use. While it may be an extra burden, it can be expanded upon bit by bit, and with a future test suite over the graphics, all the tests that we write for the OpenGL graphics systems can be reused for DirectX, and vice versa, given that the interface for using the graphics system is the same between implementations.
|
|
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #3 Posted on: July 30, 2013, 05:44:42 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
The intention is to keep the interfaces all but identical, forthevin. I believe it's in our best interest to encourage DirectX on Windows and OpenGL on Mac/Linux. The differences in behavior should be minimized, if not eliminated, to prevent any incidents with porting. This will be necessary, anyway, for when we start "officially" supporting embedded systems. Personally, though, I think DX9 Is a step in the wrong direction. Nothing written for it will be compatible with DX10 or 11. DirectX11 would be my personal choice in target. It works on newer Windows service packs, and on the XBox One, which if anyone actually purchases, promises to support homebrew natively. Moreover, DirectX11 has this. It's an XNA-like layer over DirectX11. As far as I know, it's .NET free. So you could use its SpriteBatch class for a quick, efficient solution. Note: All ENIGMA games which use DirectXTK will have to be closed-source due to intentional licensing conflicts by Microsoft.
|
|
« Last Edit: July 30, 2013, 05:49:53 am by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Josh @ Dreamland
|
|
Reply #5 Posted on: July 30, 2013, 07:06:48 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
Supposedly, thanks to the WINE team, it comes with DX10, too. There was just some difficulty using it, which isn't surprising.
Either way, if he's comfortable writing these functions for all of them, that's fine; the ones which are most used will naturally be the most maintained. I fear DX10 will basically never be used, but, que sera, sera.
|
|
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
|
Goombert
|
|
Reply #7 Posted on: July 31, 2013, 02:08:41 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Guys, hey I got the #1 reason we are going to use DX now, look at the updated screen shot, that is 50,000 draw_sprite calls at 30fps, OpenGL can't handle 15,000 on my pc at more than 12fps. That is utilizing DX's internal sprite batching class, please proceed with the DirectX vs. OpenGL debates. Please merge pull request.... https://github.com/enigma-dev/enigma-dev/pull/283Also to prove my point, this is the d3d blend modes and their OpenGL and Direct3D equivalents. bm_zero = 1, // GL_ZERO D3DBLEND_ZERO bm_one = 2, // GL_ONE D3DBLEND_ONE bm_src_color = 3, // GL_SRC_COLOR D3DBLEND_SRCCOLOR //only for dest bm_inv_src_color = 4, // GL_ONE_MINUS_SRC_COLOR D3DBLEND_INVSRCCOLOR //only for dest bm_src_alpha = 5, // GL_SRC_ALPHA D3DBLEND_SRCALPHA bm_inv_src_alpha = 6, // GL_ONE_MINUS_SRC_ALPHA D3DBLEND_INVSRCALPHA bm_dest_alpha = 7, // GL_DST_ALPHA D3DBLEND_DESTALPHA bm_inv_dest_alpha = 8, // GL_ONE_MINUS_DST_ALPHA D3DBLEND_INVDESTALPHA bm_dest_color = 9, // GL_DST_COLOR D3DBLEND_DESTCOLOR //only for src bm_inv_dest_color = 10, // GL_ONE_MINUS_DST_COLOR D3DBLEND_INVDESTCOLOR //only for src bm_src_alpha_sat = 11 // GL_SRC_ALPHA_SATURATE D3DBLEND_SRCALPHASAT //only for src
So like I said the graphics portion of Game Maker was designed around D3D, obviously because of the function naming as well, so this definitely will cut down on visual anomalies in games. I've also noticed the transform functions have the same behavior as one would expect in Game Maker.
|
|
« Last Edit: July 31, 2013, 03:17:17 am by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #8 Posted on: July 31, 2013, 04:14:01 am |
|
|
Joined: Apr 2008
Posts: 1860
|
Guys, hey I got the #1 reason we are going to use DX now, look at the updated screen shot, that is 50,000 draw_sprite calls at 30fps, OpenGL can't handle 15,000 on my pc at more than 12fps. That is utilizing DX's internal sprite batching class, please proceed with the DirectX vs. OpenGL debates. That is because we don't use any batching at all. But I do have a proposition for it here: http://enigma-dev.org/forums/index.php?topic=1380.0 (which no one seems to read). In managed to get 30FPS with 100k sprites. But it will probably be slower (or the same, maybe even faster, wtfk) in the final implementation. So I doubt that in proper implementation one is any faster than the other. Also to prove my point, this is the d3d blend modes and their OpenGL and Direct3D equivalents. No one ever doubted that GM was based on D3D.... because everyone know it's based on D3D.... even D3D functions have a prefix.. wait for it... D3D. We already have GLES for other embedded systems Sadly we don't. I would really want an android port, but the framework it requires (together with a shit ton of configuration for SDK/NDK) makes it all hard to do. Maybe I'll just try making GLES run on Windows (if that is even possible) and then try to make it work on another device.
|
|
« Last Edit: July 31, 2013, 04:16:07 am by TheExDeus »
|
Logged
|
|
|
|
Josh @ Dreamland
|
|
Reply #9 Posted on: July 31, 2013, 06:32:07 am |
|
|
Prince of all Goldfish
Location: Pittsburgh, PA, USA Joined: Feb 2008
Posts: 2950
|
If you're getting 50,000 sprite draws at 30 fps, my guess is that you have the batching on at full power. What I mean is, try drawing an arm sprite, then drawing a torso sprite over that, then drawing another arm sprite over that. You'll probably be disappointed.
|
|
« Last Edit: July 31, 2013, 07:31:54 am by Josh @ Dreamland »
|
Logged
|
"That is the single most cryptic piece of code I have ever seen." -Master PobbleWobble "I disapprove of what you say, but I will defend to the death your right to say it." -Evelyn Beatrice Hall, Friends of Voltaire
|
|
|
Goombert
|
|
Reply #10 Posted on: July 31, 2013, 07:22:40 am |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
Me and Josh did a few test cases and the sprite batch does properly organize depths, and in fact transformations can be applied to the sprites/backgrounds/text to turn them into 3D billboards like many people do in Game Maker.
|
|
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
TheExDeus
|
|
Reply #11 Posted on: July 31, 2013, 10:37:24 am |
|
|
Joined: Apr 2008
Posts: 1860
|
When I try to launch dx9 I get: Graphics_Systems/Direct3D9/Direct3D9Headers.h:25:19: fatal error: d3dx9.h: No such file or directory I searched the mingw folder I found d3d9.h, but not d3dx9.h. Which MinGW do you use? edit: turn them into 3D billboards like many people do in Game Maker And why can't you do this now in OGL? Do you mean just using d3d_transform functions to rotate sprites?
|
|
« Last Edit: July 31, 2013, 03:26:35 pm by TheExDeus »
|
Logged
|
|
|
|
Goombert
|
|
Reply #12 Posted on: July 31, 2013, 05:34:14 pm |
|
|
Location: Cappuccino, CA Joined: Jan 2013
Posts: 2993
|
I am using the zip installer which comes with MinGW64 Harri, if that is the case, first try to install the DX runtime, then try to install the DX SDK and see which of those fixes it, but do it in that order, as I'd rather have people download the runtime than the SDK. d3d9.h contains most of the rendering headers d3dx9.h contains math functions, vector classes, and matrix transformation stuffs There is also a lib for both of those which is linked, -ld3d9 and -ld3dx9 And why can't you do this now in OGL? Do you mean just using d3d_transform functions to rotate sprites? No I was just ensuring everyone that the behavior has not been lost with this new sprite batching class.
|
|
« Last Edit: July 31, 2013, 05:37:44 pm by Robert B Colton »
|
Logged
|
I think it was Leonardo da Vinci who once said something along the lines of "If you build the robots, they will make games." or something to that effect.
|
|
|
|
The 11th plague of Egypt
|
|
Reply #14 Posted on: August 05, 2013, 08:14:57 am |
|
|
Joined: Dec 2009
Posts: 274
|
Note: All ENIGMA games which use DirectXTK will have to be closed-source due to intentional licensing conflicts by Microsoft.
Ahem, but can we release our games as closed source without breaking the GLP? Seems like this topic shows up a lot recently... Any news?
|
|
|
Logged
|
|
|
|
|