• Advertisement


  • Content count

  • Joined

  • Last visited

Community Reputation

255 Neutral

About Dinsdale

  • Rank
  1. I vote for Qt Creator. It's open source and cross platform (win, linux, mac). The syntax highlighting is very decent. For example highlighting of a symbol under cursor highlights it correctly inside its scope, not just the same word in the whole editor. Code completion just works (unlike Visual Studio's Intellisense). I like also small refactoring features, like changing declaration of a method in a header file will automatically sync the change to the implementation in the .cpp file. The code editor has also features like follow symbol (Ctrl+click), find usages, switch between definition and declaration, etc. These things in Qt Creator just work, while in other IDEs I've tried, only work sometimes. Although the IDE is not as customizable as Visual Studio or Eclipse (forget dockable panels), it's organized quite ergonomically and it's very fast (unlike eg. Eclipse). You can download the SDK installer here: http://qt-project.org/downloads It's worth to mention, that the Qt Creator IDE was designed to work with the Qt libraries, which itself is a great cross platform application toolkit for writing any kind of app imaginable. It literally runs everywhere, eg. besides desktop platforms also ARM and embedded platforms, Android, soon iOS. You can of course use Qt Creator and not use the Qt libraries if you don't need them. However if you are into C++ and cross-platform development, I strongly recommend looking into Qt itself.
  2. Confused about char types.

    Unicode text files usually (but not necessarily) start with a byte sequence, called the Byte order mark or BOM. This is a sequence of 2, 3, or 4 bytes which tells you which unicode encoding is the file saved in on the disk. If you use .Net/CLI you can use the StreamReader class to read your text files. It automatically detects the byte order mark and chooses the correct unicode encoding to translate bytes to characters.
  3. Moving On...

    Hello, I'd suggest you look into doxygen. It's defacto standard for documenting C/C++ code. Easy one-time setup. Documentation generation is as easy as running a single command. When finished you just copy the output html folder to your webserver. The comment format is also quite simple and non-intrusive (compared to e.g. the .Net documenting format which uses xml tags). Martin
  4. Specular problem solved

    Clearly this is problem of the mesh, not the shader, as Ashaman73 pointed out. The surface normal continuity is broken where the specular seam appears. When dealing with smooth surfaces, one way to avoid such artifacts is to share vertices (and thus share normals and texcoords) between adjacent triangles. I.e. store each vertex of the mesh just once and use indexes to form triangles.
  5. Game Programing Books.

    If you already know a programming language and want an introduction to game programming, then I would recommend Core Techniques and Algorithms in Game Programming by Daniel Sanchez-Crespo Dalmau - http://www.amazon.com/Core-Techniques-Algorithms-Game-Programming/dp/0131020099 It won't teach you how to program Crysis-looking game, but it will give you a decent introduction into what's going on inside a game.
  6. 2D UI Transformations

    Hello, I found out, that for me (in my D3D9 based engine) it best works to use one dynamic vertex buffer for all ingame GUIs and fill it every frame with GUI quads. That way I have total control over the quads. I can update the quads every frame and animate their position, color/alpha and texture coordinates very easily. Vertex updates are really fast if you use a dynamic vertex buffer along with D3DLOCK_DISCARD or D3DLOCK_NOOVERWRITE. In my case there was almost no performance difference between the two approaches: - update GUI quads every frame using dynamic VB. versus - cache GUI quads in a static VB once, draw them many times So I would naturally opt for the first way - fill the VB every frame. To your second question: scaling operation works relative to the origin of the coordinate system (in fact every transformation works relative to the origin). Say, your quad has screen coordinates (left,top,right,bottom) = (2,4,8,6), then scaling them by uniform scale coeficient 3.0 will result in new coordinates (6,12,24,18). So yes, the quad would seem to be translated too. What you want to do, is to translate the quad by the negative value of its absolute center position before scaling, then scale and then translate by the same value back. Of course you can combine these 3 operations into a single transformation matrix and perform the operation in one step. Hope that helped a little.
  7. D3DMATRIX confusion

    Yes, in math textbooks and in schools they use/teach the row-major notation, vector-matrix multiplication is usually in the M*v order and they use right-handed coordinate system. So does OpenGL. In D3D these things are exactly the opposite. It's neither useful nor logical. It's that way just because MS wants to make it harder for developers to port software from MS platforms to other platforms. I think, what they do not realize, is that this barrier works in the opposite direction as well :)
  8. D3DMATRIX confusion

    Hello. Both matrices are perfectly valid and working translation matrices. The thing is, how do you treat your vertex positions. If you treat them as row vectors, then the first matrix is right for you, and you will transform the vector in this order: mul(v, M). If you treat your vectors as column vectors, you will use the second matrix to transform the vector in this order: mul(M, v); D3D stores its matrices in a colum-first order. That way one column maps to one shader register directly. The mul(v, M) can then be made as four dot-product operations: dot(v, M_column1); dot(v, M_column2); dot(v, M_column3); dot(v, M_column4). Dot product is a single GPU instruction. Otherwise the matrix would have to be tranposed before sending to the shader. Or, if you don't do so, it would have to be transposed each time the the shader is executed. Bottom line: its really only a matter of convention if you use column or row major matrices. D3D uses the column-major convention by default. You can switch to row-major by using the 'row_major' keyword in a shader variable declaration or by swaping the multiplication order to mul(M, v).
  9. There's one other presentation, that came to my mind, regarding projection matrices: www.terathon.com/gdc07_lengyel.ppt There's a neat little trick that modifies the projection matrix to shift the near clipping plane to arbitrary position. That way you can have one clipping plane for free, so you don't have to do the clipping manually in vertex/gemoetry shader. That is enough to do e.g. water/mirror reflections.
  10. Hi there, Here is an excelent article on viewing frustum plane extraction from view-projection matrix (with source code for both D3D and OpenGL): http://www2.ravensoft.com/users/ggribb/plane%20extraction.pdf What do you mean by arbitrary matrices? I can't think of any useful projection matrices besides the normal perspective or orthographic. The post-projection space is essentially a cube so I guess it would have six bounding planes every time.
  11. Yes, go with standard forward rendering. That is draw transparent objects sorted back to front (after you rendered and lit opaque portions of your scene). Draw each transparent object once for each light with combined shader (material + lighting). Or alternatively you can pack multiple lights into one shader and reduce the number of draw calls. Use additive blending to blend contributions of each light on the objects.
  12. Hello. I haven't played the game but I have the book too :) It says that "Nearby animated objects are usually the focus of attention, and by this scheme, these will cast the highest quality shadows." For me it seems that only nearby animated objects are shadowed by the 3rd shadow map. Alternatively it could be some kind of perspective shadow map that covers the whole view frustum, forcing higher resolution on nearby objects and lower on objects that are further from the camera.
  13. book sugestion

    Hello. Direct3D is just the name for the graphics interface (API). While it is primarily oriented towards accelerated 3D graphics, it is perfectly capable of drawing 2D polygons in screen space too. It is just a question of the vertex transformation. However, not far ago, Microsoft introduced a new hardware accelerated API specialized for high quality 2D drawing, called Direct2D. But I believe it is just beta now and it will only be available for Windows 7 and Vista. If you want your programs to run on Windows XP/2000 too, then Direct3D 9 is the way to go. Concerning books, I've personally found that the D3D SDK documentation (MSDN) in combination with numerous online tutorials and articles is more than sufficient way to learn the API than any particular book on D3D. Instead you might want to look for books that explain various rendering techniques and concepts. For example the Real-Time Rendering 3rd edition. (I own the book and find it most informative.)
  14. ifstream::open() fialure

    Hello. What development environment are you using? If you are using Visual Studio and you are running your program from within it, the working directory might not be the same as the directory where your executable is located. VS by default runs the program with working directory set to the directory where your project file (.vcproj) is. This does not happen if you run the program directly (outside VS), then the working dir will be the same as the exe's dir. To set the working dir for your program in VS go to Project/Properties/Debugging/Working Directory. You can use relative path (remember, it will be relative to the project directory - where the .vcproj file is) or one of the path macros.
  15. Hi, there. I made a plugin for Visual Studio 2008 which I'd like to share with you. The plugin allows you to quickly find and open any solution file. Just hit the shortcut key, type a few letters from anywhere in the file name and hit enter. You can also use wildcards (?, *) to match file name patterns. This closely mimics the Open Resource command which is well known to Eclipse users. This can be useful to quickly jump to files which are buried deeply somewhere in the solution tree. I myself don't use the solution explorer for opening source files anymore. For more details and to download the plugin see: http://visualstudiogallery.com/ExtensionDetails.aspx?ExtensionID=e4e906ee-2a2a-459b-85e8-df4b1c5666d1 or http://kutny.net/vsopen/ If there's enough interest it can be ported to visual studio 2005 too (just let me know). Martin
  • Advertisement