Welcome, Guest. Please login or register.

Login with username, password and session length

 
Advanced search

1411512 Posts in 69376 Topics- by 58431 Members - Latest Member: Bohdan_Zoshchenko

April 27, 2024, 08:25:34 AM

Need hosting? Check out Digital Ocean
(more details in this thread)
TIGSource ForumsDeveloperTechnical (Moderator: ThemsAllTook)DirectX in my face
Pages: [1]
Print
Author Topic: DirectX in my face  (Read 1981 times)
Guillaume
Level 7
**



View Profile
« on: May 07, 2009, 02:25:32 PM »

Hello guys,

Just posting to have some input concerning the learning of DirectX, which I've decided to get into recently.

So just to give you context info, I'm a student in computer science, and I consider myself pretty good in general algorithmic, data structures, etc. I understand the main languages and programming paradigms pretty well, and I have an intermediate knowledge of the SDL.

However, DirectX is kind of punching me below the belt. I'm following the SDK basic tutorials, which basically had me writing ~200 lines of C++ just to set up a win32 window and a DirectX context. I've encapsulated all of that in neat objects so as not to bother in the future, but it actually does bother me not to understand what it does.

So do you think I should learn more about 3D rendering theory before I delve in DirectX? Or is the Windows DX SDK doc just bad? How did you guys start learning DirectX/3D programming?

I've been considering the purchase of this book, thinking that it'd provide me the theoretical knowledge I need about 3D rendering before proceeding with implementation.

All in all, even though I'm making my way around it, I'm a bit lost, and any advice/experience feedback would be appreciated. Thanks guys!
Logged
AaronAardvark
Level 1
*


Formerly RazputinOleander


View Profile WWW
« Reply #1 on: May 07, 2009, 03:05:47 PM »

I think OpenGL is generally more user-friendly if you're just starting out with 3D programming.

In terms of all that boilerplate setup code - that's pretty normal.  I wouldn't worry too much about fully understanding all of it.  At some point it'll be important, but once you have it working, focus on the 3D stuff that you want to focus on.

I wouldn't recommend that book just now.  Those books are typically for more advanced rendering techniques.  It might be useful for you, but you can find similar tutorials online for free.  You'll probably also want to get familiar with more basic 3D rendering techniques before moving onto that stuff.

Here are some sites I've used for DirectX stuff:

There's another one, but I can't recall it's name. Unfortunate too, it wasn't too easy to find, but had some really excellent advanced rendering samples.

Of course, http://nehe.gamedev.net is the defacto standard for learning OpenGL.
Logged
Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #2 on: May 07, 2009, 03:06:09 PM »

DirectX generally isn't for the faint of heart for sure. I started back in probably DirectX 6 or 7ish with C++ and learned an awful lot but found precisely the same kinds of issues your talking about, writing a ton of code for very little effect ~ poor productivity. I wrote a GUI driven system then a goofy experimental game that allowed me to play with AI and rendering techniques overall.

Then I moved onto .NET which I've since stuck with because the C# language is such an outstanding language (as well as the .NET framework itself). In .NET you can write the same stuff your doing in C++ in a fraction of the time and lines of code ~ increased productivity. If you like C++ that's cool, just realize your gonna be spending more time writing code and less time actually getting things done, unless you go and use some library that leverages DirectX or OpenGL for you. While 3D programming is fun, I generally recommend against getting too deep in the intricacies of it, unless your really interested in rendering algorithms and/or have some need to be working at that low level.

More recently you have the option of XNA which is also free, you may want to check it out as there appears to be a lot of support out there for it with lots of tutorials, books and sample code, plus a lot of things you can play with out of the box and in pre-packaged game foundations if your interested.

Just realize when it comes to 3D, you need to worry about models and textures, so if your not an artist (like me) your going to have to rely on others to help you out with that stuff and unless your using some library that suppot various model files and texture support, your writing that all from scratch. Just be aware of what your getting into.

You may need to sharpen up on your math skills (particularily matrices and vectors) if you want to really know and understand what your doing.

My honest recommendation, coming from experience is only delve into DirectX or OpenGL directly if your truly interested in coding at that lower level, if your seriously interested in making a game or actually doing something useful and productive with some with those technologies, I suggest looking into real game engines instead that leverages DirectX and/or OpenGL. I say this from experience, having cooked up my own little game engine for this project: http://www.machinations.org/mom/index.php which while fun, consumed a lot more time than it should have and I still have yet to release anything around it haha.

If your just learning, by all means don't let my advice stop you, it can be fun and challenging and aggravating but I've found it to be worth it both in increasing my programming skills, design methodologies and personal accomplishments.

Last year I took a step back you could say and focused on .NET + SDL.NET, which I've found to be pretty enjoyable. One of these days I'll take my own advice and actually look into using an actual game engine (I just have a serious knack and interest in actually developing lower level systems like that, it's a bit of a bane cause I could probably accomplish more if I didn't try to reinvent the wheel hehe).

I hope that helps, or gives ya some pointers and ideas.

(If it's any consolation, I was 'lost' for probably the first year or year and a half of learning DirectX in my spare time, there's a lot to absorb).
Logged

Mikademus
Level 10
*****


The Magical Owl


View Profile
« Reply #3 on: May 07, 2009, 03:09:02 PM »

It's the demo framework that's incredibly bad. The samples are basically (but not always exclusively) C rather than C++ and maniacally segmented rather than properly structured, and then all the segments are reversed-sorted to top the insanity of. Oh sorry, no, they still use some shorthand Hungarian notation. THAT tops it off!

Basically the first thing everyone does is create a basic framework that encapsulates the tedious initialisation and shut-down procedures, so you're on the right track to learn it. When you leave the sample frameworks you'll actually learn that D3D is a rather nice system to work with. Go figure.
Logged

\\\"There\\\'s a tendency among the press to attribute the creation of a game to a single person,\\\" says Warren Spector, creator of Thief and Deus Ex. --IGN<br />My compilation of game engines for indies
Guillaume
Level 7
**



View Profile
« Reply #4 on: May 07, 2009, 03:21:04 PM »

Of course, http://nehe.gamedev.net is the defacto standard for learning OpenGL.

Is NeHe up to date with OGL 3.1?

Quote
unless your really interested in rendering algorithms and/or have some need to be working at that low level.
I'm really interested by both making games quickly (as any indie game dev I guess), but also by all the mathematical and algorithmic side (as a passionate geek student).

Quote
unless your using some library that suppot various model files and texture support, your writing that all from scratch. Just be aware of what your getting into.
Doesn't DirectX support models etc. de facto?

Quote
You may need to sharpen up on your math skills (particularily matrices and vectors) if you want to really know and understand what your doing.
My studies confer me a decent level on that matter :p

Quote
It's the demo framework that's incredibly bad.
So if I learn DX from somewhere else than MS's doc, I'll be saved? :D
Logged
AaronAardvark
Level 1
*


Formerly RazputinOleander


View Profile WWW
« Reply #5 on: May 07, 2009, 03:29:20 PM »

I also want to throw out a warning about possible careers in rendering.

Rendering is awesome in university because you get to do shaders and make things look cool.
Rendering as a professional involves debugging long buffers of rendering data and figuring out why the data your rendering pipeline creates is causing errors for your render engine.

Very rarely will you actually write a rendering engine from scratch.

If you're really into the whole shaders and fancy-effects type of stuff, then by all means continue doing this, but look into the position known as 'technical artist.'

At least this has been my experience. :D

Of course, http://nehe.gamedev.net is the defacto standard for learning OpenGL.

Is NeHe up to date with OGL 3.1?
NeHe is dead, but all the tutorials on there will get you up to speed on the basic stuff.
3.1 is still built upon 1.0, so most of the stuff is the same - it's all the shaders and vertex program stuff that's new where NeHe is lacking.

You can also check the OpenGL Red Book for a good, thorough introduction to 3D programming:

http://www.opengl.org/documentation/red_book/

Version 1.0 is online for free, but obviously doesn't touch on more advanced techniques that can be achieved with later iterations.
Logged
Guillaume
Level 7
**



View Profile
« Reply #6 on: May 07, 2009, 03:43:10 PM »

I also want to throw out a warning about possible careers in rendering.

Rendering is awesome in university because you get to do shaders and make things look cool.
Rendering as a professional involves debugging long buffers of rendering data and figuring out why the data your rendering pipeline creates is causing errors for your render engine.

Very rarely will you actually write a rendering engine from scratch.

If you're really into the whole shaders and fancy-effects type of stuff, then by all means continue doing this, but look into the position known as 'technical artist.'

Thanks for the advice Smiley However my field of expertise (and future research) is artificial intelligence, so I'm sheltered from that pipeline debugging :D

As for the OpenGL references, I'll give a look- thanks Smiley
Logged
Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #7 on: May 07, 2009, 03:46:56 PM »

I'm really interested by both making games quickly (as any indie game dev I guess), but also by all the mathematical and algorithmic side (as a passionate geek student).

By all means then, carry on Wink You probably won't make any games very quickly going the raw DirectX or OpenGL route, although, depending what you do, it's not impossible either, maybe your game can be done with simple rendering.

I like your enthusiasm, so by all means, follow it through, and keep us posted on what you come up with and learn along the way.

Quote
DirectX support models etc. de facto?

It does support the DirectX (*.x) mesh file, but the support for that is pretty lackluster from what I found, I am talking from a couple years ago, I was trying to use Blender, that was utter hell (though I don't care for Blender to begin with), but I know there may be more support for it from some other tools. I think XNA actually has more support above that though, which is why I pointed in that direction, it's a whole managed pipeline, taking care of a lot of the low level stuff, good if your really rarin' to get a game up and running.

Quote
My studies confer me a decent level on that matter :p

Outstanding! You already probably have a stronger math background than myself and if I managed to do it, you certainly will. (I like math but I'm not all that good at it, I've learned that when I need to know it, I learn it, so it works out).

Go ahead and keep digging into DirectX, it sounds like you'll enjoy it, just pace yourself. Perhaps balance it with some engine where you can make a game, I'm sure you can combine the two and get a good run for you efforts.
Logged

Strom
Level 0
***



View Profile
« Reply #8 on: May 07, 2009, 03:47:50 PM »

Quote
unless your using some library that suppot various model files and texture support, your writing that all from scratch. Just be aware of what your getting into
Doesn't DirectX support models etc. de facto?

DirectX supports .X , it's a useful format has textures,bones etc.
the software with the best .X exporter would be truespace 7 (http://www.caligari.com/)
Logged

See my Assemblee 2009 2D and 3D work Here. My A Game By Its Cover compo entry Journal of Shikoku.
Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #9 on: May 07, 2009, 04:02:17 PM »

I should re-iterate, I found the .X format support to be lackluster cause I wasn't willing to shell out hundreds or thousands of dollars on a commercial/professional 3D modeling package, I DO believe most of the big ones do probably support .X in one way or another.

Is Truespace free or at least cheap for the average hobby developer?
Logged

David Pittman
Level 2
**


MAEK GAEM


View Profile WWW
« Reply #10 on: May 07, 2009, 05:45:25 PM »

Is Truespace free or at least cheap for the average hobby developer?

Yes, they released the latest and greatest version for free after the company was bought out by Microsoft. I used trueSpace many years ago (versions 3 and 4) and liked it. I prefer Blender now, but I should revisit tS since it is free and all.
Logged

Skirvir
Level 0
**

As below so above.


View Profile WWW
« Reply #11 on: May 07, 2009, 06:32:04 PM »

Wow wicked, I too should take a look at it then Smiley Thanks!
Logged

Pages: [1]
Print
Jump to:  

Theme orange-lt created by panic