• 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
mrheisenberg

What is the current trend for skinning?

8 posts in this topic

It has been a while before I did a skinning system and the last time I did one was one the CPU with Directx9.Now I see people talking about vertex shader skinning,compute shader skinning,using textures for bone data..kinda confused here,which is the mosts efficient method?Is interpolation more efficient on the compute shader than in the vertex shader?
0

Share this post


Link to post
Share on other sites
I think, that it is pretty common to calculate the bone animation on the CPU and do the skinning in the vertex shader with registers for the bone orientation (quaternion+position or matrix), though saving this data in a texture which will be accessed in the vertex shader could have some advantages.
1

Share this post


Link to post
Share on other sites
Yeah the current 'baseline' implementation would be calculate bone anim on CPU, put bones into constant registers as matrices, and do skinning with 4 weights in the vertex shader.

Instead of using 4x4 matrices, the simplest improvement is to just use 4x3 matrices (or 3x4, depending) so that you only need 3 registers per bone -- you can do this because one row/column will always be [0,0,0,1].
You can then get down to just 2 registers per bone by using dual-quaternion skinning, or using some kind of rotation+translation format.

On some cards, you might get better fetch performance by putting the bone data into a texture, or a 'tbuffer' instead of a 'cbuffer'.

Another issue is that in most modern renderers, each model is drawn more than once per frame -- e.g. one from a light's point of view for shadow mapping, and then once for the main camera. With vertex-shader skinning, this means that the model is skinned twice (which doesn't occur with CPU skinning).
You can avoid this issue on DX10 cards by using "stream out" -- where instead of rasterizing your skinned vertices, you instead write the results to a vertex buffer. You can then use this temporary vertex buffer to draw the mesh multiple times (without running skinning again).
On DX11, you also have the option of using a compute shader to do this work.
2

Share this post


Link to post
Share on other sites
With DX11.1 you can output to a buffer from a vertex shader, which is even better than using a compute shader or stream out since you can just output the skinned verts while rasterizing your first pass.
2

Share this post


Link to post
Share on other sites
[quote name='MJP' timestamp='1348819195' post='4984654']
With DX11.1 you can output to a buffer from a vertex shader, which is even better than using a compute shader or stream out since you can just output the skinned verts while rasterizing your first pass.
[/quote]

won't that become overly complicated when you implement advanced animations(animation blending,adjusting character body to match the angle of the terrain he is standing on,ect.),you wold have to send a huge amount of matrices
0

Share this post


Link to post
Share on other sites
You wouldn't stream out the bones, just the transformed vertices. The point is that you only need to apply the bone transforms (the heavy lifting of skinning) once, and then re-use the resulting mesh in subsequent drawing passes.
0

Share this post


Link to post
Share on other sites
Ok just 1 last question = in DirectX11.1 you can stream out from the vertex shader,instead of the geometry shader.Is this hardware dependant,or can my directx 11.0 gpu do it?
0

Share this post


Link to post
Share on other sites
You can stream out from vertex shader by bypassing the geometry shader. This functionality is available in 11.0 hardware.

The device's CreateGeometryShaderWithStreamOutput method also accepts vertex shader bytecode. You do get a geometry shader handle from that (and you need to set it as the active geometry shader), but it is just a straight pipe that sends the vertices from the VS to the SO buffer.

In addition to that, 11.1 hardware allows you to write arbitrarily to r/w shader resources from within all shader stages, which gives you a lot more flexibility. Edited by Nik02
0

Share this post


Link to post
Share on other sites
UAV's from any shader stage is a 11.1 feature, so you'd need a fully-compliant FEATURE_LEVEL_11_1 video card with the necessary driver. I'm not sure if existing DX11 GPU's are fully compliant, but if any are I don't believe there are any publicly-available drivers yet. I could be wrong about that though.

Making a GS with stream out from a vertex shader still creates a "dummy" geometry shader. Either way the really bad part about doing it that way is that you can't rasterize a triangle list while streaming out, because you'd have to stream out the fully-expanded list of vertices which is pretty inefficient. The alternative is to have a dedicated "stream-out" pass where you render with a point list topology and stream out from the GS, since that gives you a non-expanded buffer of vertices that you can index into with your index buffer.
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