Advertisement

Why do i need a VSH file for animations ?

Started by July 01, 2018 03:20 PM
6 comments, last by the incredible smoker 6 years, 7 months ago

Hi, i am working with DirectX9.

I would like to start with skinned mesh animations.

I heard you can only make animations with a .vsh file, why is that ?

Cant i configure the code somehow that it does the same ?

 

The VSH files look like ASM codes inside, something i dont know how to use.

Is it a bit the same ?

 

Why cant i init a shader without .vsh file ?, in a more understandable way.

thanks

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

5 hours ago, the incredible smoker said:

I heard you can only make animations with a .vsh file, why is that ?

You probably heard wrong or misunderstood. :) Is this a tutorial that you were reading?

VSH is a shader file, shaders can move a skin mesh around and doings so with a shader should give better performance.

However since a vertice is just a point in space, there is no reason than only shaders could move it. Any piece of code that moves a point around can animate a model.

 

There is a large amount of file formats that export skinned mesh animations.There is also a large list of shader file types.

Advertisement

You don't have to program shaders in assembly if you don't want to. HLSL is a c-style language that can be used instead.

For hardware accelerated skinned animations, vertex shaders tend to be easier to use than the fixed-function hardware T/L, due to the freedom afforded by the programmability.

Of course, you can apply all transformations on the CPU without using hardware VS or T/L at all. It will just make your stuff slower.

Niko Suni

Thanks for the replys.

 

I would like to have all matrices in software,

the thing is i dont want to manually set all vertex positions for the whole mesh.

 

Can i have all matrices in code and set the vertex positions automaticly without VSH file ?

 

What exactly do you change in the VSH file ?,

matrix or vertices or both ?, or either you like ?

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

9 minutes ago, the incredible smoker said:

matrix or vertices or both ?, or either you like ?

Anything is possible. For skinning it is common to animate the matrices on CPU, upload them to GPU and use a vertex shader to animate the vertices. Typically each vertex has 4 matrix indices and 4 weights, but you can also use quaternions, dual quaternions, more than 4 bones per vertex, whatever...

Shading languages are C code more or less, so there is not much to learn about shading languages. But you need to learn all the API details, like how to upload buffers, what kinds of buffers there are, how to compile / upload / activate shaders, etc.

17 minutes ago, the incredible smoker said:

Can i have all matrices in code and set the vertex positions automaticly without VSH file ?

There is a fixed function alternative: https://docs.microsoft.com/de-de/windows/desktop/direct3d9/indexed-vertex-blending

You would not need to write shaders if you use this.

Nice, then i can search to do without shaders, then later maybe learn shader language.

I,m going to look to the skinnedmesh example and see how that works without the shader.

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

Advertisement

The skinnedmesh example is more difficult then all my engine together.

 

I just need this :

i have 3 matrices for my worm, i like to make it a snake,

i take a cylinder, now i need to assign those vertices to the 3 matrices.

Thats it.

 

What would be the difference between indexed and non indexed rendering ?

I also looked at the software rendering, it locks buffer, places all vertices, then unlock,

this is something i like to avoid,

S T O P C R I M E !

Visual Pro 2005 C++ DX9 Cubase VST 3.70 Working on : LevelContainer class & LevelEditor

This topic is closed to new replies.

Advertisement