Strange vertex buffer issue

Started by
0 comments, last by RobM 2 years, 9 months ago

[edit]: I just figured this out a minute after posting! Not a bug.. My model has 4 renderable parts and the first part (which isn't drawn first) does actually render correctly. This means my Collada converter must be messing up the subsequent blend indices/weights after the first mesh part. I just assumed that when I saw the first few indices/weights that the entire model has them, but they don't!

Hi

I'm experiencing the strangest bug I think I've ever seen in 20 years of DirectX dev.

I downloaded a few Mixamo models in Collada format and used my custom Collada converter to convert to binary which my engine can load. The characters render correctly, animations render correctly, all looks good.

I then designed my own character in Blender, exported it to Collada format, used my converter and the character renders correctly in my engine. I'm trying to use the animations from the Mixamo character on my own character (the skeletons are the same), but that's not the issue.

When I load my character, which has the exact same vertex declaration and layout as the Mixamo one, for some reason, the blend indices and blend weights are loading into the Input Assembler stage as all zero. This is causing my character to disappear (and not even make it to the Pixel Shader). Using the Graphics Analyzer in Visual Studio, here are some screenshots of various data points in the Frame Capture I did.

Firstly, here's my vertex declaration (it's identical for the Mixamo character):

So 22 floats for the whole vertex (3 pos, 2 uv, 3 normal, 3 tangent, 3 binormal and 8 blend/weights).

Here's my character's vertex buffer:

You can see that the blend weights and blend indices are loading in correctly, I've highlighted the weights in green and the indices in red.

Here's the setting of the vertex buffer:

Setting the vertex buffer

You can see the the stride is 88 bytes, which is correct. Now if you look at the Input/Output for the Input Assembler:

Zero blend weights and indices

Contrast that to how it looks when I load the Mixamo character (same binaries, only loading a different model):

Identical vertex buffer layout for Mixamo character

Identical SetVertexBuffer call:

Identical SetVertexBuffer call

But the Input Assembler has the weights:

I've tried practically everything with this, all the strides seem to match. When I load the Mixamo mesh and my mesh, the layouts are identical. If the vertex buffer that I load for my character has the blend and weight values and I'm setting it with the correct stride, how on earth can the data disappear at the Input Assembler stage? Anyone seen anything like this before?

This topic is closed to new replies.

Advertisement