What is important is that the data from the modelling program is made available to the game in a format which it can read in and convert into an internal representation of the geometry. These can be XML based formats such as Collada, text based formats such as OBJ, or even proprietary binary formats. Models from a 3D modeling program (such as Maya or 3DsMax) are not 'coded', they are exported into a format that the game can understand. Any differences that result are likely a result of the APIs not being identical so the programmers work around it. If I do the same lighting calculations in OpenGL that I do in DirectX, I will see the same results, and so on. If I set the backbuffer to red in OpenGL, it will look the same as if I set the backbuffer to red in DirectX. How the game looks depends largely on how that API is used. Your first question is really not answerable - both graphics libraries give me access to the underlying graphics hardware through an API. To animate a 3D model, the model contains additional control information (armatures, bones, etc.) which allow to deform it based on a rather small number of parameters (arm rotation, looking direction, etc.) Then those parameters are varied. The whole process is not very different from loading an image from a file and displaying it or some music playing it to the speakers. This is not some kind of black voodoo magic. They export their models into a file format optimized for efficient loading by a 3D engine, and then the engine loads the models and auxiliary data from files.
OVerall, I'm curious on how video game designer/programmers export actual 3DS MAX/Maya models into their code
I explained the basic idea, how a model is loaded in How to Import models from 3D software, like Maya into OpenGL?
While it most certainly is possible to store geometry in code, this is a rather bad idea and should not be done. No! The model and its auxiliary data are stored separately from the code. Second, What is the main process when creating a game, specifically in terms of using a model created in Maya, or 3DS Max in the video game? Does one create the model, then export the model to readable OpenGL/DirectX code, with all of the shader programs exported, and all vertices and triangles created in code, and finally utilize the code in a C++/c program? In all other aspects the ways they work are so similar, that there's virtually no difference between rendering results, except the rounding errors introduced on the vertex positions by the different clip space mappings. Later versions of OpenGL and DirectX added geometry and tesselation stages, but those are just details. Finally the fragment it tested for visibility and blended into the picture-in-drawing-progress. for each pixel the primitive covers some calculation (again either fixed function or by a freely programmable fragment shader) is performed that determines the so called "fragment" color. OpenGL and Direct3D follow similar principles: A stream of vertices goes in, gets transformed (either fixed function or by a vertex shader), after transformation the vertices are grouped into primitives (points, lines, triangles) and the primitives rasterized, i.e. So it's export to file -> process to final file -> read in game.įirst, would WoW look different if rendered in OpenGL, rather than Direct X? Would performance be significantly different if rendered in OpenGL? Well, generally, you process those files into more digestible formats for you game, as exporters tend to optimize meshes differently from what you might want in your game. You export them into files, which you then read in your game. Second, you don't export them into "code". x files are deprecated at this point those were part of the D3DX library, which was just a Microsoft-written layer on top of D3D. Neither OpenGL nor Direct3D has a model format. There are some things that OpenGL implementations can be faster at, but WoW doesn't use any of them.ĭoes one create the model, then export the model to readable OpenGL/DirectX code Would performance be significantly different if rendered in OpenGL? (note: DirectX is more than just Direct3D.) And no, it doesn't look different in D3D rendering. It is rendered in OpenGL (well, it can be with a setting). First, would WoW look different if rendered in OpenGL, rather than Direct X?