Jump to content
  • Advertisement
Sign in to follow this  
vicviper

software skinning vs hardware skinning

This topic is 5455 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, I was thinking lately (yes, I think too much), about the advantages /disadvantages of doing mesh skinning in hardware or software. And my opinion is that, as technology evolves, there are more and more disadvantages of doing skinning in hardware. The three reasons I found about it are: - latest lighting technology being pushed involves multipass rendering, which is bad for skinning. - silouhette extraction for stencil shadows is a mess with skinned meshes - vertex shader duplication for skinned /non skinned meshes in all materials. When using software skinning, all the hardware pipeline is greatly simplified, as all the geommetry is treated as static objects, this reminded me some words of Carmack, in which he stated that for the first time, the engine used in Doom 3 has a unified lightning/rendering pipeline for both level and character models. This is consistent with the new Doom3 MD5 file format, because it looks to me that the vertex data is hightly optimized for soft processing, not hard (MD5 uses a variable number of weights/bones per vertex), so, my bet is that Doom 3 is doing software skinning. as usual, I would like to know what people think... the main question would be: it is still worth to do vertex skinning in the GPU ?

Share this post


Link to post
Share on other sites
Advertisement
The next version of DirectX is likely to provide a more flexible shader system which will let you write to vertex buffers from a shader allowing you to do your skinning once on the GPU to an intermediate buffer and then reuse the skinned geometry over multiple passes. I belive OpenGL 'uber buffers' will allow for a similar approach but I'm not very familiar with OpenGL. You can actually already do this using Shader Model 3 on GeForce 6 hardware (using the ability of vertex shaders to read from textures) but it's not as straightforward or as efficient as it could be. That will solve the multi pass issue and will also reduce the problem of the combinatorial explosion of shaders / vertex shader duplication for skinned vs. non skinned meshes.

The vertex shader duplication issue is already becoming less of a problem thanks to hlsl, the Effects framework and the static branching offered by newer graphics hardware. The situation will be further improved when shaders offer more flexibility in their output destination.

At some point graphics hardware will be flexible enough to do silhouette extraction - 'geometry shaders' are planned for a future version of DirectX which will allow for silhouette extraction, prgrammable adaptive tesselation and other cool things but that may be a few years away. The issue may become moot though since there seems to be a growing consensus that shadow buffers rather than shadow volumes are the best solution for shadows in the near future. Carmack said in his QuakeCon keynote that he expects to use shadow buffers in his next engine.

There are a few problems with doing skinning on the GPU at the moment but they will all be solved as graphics hardware becomes more flexible. At the same time the speed of graphics hardware continues to increase at a much greater rate than CPU speed so moving work back onto the CPU is really not the way to go.

Share this post


Link to post
Share on other sites
Quote:
it is still worth to do vertex skinning in the GPU ?


I'd say yes %)

Quote:
- latest lighting technology being pushed involves multipass rendering, which is bad for skinning.

? you know that on recent hardware you can render to a vertex buffer don't you?

Quote:
- silouhette extraction for stencil shadows is a mess with skinned meshes

then don't use shadow volumes :p you said that as if they were the only good shadowing technique available :)

Quote:
- vertex shader duplication for skinned /non skinned meshes in all materials.

that's an reason to have dynamic shader generation... the engine builds all the versions of the shaders it'll need...

doing skinning in software might become interesting again with PCI-express though (from a certain point of view, and only if you're GPU-limited...)

EDIT: dammn, cross post :|

Share this post


Link to post
Share on other sites
In the next version of directX??
Look at this from the DirectX 9 documentation:

IDirect3DDevice9::ProcessVertices Method

--------------------------------------------------------------------------------

Applies the vertex processing defined by the vertex shader to the set of input data streams, generating a single stream of interleaved vertex data to the destination vertex buffer.

This should remove first & third point. And if you're engine deal with shadow map, ou don't have to worry about shadow volumes. Shadow volumes is the only raison to make your skinning on the CPU.

Making all your skinning in software implies also that you send all you're vertices to the GPU and it's expensive...

Share this post


Link to post
Share on other sites
Quote:
Making all your skinning in software implies also that you send all you're vertices to the GPU and it's expensive...

less expensive with PCI-express, but anyway... not a reason to switch back to CPU skinning only imho, or not to switch to GPU skinning.

Share this post


Link to post
Share on other sites
I have no idea if doom 3 is doing software skinning or not. I've heard their models sometimes go up to 6 influences per vertex. However, there is no limit to the number of bones you can blend on the GPU. even in VS 1_1 you can blend more than 4 bones. it just depends on the max size of the weights/max influences arrays in the vertex struture. unless you mean that it is wasteful to allocate so much space for all those bones and they may not even get used..... with software rendering i suppose you can simply store all influevences to a stl vector and be more efficient I suppose.

Share this post


Link to post
Share on other sites
>> ProcessVertices() is always done in software on the CPU.

Argh... are u sure of that?
I know this is the case in DirectX 7, but the DirectX 9c SDK documentation don't mention this...
I will make some test...

Share this post


Link to post
Share on other sites
Quote:
Original post by vicviper
And my opinion is that, as technology evolves, there are more and more disadvantages of doing skinning in hardware.

- latest lighting technology being pushed involves multipass rendering, which is bad for skinning.

It's already difficult to be vertex limited, and as technology evolves, it'll only get faster. Software is faster for multipass ONLY if your mesh is tesselated enough to be vertex limited. As shaders are getting more complex, not only are the hardware shader units getting faster, but you're getting more of them... 6200 and 6600 each have 3 vertex units, and the 6800 has 6.

As technology advances you may not use multiple passes much, just doing everything in the one uber pass.

Skinned meshes account for a small amount of geometry, compared to landscape, trees, rocks, building, and/or whatever environmental objects are in your particular game. Sure they need a bit more heavier processing than non-skinned meshes, but not a huge amount.

Share this post


Link to post
Share on other sites
Quote:
Original post by Ronan
>> ProcessVertices() is always done in software on the CPU.

Argh... are u sure of that?
I know this is the case in DirectX 7, but the DirectX 9c SDK documentation don't mention this...
I will make some test...

Yes

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!