Sign in to follow this  

Advice: Build-Your-Own Or DirectX

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I realize this is discussed at length in many places, but I'm sort of at a crossroads. I've been reading 3D Tricks (LaMothe) and while I'm enjoying all of this, I'm not sure that I'm following the best path towards making a 3D game. My plan was to build my own fairly simple engine and learn the basics of 3D graphics. But upon looking into Direct3D a bit more, it's not like it does everything for you, is it? You still have to call matrix multiplications and the like, you just don't have to code them. In your opinion (with the full understanding that this varies greatly), is it best to jump right into DirectX and learn to build games that way? Can you not still build an engine but build it with Direct3D? Or is it best to build an engine, even if only a basic one, and know the theory that much better? I guess the real question boils down to: Why wouldn't I build an engine with DirectX? Is it really that high level, or is it simply an abstraction over the hardware? Sincere thanks for your opinions on the matter. I would really like to hear about how some of the pros or more advanced amateurs are doing this. Surely there engines are based on DirectX?

Share this post


Link to post
Share on other sites
My personal opinion is, learn the basics of D3D first. Then with that knowledge, build an engine around that. Why reinvent the wheel for nothing? If you really wanted to, you could I guess, but that was what graphic libraries were created for. I'm sure you could still develop a 3D engine around DirectX or graphical library for that matter.

Share this post


Link to post
Share on other sites
I'm no expert, but this is my opinion.

Basically I think 3D tricks is a great SUPPLIMENTAL book. You should try and read it, and understand the concepts, just so you know what is actually going on at a low level. If I were going to actually start a real project, I'd rather use DirectX. Why? Because my personal production time would be much more effecient using DirectX rather than building my own 3D rasterizer. It's like the reason we learn how to do long division. If I'm an accountant, I'd rather use a calculator to do my division because it's faster. I can be just as accurate going by pen and paper with a certain amount of care, but just as in any business, time is money.

Certainly knowing how to build your own rasterizer will make you a much more knowledgable and skilled programmer. But when taking the time on an actual project where effeciency is money, why waste time reinventing the wheel?

Share this post


Link to post
Share on other sites
I agree with Etherstar. Read Tricks 3D so you know what DirectX does, but code your actual games in DirectX. You'll waste tons and tons of time working out problems that you'll never actually have in real life if you try to write your own rasterizer. But understanding the concepts is important. I'd actually recommend reading corresponding chapters of Tricks while learning to code with DirectX. If you're adding lighting to your game, read up on how it's done in Tricks, then code it with DirectX. Making blind API calls is no good, but writing an entire 3D engine from scratch might be a little overkill.

Share this post


Link to post
Share on other sites
By writing your own rasterizer you won't be able to take advantage of the video card. Everything will be done on the processor and it will be slow on anything but low detail scenes.

Go with Direct3D and learn the math behind it in your spare time.

Share this post


Link to post
Share on other sites
I agree with everyone that going the D3D route is the quickest and easiest. However, I got into 3D programming by making my own software renderer in Java.

It took a long time to code but it really helped me get up to speed. It's not like I was sitting there programming it day in day out thinking, "what a real pain in the ass this is". I was thinking what great fun it was to learn all this stuff. I learned how to use matricies to speed up rotations and translation (yeah, I used cos and sin on every single vertex to do rotations in the begining, whoops!)

So my advice- If you're looking for the quickest, fastest- go D3D. If you're in this to learn how to write your own software renderer, then do just that.

Share this post


Link to post
Share on other sites
Oh yeah- Raloth is right. You won't be able to use hardware acceleration if you write your own software renderer. But are you really looking to write a 100fps renderer here? I wouldn't set of to build the next Quake engine using a software renderer or anything, but I don't think that's what you're shooting for.

Share this post


Link to post
Share on other sites
Quote:
Original post by aaroncox1234I'd actually recommend reading corresponding chapters of Tricks while learning to code with DirectX. If you're adding lighting to your game, read up on how it's done in Tricks, then code it with DirectX. Making blind API calls is no good, but writing an entire 3D engine from scratch might be a little overkill.


That sounds like a nice balance. I guess it doesn't have to be one or the other. This way I get to develop a game using the best technology to do it, but I also gain a true understanding of what's going on.

Thanks all for your help. I'm going to pick up a good book on 3D games with DirectX.

Really, at the end of the day, I want to be a good game programmer, not an engine developer.

Share this post


Link to post
Share on other sites
I learnt a great deal of math during highschool and in this first year of faculty and i can't even say i know 10% of all of it.
It's great to make your own shapes but why making a sphere when you have an auxiliary library or something,maybe because you want to deform it...
<quote>Knowledge is your path to freedom,why not learn them both</quote>

Share this post


Link to post
Share on other sites
Writing your own rasterizer is a horrible idea, since it completely wastes the power of the video card, as someone mentioned. The rasterizer itself only ends up taking the vertices of a triangle and putting it on the screen. There's not much to be gained from doing that yourself. But aside from that, Direct3D isn't your sole option. Take the games from id software, all of which use OpenGL. But that's not something worth fighting over.

Share this post


Link to post
Share on other sites
Quote:
Original post by cowsarenotevil
But aside from that, Direct3D isn't your sole option. Take the games from id software, all of which use OpenGL. But that's not something worth fighting over.


Agreed. I didn't mean to infer that DirectX was the only option. I was more meaning DirectX versus doing everything myself without DirectX.

I may very well explore OpenGL at some point, but I'll stick with DirectX for now as I have some DirectX resources already available to me. Also, I would like to develop for the Xbox some day.

Share this post


Link to post
Share on other sites
D3D is not a graphics engine. It's a lightweight layer between your code and the graphics hardware. Without it (or OpenGL), you're not going to have hardware acceleration.

An engine is never "based" on directX. It uses it for rendering (or sound, or input). 99% of your code will have nothing to do with it.

Share this post


Link to post
Share on other sites
Quote:
Original post by Low Bias
I may very well explore OpenGL at some point, but I'll stick with DirectX for now as I have some DirectX resources already available to me. Also, I would like to develop for the Xbox some day.


Sounds like a reasonable choice, then.

Share this post


Link to post
Share on other sites
Quote:
Original post by 0xCHAOS
writing a software rasterizer is the only way to make a 3D console application :D

www.ezequal.com/CHAOS/Demo.zip


Nonsense. You can use OpenGL to render to an ofscreen buffer, get the color of each pixel, use your favorite method to choose the best character, and draw it. ;)

Share this post


Link to post
Share on other sites
Doesn't it feel great to understand how an internal combustion engine works?

Don't you feel like an idiot trying to rebuild your car's engine, though?

Understand your tools. And use them.

Share this post


Link to post
Share on other sites
Quote:
Original post by Etnu
D3D is not a graphics engine...[the engine] uses it for rendering (or sound, or input). 99% of your code will have nothing to do with it.


Point taken. You still write the engine and the game, you just don't write the rendering routines...and it just doesn't seem to make sense to do so. Especially considering that writing your own will leave you with rendering routines that aren't as fast (or as portable) as DirectX!

I was put off of DirectX at the beginning because I didn't understand it. It's really that simple. Now that I've started to use it, I'm actually quite excited at what it offers me in terms of performance and how quickly it will get me to a simple game (versus writing everything myself).

I've ordered Introduction to 3D Game Programming with DirectX 9.0 (Frank Luna) and I'm running through the tutorials in the SDK. I'm off to a promising start. Thank you all for your opinions on the matter.

Share this post


Link to post
Share on other sites

This topic is 4862 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this