• Announcements

    • khawk

      Download the Game Design and Indie Game Marketing Freebook   07/19/17

      GameDev.net and CRC Press have teamed up to bring a free ebook of content curated from top titles published by CRC Press. The freebook, Practices of Game Design & Indie Game Marketing, includes chapters from The Art of Game Design: A Book of Lenses, A Practical Guide to Indie Game Marketing, and An Architectural Approach to Level Design. The GameDev.net FreeBook is relevant to game designers, developers, and those interested in learning more about the challenges in game development. We know game development can be a tough discipline and business, so we picked several chapters from CRC Press titles that we thought would be of interest to you, the GameDev.net audience, in your journey to design, develop, and market your next game. The free ebook is available through CRC Press by clicking here. The Curated Books The Art of Game Design: A Book of Lenses, Second Edition, by Jesse Schell Presents 100+ sets of questions, or different lenses, for viewing a game’s design, encompassing diverse fields such as psychology, architecture, music, film, software engineering, theme park design, mathematics, anthropology, and more. Written by one of the world's top game designers, this book describes the deepest and most fundamental principles of game design, demonstrating how tactics used in board, card, and athletic games also work in video games. It provides practical instruction on creating world-class games that will be played again and again. View it here. A Practical Guide to Indie Game Marketing, by Joel Dreskin Marketing is an essential but too frequently overlooked or minimized component of the release plan for indie games. A Practical Guide to Indie Game Marketing provides you with the tools needed to build visibility and sell your indie games. With special focus on those developers with small budgets and limited staff and resources, this book is packed with tangible recommendations and techniques that you can put to use immediately. As a seasoned professional of the indie game arena, author Joel Dreskin gives you insight into practical, real-world experiences of marketing numerous successful games and also provides stories of the failures. View it here. An Architectural Approach to Level Design This is one of the first books to integrate architectural and spatial design theory with the field of level design. The book presents architectural techniques and theories for level designers to use in their own work. It connects architecture and level design in different ways that address the practical elements of how designers construct space and the experiential elements of how and why humans interact with this space. Throughout the text, readers learn skills for spatial layout, evoking emotion through gamespaces, and creating better levels through architectural theory. View it here. Learn more and download the ebook by clicking here. Did you know? GameDev.net and CRC Press also recently teamed up to bring GDNet+ Members up to a 20% discount on all CRC Press books. Learn more about this and other benefits here.

programci_84

Members
  • Content count

    415
  • Joined

  • Last visited

Community Reputation

336 Neutral

About programci_84

  • Rank
    Member

Personal Information

  • Location
    Istanbul, Turkey
  1. Do you need a 3rd person camera rotating around the player? If so, I recommend you to use quaternions. It's much easier. If not, can you describe what you want more clearly? Btw, I don't recommend you to deal with LookAt and Eye vectors. You can define a world transform for your camera because it's quite easy to perform some transformations (translate, rotate etc.) over a world matrix. And when you need a view matrix, just take the inverse of this world matrix.
  2. I[s] think your problem comes from depth output: [code] // Pixel shader output structure struct PS_OUTPUT { float4 Color[4] : COLOR0; float Depth : DEPTH; }; PS_OUTPUT ps_main (void) { //... Out.color = blah; Out.Depth = 1.f; //WHY THIS? return Out; } [/code] Why are you writing 1.f to DEPTH semantic output? I think this will cause that all pixels' depth value would be 1.f; so everything would be invisible (according to your Z-Buffer config.).[/s] Sorry, I didn't read your last sentence about you fixed it. Never mind hth. -R
  3. Physics engines are not designed for a specific graphics library such as DX or GL. Their main goal is to make physical calculations and return final transformations of registered objects/primitives. And your job is to get that transformation data and use for your needs. PhysX is the most popular physics engine. Now it became free for commercial and non-commercial applications. You can use it. The first important thing you must know about it is that the matrix structure of the engine is column-major but in it's row-major in DX. On the other hand, Bullet is another popular engine. It's open source and developed by a Sony R&D employee. I know it's used in some animation movies like Toy Story. hth. -R
  4. I think there's a good explanation about occlusion culling in GPU Gems 3. You can find it on nVidia's website; it's free to read. Btw, I don't use occlusion culling. I don't know whether this will be helpful or not, but here's a list of what I'm doing: [b]1) Checking visibility:[/b] By using view frustum and bounding volumes. It's quite easy. [b]2) Filling Z-Buffer:[/b] First, setting ZWriteEnable to TRUE, ZEnable to TRUE and ZFunc to LESSEQUAL. Then I'm rendering the visible objects (returned from the prev. step) to only Z-Buffer (i.e. don't touch the front-buffer or any pixel) with a front-to-back order [i](Ordering is calculated in view space)[/i]. [b]3) Rendering with Z-Culling: [/b]First, setting ZWriteEnable to FALSE, ZEnable to TRUE and ZFunct to EQUAL then rendering the objects. This technique is called "Early Z Culling" and works well for forward renderers (like CryEngine 2 and Doom 3 Engines). With this technique, pixel shader won't be executed for invisible pixels (maybe invisible objects). I cannot say anything about performance comparison between occ. culling and this one; try and see. hth. -R
  5. As dAND3h said, the cheapest way is to check bounding volume collisions. You can use either bounding box or bounding sphere according to the shape of your mesh. For example, a box would be best for a television and a sphere for a beach volleyball [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Btw, [quote name='dAND3h' timestamp='1333674353' post='4928641'] This wont work if you are rotating the meshes though. [/quote] Why? I think you're wrong. Because we can transform bounding boxes (AABBs) and check them for collisions. F. Luna's book (Introduction to 3D Game Programming with DirectX 9.0c: A Shader Approach; this is available in Google Books) has a good explanation about bounding volumes: creation, transformation and checking. I think the most accurate way is to create a low-poly version of your mesh manually (i.e. with a 3D modeling software) and send it to your physics engine. There're a lot of physics/collision engines around the net. hth. -R
  6. Take a look at [url="http://aras-p.info/texts/CompactNormalStorage.html"]here[/url]. hth. -R
  7. Try using D3DXVec3TransformNormal() instead of TransformCoord(). Because direction vector is a normalized vector, not a coordinate.
  8. There's an exact vertex declaration equivalent for every FVF. And every mesh has a FVF property. So, you don't need to manually call IDirect3DDevice9::SetVertexDeclaration(), because ID3DXMesh::DrawSubset() function calls IDirect3DDevice9::SetVertexDeclaration() before calling SetStreamSource() and SetIndices().
  9. What can you say about a float3? Is it a 3x1 or 1x3 matrix? I think that "mul" function deals with that difference.
  10. Thank you all! You helped me a lot!
  11. Hi all, I want to write my own container classes and I've some questions. I've learnt that when we want to add one or more elements to an STL container (e.g. std::vector), it increases the size of the buffer more than we want. For example, if we have a 4-element-vector and if it's capacity is 4, when we want to insert 3 elements somewhere in it, it sets the capacity (or size, whatever you say) more than 7 (e.g. 10). I think this is done to avoid calling ::operator new frequently. But the size increases unnecessarily, right? So, for an STL-like custom container, which one is more expensive?: a) Using new/delete every time we want to add/delete elements (To keep the size of the buffer exact: for an n-element-buffer, the size is n*sizeof(element_type) ). b) Increasing the capacity unnecessarily (To avoid calling ::operator new and ::operator delete every time). btw, I've heard about "heap compaction" but I don't have any idea about that. Hope I could describe. Thx in advance. -R
  12. [quote name='Jeason' timestamp='1330329531' post='4916917'] I know how to specify memory pool. But don't know if not specify memory pool, just giving only D3DUSAGE_WRITEONLY, which memory pool it resides. [/quote] You've 2 memory pool parameters for D3DX Mesh functions: D3DXMESH_MANAGED and D3DXMESH_SYSTEMMEM. If you don't specify one of'em, the function will choose D3DPOOL_DEFAULT for both vertex and index buffer of the mesh. So, if you specify only D3DXMESH_WRITEONLY, buffers will reside default memory pool. [quote name='Jeason' timestamp='1330329531' post='4916917'] I had found the sentence---[i]"Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY might suffer a severe performance penalty.".[/i] But I don't understand it well, does it mean if specify D3DUSAGE_WRITEONLY, the memory pool is D3DPOOL_DEFAULT? maybe that's it meaning.[img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] [/quote] As far as I understand, the sentence says: "Unless you specify D3DUSAGE_WRITEONLY, D3DPOOL_DEFAULT is a bad choice for memory pool. i.e. D3DPOOL_DEFAULT works well with only D3DUSAGE_WRITEONLY". hth. -R
  13. If you have the full source of assimp library, then you can take a look into the project named "assimp_view". It shows how to load the model, animations, skin info etc. and manage them. Also it shows how to build D3DX buffers and render. Here's the path: assimp_sdk_dir\workspaces\vc9\ btw, it's written in C++ and for DX9. So I hope you can understand. hth. -R
  14. D3DXMESH_MANAGED means D3DPOOL_MANAGED for vertex and index buffer of the mesh. Like this one, D3DXMESH_WRITEONLY means D3DUSAGE_WRITEONLY for both vertex and index bufferof the mesh. So, you can check DX docs for D3DUSAGE and D3DPOOL. Docs say about D3DUSAGE_WRITEONLY: [i]"Buffers created with D3DPOOL_DEFAULT that do not specify D3DUSAGE_WRITEONLY might suffer a severe performance penalty."[/i]
  15. Basically, if you change some properties defined in D3DPRESENT_PARAMETERS object (like auto depth buffer usage, window dimensions etc.), it's recommended to reset your device. You don't have to do that for resizing, but, for example, if you resize the window in windowed mode and if you don't reset the device, rendered image may be distorted each time you resized the window. If you want to change device properties (e.g. Vertex Processing: like switching from H/W to Pure HW, Device Type: like switching HAL to REF), you must release your device then recreate. Before you reset or release the device, you must release all the memory but in D3DPOOL_MANAGED (e.g. D3DXLoadMeshFromX function creates meshes in D3DPOOL_MANAGED). After resetting or recreating, you must recreate corresponding memory. hth. -R