Odd world matrix behaviour

Started by
2 comments, last by kauna 9 years, 11 months ago

Hi guys

I am having some odd problems generating a topdown view of some point sprites in a radar simulation here.

The first image is how things should be. It was generated by using the D3DXVec3Transform function in C++ on each point with the World matrix. The results were then saved to a file, and then the file was used to plot the display using GDI+ with the origin of the plot (iow 0, 0, 0) at the red dot. The world matrix was not transposed when this was done.

Clouds_zps110a5e93.jpg

However, if I try to do the same using the mul function in the geometry shader in DX11, without transposing the world matrix, this is what I get:

radar_zpsb10931f3.png

Transposing the world matrix, either on shader, or on the C++ side before sending it to the shader doesn't help either. As you can see in the above image, there is some sort of repetition going on. Transposing removes that repetition, leaving a single block in the center of the display, but with 2 solid white lines extending from the center up and to the right on X and Y axis.

I have verified that when I send the world matrix to the shader, all the elements are being loaded and are going through. This leads me to question how the shader is performing the translation. Any ideas?

Thanks

JB

Advertisement

When you say you have verified the values are "going through" do you mean you had a debugger stepping in and checking the values are correct? Perhaps even a debug output buffer pulling out the values?

Are you really really sure you're uploading to the correct buffer offset? That could explain the solid lines.

Keep in mind the geometry shader runs after VS so if the VS is not passthrough you'll have to upload it a different matrix.

Previously "Krohm"

I am using the ID3DX11Effect system so I don't run into constant buffer issues.

If I call GetMatrix on the ID3DX11EffectMatrixVariable object for my world matrix and then compare between the returned array and the array I sent to the shader, they are the same.

I cant use shader debuggers like pix or VS2012 unfortunately...the process is running DX9 as well and it appears they cant handle 2 different versions of DX in the same process.

Can you show some shader and c++ code?

Cheers!

This topic is closed to new replies.

Advertisement