Hard Light Productions Forums
Modding, Mission Design, and Coding => FS2 Open Coding - The Source Code Project (SCP) => Topic started by: TrashMan on November 01, 2007, 08:29:49 am
-
Who keeps locking the threads I post..I might have more questions :lol:
Jsut an easy one - Is there an extensive documentations on FS engine inner working, capabiliteis, anything technical?
-
Just the doxygen output on the original source release.
http://fs2source.warpcore.org/dox/index.html
-
ERm...so hows that work? I have to use this program and it will generate some sort of documentation or sumtin?
-
Yes, it will do diagrams of deps. and documentation of functions and stuff like that. But the source code isn't taged with Doxygen info, so it may look confusing.
-
Well dangit... has anyone run this thing and gotten a decent looking documentation he could send over?
My profesor told me this would be hte best way to do the paper:
- a few pages on 3D graphics in general
- a few pages on 3D egines in general, their inner workings, etc..
- a page or two on some more notable engines, wihth some techical details
- several pages on the engine I'm gonna modify - details
- several pages detailing hte modifications I'm gonna make
- several pages showcasing the changes.
If anyone knows some usefull links, I'd be much obliged if they could point me in the right direction.
-
If anyone knows some usefull links, I'd be much obliged if they could point me in the right direction.
http://google.com (http://google.com) :>
-
That documentation does not exist. Doxygen output I linked is just C++ fucntion descriptions. Function references, etc, and its only for the originally released source code, I don't think we have run it on anything the SCP has done.
You will have to create it if you want it. Which I understand is probably the point of the excercise.
-
Only C++ function descriptions? there was no documenatation made by [V] about the engine?
Crap, crap, crap, crap! :sigh:
What the hell am I supposed to write now? Methinks I'll have to switch engines :shaking:
-
The only documentation we got was how to add sexp's.
Good luck.
-
Well, if I plan to pimp FSO SCP and use it, I'll need it.
I need 10 pages (if not more) about the engine itself - meaning his inner workings. I'm f*****!
-
modified the title of the thread so it was meaningful.
-
ERm..not really homework...it's the paper...THE paper..the final thing before you get your diploma and go off searching for work.
ATM i decided to stick with FSO despite it's lack of documentation. I'll prolly be asking a lot of question here later tough...once I look into the structure and making of 3D engines in general.
-
"Homework" is better than "Erm, yeah"
Generally in the US those are called Senior Thesis (in the case of undergraduates), Master's Thesis (for the MS seekers) and Dissertations, for those whacky doctoraL students.
I daresay its still homework ;)
Be sure to ask spoecific and detailed questions if you want them answered. "How does XXX work?" is unlikely to get you any meaningful response. We're not writing it for you. And make sure you credit programmer responses as a source, typically in academics, labelling somethign as coming from an interview with someone is sufficient, since its unlikely this board can be used as a reference source, per se.
-
Thanks for the tip...I'm still looking for materials on 3D engines and how they generally work (their basic components, etc..), so I'm in no particular hurry.
-
Well... I'm off to a good start on the paper.
now comes the harder part.
So I'll ask a few questions here:
1. The files I downloaded are many indeed! Can someone tell me which of them I should be looking at, since I'm only interested in 3D graphics and not anything else the engine does :P
2. Can someone give me a rough draft/graph of the 3D pipeline?
3. Any useful technical info on the engine?
-
Geez, don't kill yourself from the strain guys.... :rolleyes:
-
Well the graphics files are obviously in code\Graphics.
-
that's one down..two to go..
When I'm taking about 3D pipilne I'm refering to a simple set of steps.. a garps of explanation will sufffice... Example:
Object coordiantes -> transform to world coordiantes ->transform to camera coordianates->do object removal->do backface removal-> shading->normal maps->glowmaps-> ec....
-
Geez, don't kill yourself from the strain guys....
When I'm taking about 3D pipilne I'm refering to a simple set of steps.. a garps of explanation will sufffice...
vertices -> polygons -> ??? -> profit
Here you go.
-
well first of all FSO has an abstraction layer, currently it does nothing but obfuscate things, but untill recently it was the thing that allowed FSO to run in Direct3d or Open GL, the FSO abstraction layer is the interface between the graphics subsystem and the rest of the game engine. it consists of a large collection of function pointers, when the game is started up these pointers are set to either a OGL or a D3D function, the interface of the functiona are identical, and the high level behaviors of the functions are (suposed to be) identical but one is implemented useing D3D and the other is implemented with OGL. the origonal workflow of the pipeline was call some functions to set some states (alpha blending, texture, ect) call some functions to draw some stuff. when we moved into the HTL world we sort of changed that, the old method still is in effect for a lot of built in effects, but for ships when they are loaded we call some functions to load the geometry into the video card (it returns a handle to it) then when the game is playing when we want to draw a ship we set the geometry set the states draw it change states (to specular mapping) draw it again, note we don't set the geometry more than once and in the old method we had to draw the geometry one polygon at a time, the new method let's us draw the whole thing in one blast.
-
Interesting...sounds like you found a nice way around some issues.
That said, I hope I'm not asking for too much, but can one of you code-wizzards who knows the graphics part give me (written in text or a graph) a round presentation of the 3D pipeline?
The professor kinda made a point for me to have a pipeline graph, but trying to peace it together just looking at the code would take forever....and ever...and ever...for me. ;)
-
another question...I've been writing general stuff about how 3D engines work.
I know that geometry has to be transformed several times, from local to world coordinate, camera coodinate, perspective, that the viewing frustrum has to be applied, backfaces and object removed.... I know how rasterization works, so one thing bugs me.
Glowmaps work by interpolating the glowmap pixel value with the normal map pixel value.
What about trasnparency maps? Isn't rasterization done last? The removal of backfaces and obscured/hidden polygons is done before that.
How does the engine determine to keep a few polygon in the pipeline? (polygons that are normally not visible but since we added the transparency map they will now be partially visible)
EDIT: Just wanted to stress again how important the FSO pipelne is for me. :blah:
-
"Glowmaps work by interpolating the glowmap pixel value with the normal map pixel value."
this is nonsence. if you want to know how glowmapping works I'll explain it, but you don't have this right.
as per your question, (alpha based) transparency works by interpolating the source color (the color of the pixel of the triangle that is about to be drawn) with the destination color (color of the pixel as it is on the screen before you started drawing your current triangle) using the (source) alpha value to weight the interpolation.
you might be wondering still about the visibility issue, well that is a big problem and the only solution that has been found to date is to sort the geometry from furthest to closest ensuring all transparent triangles get drawn without getting killed off by another poly's z value. usually all non-transparent geometry is drawn before the transparent geometry, so the non-transparent geometry does not need to get sorted also. sometimes simply drawing the non-transparent geometry before the transparent geometry is enough, for example if you know you will never (or rarely) have two transparent polys over each other, or if you do that they will somehow still get drawn in furthest to closest order. FSO does not use geometry sorting (currently) but this is the source of the requirement that interiors of transparency enclosed regions (ie cockpits) must be separate child objects to the transparent object (typically the hull) because in FSO child objects are drawn before the parent object, and as long as a child object is completely enclosed by the parent, the child geometry will be further away because of this, and further away needs to be drawn first for transparency.
incedently, the most effecent method for drawing non-transparent objects is closest first, this allows the zbuffer to cull pixels before they are drawn, you will still have the cost of transformation, lighting, and all the other vertex related expenses, but you will save the cost of writeing to a pixel more than once, this is called z culling. it's usually not worth the cost to sort geometry, but if you can get away with it without any/much cost, then you should. unfortunately with (alpha) transparency you have no choice but to go to the expense of sorting your geometry into the worst case scenario in terms of z culling.
there is one exception to the sorted geometry requirement, and that is the case ware you use what is known as 'additive alpha', in additive alpha you do not interpolate based on an alpha value, you simply add the source and destination together, thanks to the communitive property of addition the order in which they are drawn is irrelevant, this is why additive alpha is so popular, the only stipulation is you must still draw the non-transparent geometry first. but unfortunately you can not ever darken (like dark smoke would do) with additive alpha which is why alpha blending is used in spite of it's cost.
this leads to another topic which you might have heard of, BSP trees. a BSP tree allows you to sort geometry in linear time (as opposed to nlogn time). in a BSP tree the geometry of the object is recursively split along a plane (hopefully placed and oriented in such a way as to split the geometry into a half such that there is an approximately equal number of polygons on either side of it). once you have set up the BSP tree all you need to do to sort geometry (furthest to closest) is, at each node recursively visit the furthest node first then the closest, processing a polygon whenever you encounter it (for closest to furthest sorting you just visit the nodes in reverse order). BSP trees can also be used to perform collision detection in logarithmic(!) time, to do this you visit the node which is in front of the split plane first, if there is a collision you will find it in logarithmic time, if you set up your BSP tree so the planes all lie along the principal axises and you put bounding boxes around each node's geometry you will be able to discard roughly one half of the geometry at a time, meaning that logorithmic time is not just a best case but the average and worst case as well.
-
You know, I though Z-buffer mught be used to somehow sort transparency :D Had a good hunch. Thanks Bob. ;)
-
well it,s not, it's more like you have to get around it that use it.
-
speaking of which, I downloaded the Direct X software Development Kit and there are good sample 3D engine there that are well documented.
Methinks I might be switching to one of them. there's one with some drones flying around that you can shoot with bouncy balls - it's nice and leaves a lot of space to add stuff. :D
thanks for the help guys. If I have any general 3D programing question, I know where to ask :yes:
-
Gotta ask..In the next few days I got to definately pick the engine I'm gonna enhance..
I need something simple (given that I'm not a good programmer anymore), something that doesn't have too many graphical features already.
At first I was thinking of the robot sample engine from the Direct X SDK, but I can't even find the rendering code in that thing (and I never worked with D3D or Direct X .. damn those friggin commands)
the Cube Assault engine looks promising, so I'm thinking of focusing on that one.
Anyone knows some other source code engines he might recommend?
-
K, guys I need your help..
I got tons of great tutorials for both DirectX8 and directX9, I got the Direcxt X SDK and downloaded DX8 libraries additionally.
I'm using Visual Studio 2005 and the code itself is not the problem - I got compile errors since VS can't find the d3d9.h or d3d8.h !!
For the tutorial:
2. Make sure that your project settings are correct.
a. Project > Settings...
b. On the Link tab, make sure that "d3d8.lib" is in the list of Object/Library Modules. If it isn’t simply type it in.
Where the Hell does one set this things up in VS 2005?
There is no project->setting, and in the project properties I can't find anything..not in any other tab or menu I looked. I'm frustrated as hell - I got the friggin code right, but I can't compile it cause of thuis s***!
-
I can't say for 2005 but in VC6 there is an input->Additional Input Paths option. Add the path to your SDK there.
-
Can't find that either
*slams head against desk*
I'm going to go bald in a few days at this rate.....
-
AAAAAAAAAAAAAAAAAAARGHH!!!!
Do Direct X code will compile!!!!
How the f*** do you include those libraries in this piece of s***!!!! Who the hell designed VS2005???
C'mon guys..one of had to work with 2005..help me out here..I'm dying.
-
You need to set up the options in Tools->Options...->Projects and Solutions->VC++ Directories (see attached)
For DirectX, these are my settings:
Executables: C:\Program Files (x86)\Microsoft DirectX SDK (August 2007)\Utilities\Bin\x86
Include Files: C:\Program Files (x86)\Microsoft DirectX SDK (August 2007)\Include
Library Files: C:\Program Files (x86)\Microsoft DirectX SDK (August 2007)\Lib\x86
Make sure you've got the Platform SDK, otherwise you'll run into trouble as well (the platform SDK can register itself with VS2005, but don't run the tool more than once!)
These are global settings and will apply to all your projects
Best of luck
[attachment deleted by ninja]
-
I got Microsoft DirectX SDK (August 2007).. I also downloaded some Dx8 libraries and I put hem inside the SDK instalation folder (in /Lib/x86)
I've also set up the paths as you said. So far it still doesn't work. I'll keep trying.
-
Are you able to post any of the compile errors from the output window?
It'd give us an idea of exactly whats going wrong
-
Ahh...DX9 tutorials are working. It's compliling them now..
but DX8 still don't work.
It's saying it can't find d3dx8.h ... (half the resource files have a #include <d3dx8.h> line on top.. I Downloaded the dx8 library from the microsoft site...and put the lib files in the LIb folder of the SDK and the .dll in windows/system32 .. can't understand why it won't work... )
-
Can you point us in the direction of what you're trying to compile - it would really help.
I've just checked in my "C:\Program Files (x86)\Microsoft DirectX SDK (August 2007)\Include" (this is a 64bit windows install, it'll be c:\Program Files\Microsoft DirectX SDK (August 2007)\Include if you're not using Windows 64) and d3d8.h is there. If you've installed the DirectX SDK, it should be there. If you try and include d3d8.h and d3d9.h in the same project, you might run into trouble with a few macro redefinitions!
-
One of Andy Pike tutorials...they were made for DirectX 8 .. they are a bit older, but the explanations in them are excellent.
I'll keep trying, but if push comes to shove, I can always transform the code to DX9.. I think only a few functions changed.
-
K..here are the Andy Pike tutorials I have been trying out.
Andy Pike Dx8 tutorial (http://ferrium.org/trashman/Stuff/andypike.rar)
If any one of you guys cane help me get VS2005 to compile them I would be very grateful. they are better than any Dx9 tuts I came across so far .
-
Just tried compiling DX Project 1 from the RAR you posted - didn't compile the first time, but adding '#include <windows.h>' before the d3d8.h include and adding user32.lib to the linker libraries (Project->Properties...->Linker->Input and add user32.lib at the end of the Additional Dependencies line), it compiled and ran the second time I tried. Please post the output from the debug window - it might not be d3d8.h that's causing the problem. BTW, a good DirectX tutorial can be found at www.directxtutorial.com
Please make sure you've got the Windows Platform SDK
If you've installed the DirectX SDK, it's probably the way you've set up visual studio. Can you post a few screenshots/notes on the VC++ directories you've set up, where you installed the DirectX SDK to, copy/paste the output of the build window, etc... so that we know what's going wrong
-
I installed VC2005 to E:\Visual Studio 8 and the SDK to another HDD, D:\D_X SDK
I adjusted the paths like you said in your post before and DX9 works now.
Executables: D:\D_X\Utilities\Bin\x86
Include Files: D:\D_X)\Include
Library Files: D:\D_X\Lib\x86
I also added the #include <windows.h>, but the user32.lib isn't in the list under additional dependencies. :sigh: Where is it located?
the error I get is: FATAL ERROR: Cannot open include file <d3dx8.h>. No such file or directory exists.
-
You need to add user32.lib to the list of dependencies! (make sure the active configuration is set to all configurations in the box in the top left hand corner)
I don't have a d3dx8.h either (me needs not be so tired when I read these posts!)
If you have a look on MSDN (msdn.microsoft.com), you'll notice that the D3DX functions don't seem to have a version attached to them (i.e. not obviously D3DX**8 or D3DX**9), so try changing d3dx8.h to d3dx9.h. If that doesn't work, I'm out of ideas! (I'm not really a graphics person - I'm trying to learn as well!)
Hope this helps!
-
Blast...I really wanted DX8 to work :(
Oh well...life likes to throw curveballs at you..nothing unexpected. Happens to me ALL the time.
-
Good luck, TrashMan. We're all counting on you!
Well, sort of.
*wishes you luck anyway*
-
If you had actually read the "Release Notes" for the latest SDK you would have found the following:
The DirectX SDK No Longer Contains...
The DirectX SDK no longer contains the following components:
* Direct3D8 and all of the earlier versions
* Direct3D RM
* DirectAnimation
* DirectMusic
* DirectInput7 and all of the earlier versions
* DirectPlay
* DirectPlayVoice
* DirectX8-era HRESULT conversion routines
* Managed DirectX samples and documentation
Developers wanting to use these components will need to download the August 2007 DirectX SDK, available from MSDN.
Reference:
http://msdn2.microsoft.com/en-us/directx/aa937789.aspx
Glad to have been of help.
-
No problem... I swithced to DirectX9 anyway...
Got a nice little "engine".... 2D background and 2D forground (with transparency, so it looks like a menu..or I can make a fake depth illusion), 2 .X fighters flying around the screen).
I got one flying in circles and making a looping or roll if you press X or Y..
the other one should be just going back and forth, but I'm having trouble with it, since I have to check it's position to turn him around once he left the screen (basicly, it should be moving back and forth on the X axis), and I cna't find which function cna return the current models position in the world. :P