• 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.
Sign in to follow this  
Followers 0
stu_pidd_cow

Animation debugging nightmare...

7 posts in this topic

Hi,

 

I’m trying to do skinning animation with Assimp and D3D11 in VS2012. I have managed to get things looking ok but I have a problem as seen in this image:

 

animation0_zps0b1e8085.jpg

 

No, that is not his long luscious hair. It appears some triangles are completely wrong. I have checked the bones and the vertex information that is retrieved from the file and everything seems right. I also tried recreating the vertex shader on the CPU to see if I could replicate the problem, but there was no problem there either. So I tried debugging a pixel (on his "hair") and I got these values:

 

animation1_zps3ea13b6a.jpg

 

This shows that the bone weights are completely wrong (because they should add up to 1.0). So this must mean that the vertex I sent to the GPU is wrong, right? Going back to the CPU side, these are the exact values I sent (for vertex 301):

 

animation2_zps992710e6.jpg

 

The highlighted stuff shows that the bone weights do indeed add up to 1.0. So when I check on the GPU side, I see this:

 

animation3_zps7f4b34ab.jpg

 

The red part shows that the bone weights are there on the GPU. The interesting thing is that the highlighted green stuff are the actual values that the bone weights are given. It is sort of like the vertex buffer has gone out of synch or something (but I am sure this is a user error). I have made sure that I have sent the correct vertex buffer size and vertex struct size.

 

Sorry, I know this is a complicated question, but I'm not sure what else to try. I'm not sure what code to give you, so just ask and ye shall receive. I'm also not sure if this is a D3D problem or an animation problem or whatnot. So does anyone have any idea what the problem could be or things that I could try?

 

Thanks.

Edited by stu_pidd_cow
0

Share this post


Link to post
Share on other sites


I have made sure that I have sent the correct vertex buffer size and vertex struct size.

 

That sounded like the most likely cause and might be worth rechecking. The only other thing that springs to mind is that you might be sending the wrong value to NumVertices in your call to DrawIndexedPrimitive?

0

Share this post


Link to post
Share on other sites

Thanks for the reply. I have rechecked these things but I can't seem to find anything wrong with these things. I thought maybe there was something wrong with the indices, so I got rid of them (ie just use vertices in the given order) but this showed similar results.

0

Share this post


Link to post
Share on other sites

hello. every time I get a mesh that looks like that I load it in another viewer  like mesh view or some thing that you know works and renders meshes.

Because some times the exported mesh is messedup and it not your code. See some of my meshes came out like that and I messed with them and it was the exporter

not my code hours and hours here.

Is this a valid mesh..

0

Share this post


Link to post
Share on other sites

What file format are you using for the mesh? Do other files render correctly?

 

If it's a DirectX x-file, I second ankhd's comments. Look at your file with mview or DXViewer. The code for those viewers is much more generalized with regard to mesh structure than yours may be.

 

Also, as ankhd mentions, it may well be a problem with the file, not your code.

 

I had a similar problem and it was caused by vertices that were unweighted, or weighted to the root frame rather than, .e.g., to the head bone. For the offending vertices (if you can determine them,) see if the weight bones are the same as adjacent vertices. Don't know what modeler you're using, but (if you can) check the weighting of the offending vertices.

 

Also, some x-files I used had more than one mesh and the algorithm I was using assumed a single mesh. Does yours?

Edited by Buckeye
0

Share this post


Link to post
Share on other sites

I'm using md5mesh and md5anim files (I got the files from the tutorial here). I have tested it by loading it into AssimpView and it looks and behaves perfectly fine, so I don't think there's a problem with the file. The mesh is broken into multiple pieces, but my code caters for this. It draws find in bind pose (without bones).

 

One thing I have noticed is that I cannot check the values in the third vertex in a triangle in the graphics debugger. I'm not sure if this is related. You can see this in my second image (in my original post, where vertex 300's values are not visible). I have also noticed that it is (as far as I can tell) only one triangle in the mesh. It is often the last triangle specified in the index buffer, but not always.

 

I have checked and rechecked my input layouts, vertex/index buffer declarations and draw calls but everything seems fine.

0

Share this post


Link to post
Share on other sites

Holy freakin bejezus, I found the problem!

It turns out I was setting the wrong size for the bone IDs in the input layout. No wonder I was getting such weird results.

 

All embarrassment aside, thanks for the help everyone! I have a lot to play with now.

0

Share this post


Link to post
Share on other sites

Does the messed up part follow the camera when you move around if so its a transformation matix error some where.

0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0