I'm curiously busy browsing some books on 3D graphics engines and have discovered why it's a really difficult topic for most to understand.
While I understand the C & C++ language and concepts.. these authors have a tendency to get horribly lost in a real messy spider web of C code and other junk, continuosly taking a jab at Asm as if they have a 'complex maximus' or something.
For the poor layman.. this is a complete load of garbage. A 1000+ pages and I sat there asking myself... "what is this guy trying to say ??" ... it was a complete mess, except for the first 3 chapters (~100 pages).
Now for the next book.. hopefully this was at the bottom of the sh1tlist.
:P
VANJAST,
You're right. I got interested in 3D graphics a couple of years ago,...and discovered that most of the books on the subject were more confusing than informative. I wrote stuff specifically for DirectX, and, it's a pain in the ass (especially, if you use the .NET managed Direct3D version).
I did, however, find some very useful texts and source code, which I have explored and tested extensively.
I don't know if you are programming with DirectX or OpenGl,...but, DirectX has evolved considerably in the last couple of versions, making programming DirectX difficult.
In DirectX, alot of the more interesting stuff is in Shader development, which, ironically, is alot like assembly programming.
Here's an example of an older ShaderX publication: Shader Programming Tips and Tricks with DirectX 9 (http://tog.acm.org/resources/shaderx/Tips_and_Tricks_with_DirectX_9.pdf)
The editor for this series is Wolfgang Engel, and he has a really interesting 3D graphics blog: Diary of a Graphics Programmer (http://diaryofagraphicsprogrammer.blogspot.com:80/)
Another exceptional 3D graphics blog is: Tom Forsyth's Tech Blog (http://home.comcast.net/~tom_forsyth/blog.wiki.html)
DirectX is a Microsoft proprietary technology, so here is the: MSDN High Level Shading Language Reference (http://msdn.microsoft.com:80/en-us/library/bb509561(VS.85).aspx)
...Of course, you don't have to use any of the DirectX or Direct3D libraries. You can implement all your 3D mathematics from scratch. I have a copy of this book: "Tricks of the 3D game Programming Gurus: Advanced 3D Graphics and Rasterization", by Andre LaMothe, published, 2003. This book is humongeous,...and, excellent. LaMothe explains EVERYTHING. All the mathematics (mostly trigonometry (http://en.wikipedia.org/wiki/Trigonometry)), and, all the C language techniques you need to create a 3D graphics engine (with a huge amount of source code) are included with the book.
A couple of sites that are also really useful, are the ATI and NVIDIA developer sites. They archive source code for various graphics effects (2D and 3D) for both DirectX and OpenGl. Also, the book, Real-Time Rendering, has a website which is huge, and has links to a large collection of graphics references.
NVIDIA Games and Graphics Development (http://developer.nvidia.com/category/zone/game-graphics-development)
AMD Developer Central (http://developer.amd.com/pages/default.aspx)
Real-Time Rendering Resources (http://www.realtimerendering.com/index.html)
Thanks Baltoro... I haven't seen/heard of most of those links. :U
I looked into DirextX7 (actually studied it like a madman !!) a few years ago, but never got further as real life 'took my toys away'. :(
I always wanted to do 3D programming as I'm really interested in the maths side of things, so I browse through this stuff (part-time).
I've got this idea of a really simple (and addictive) network game. Although the concept is simple, the implementation is not :bg
so the little bug on my shoulder is starting to bite really hard. :lol
GPUs (Graphics Processing Units (http://en.wikipedia.org/wiki/Graphics_processing_unit)) have evolved so rapidly in the last decade, that it is typicallly a requirement in Direct3D (all versions after version 7) to call: GetDeviceCaps (DirectX9) (http://msdn.microsoft.com/en-us/library/bb174320(v=VS.85).aspx) to determine what your graphics accelerator is capable of. The call to GetDeviceCaps returns a: D3DCAPS9 (http://msdn.microsoft.com/en-us/library/bb172513(v=VS.85).aspx) structure,...which is a HUGE data structure, but, provides an enormous amount of information abour the graphics accelerator that will be executing your DirectX program. The DirectX SDK comes with a graphic utility that displays all the available Device capabilities, without having to code it.
The DirectX and Direct3D and their associated libraries are quite complicated, initially, and takes some time to become familiar with the typical sequence of function calls in a render loop. But, the 3D mathematics is all encapsulated in the various available functions, and it is efficient, and, the graphics look fabulous when displayed. It's usually best to start out with an entry-level book that's strictly about the DirectX fixed-function pipeline.
A very useful resource is the documentation at MSDN: Tutorials and Samples for Direct3D 10 (http://msdn.microsoft.com/en-us/library/ee416411(v=VS.85).aspx)
...Also, a fairly comprehensive introduction to DirectX Version 9 is: The Direct3D Graphics Pipeline, by Richard Thomson (http://www.xmission.com/~legalize/book/download/index.html). The various chapters (in pdf format) are listed,...this is over five years old, but describes the existing features of DirectX Version 9 adequately.
...If you want to read some really, mind-blowing stuff,... here are several great websites for technical papers on advanced graphics techniques are:
- Graphics Gems Repository (http://tog.acm.org/resources/GraphicsGems/)
- Tim Rowley, Graphics Papers, SIGGRAPH 2000-2006, and ACM Archives (http://trowley.org/)
- Jonathan Shewchuk, Technical Papers, Computer Science, UC Berkeley (http://www.cs.cmu.edu:80/~jrs/jrspapers.html)
C sucks too:
http://www.youtube.com/watch?v=zm3tQ_BPgm8
:bdg
It's been asked before but where are some procedural assembly examples? So much directx/ DirectDraw assembly code examples works don't work with the latest DirectX libraries.
ASTRO,
That YouTube lecture was very informative,...thanks.
What I noticed about Direct3D is that it uses the 32-bit REAL4 type everywhere. I think that's because you wouldn't notice a significant difference, visually, in the 3D display if you were implementing the math with a floating point number with greater precision. There are lots of simple things you could to compensate.
And,...ALLOY,...
I don't know where you would look for that kind of thing. I think the real advantage with using DirectX in C++, is that the hardware access is implemented to be as fast as possible. What is DirectX? (http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/what_is_directx.mspx?mfr=true)
Ooops.... Sorry, I didn't proofread that. I meant to say "So much directx/ DirectDraw assembly code examples don't work with the latest DirectX libraries." (corrected) For a time there were some examples but they are fewer now. DirectX steadily gets better and is far more thread-friendly but x86 coding if has not.
You will always get the problem where libraries are written to suit one language at the expense of other languages and this is effectively the case with DirectX written for C++.
DirectX has changed pretty significantly with each version since Version 8.
You find that you have to query the users system to see which DirectX version is installed before you can initialize your program.
Microsoft's DirectX and Direct3D are COM interfaces and their implementations,...so, C++ is probably the best choice.
Here is: DirectX Frequently Asked Questions, MSDN (http://msdn.microsoft.com/library/ee416788(VS.85).aspx)
Also, here is the Wikipedia Direct X (http://en.wikipedia.org/wiki/DirectX) page, which contains a listing of all the versions, and numerous references.