Hi to all
I have a problem now , trying to use 2 different VertexDeclarations in the same Monogame program.
Explaination :
1 - I have begin to write a first part with a big land based on hightmap , some trees , rocks , a good water effect with reflects and refractions , sun specular , and a navigation camera to explore the landscape.
That was good but no avatar to play as a 1rst person … then step 2 :
2 - I have downloaded a fun C# sample , created by Will MOTIL , Making a FBX Skinned Mesh Loader and Animator. Realy good , it works perfectly alone , as a sandbox with only an animated FBX. That was great.
I have mixed my C# with the FBX skinned animation , and the compilation was finally OK , I have crossed my fingers but I’ve been stoped by an exception at the first RUN.
Here is the Exception message : An error occurred while preparing to draw. This is probably because the current vertex declaration does not include all the elements required by the current vertex shader. The current vertex declaration includes these elements: SV_Position0, NORMAL0, TEXCOORD0, NORMAL1, NORMAL2, BLENDINDICES0, BLENDWEIGHT0.
In fact , for my landscape , I use only a VertexPositionNormalTexture VertexDeclaration , and the VertexDeclaration for the skinned FX is more complex , using bones , weights , …
Obviously , I use the good DRAW procedure for both parts , mine with landscape part based on a prepared VertexBuffer , and the skinned DRAW for the avatar animation using an effect according to the complex VertexDeclaration.
I hope you understand the context , and I hope you will give me a solution to solve this issue.
Is it possible to mix 2 different VertexDeclarations ?
How to force the good VertexDeclaration when needed ?
Chris
Exception reached when trying to DRAW avatar skinned mesh animation.
Skinned VertexDeclaration for animated FBX shader
My simple DRAW from VertexBuffer for my landscape ( based on VertexPositionNormalTexture Vertex declaration )