Jump to content
This is not recommended for shared computers
Sign in anonymously
Don't add me to the active users list
Banner advertising on our site currently available from just $5!
1. Learn about the promo. 2. Sign up for GDNet+. 3. Set up your advert!
04 March 2015 - 02:54 PM
Interesting.... Could you please explain me a little about that. I just tested with depth disabled and second path applied to sprites, but for now I dont really understand why?
Does shader takes depth into account?
04 March 2015 - 09:42 AM
I do like this now:
int passesCount = spriteBatchEffect.GetTechniqueByName("SpriteBatch").Description.PassCount;
var technique = spriteBatchEffect.GetTechniqueByName("SpriteBatch");
for (int i = 0; i < passesCount; i++)
localpass = technique.GetPassByIndex(i);
graphicsDevice.DrawIndexed(indexCount, 0, 0);
and add vertex shader to 2nd pass
But now I just dont see sprites. No errors, but also no image, but passes are valid.
I missed setting vertex buffer and now It rendering, but still only one path. I dont know why, but it ignores the second one.
26 February 2015 - 12:22 AM
Hm, so, you think that I dont need to sort joint-weights, but just match bone names and thta should do the trick?
In my case I already did that, but I am asking should I sort bones like they situated in skeleton (because in my case sid and bone names are the same)
for ex in skeleton i have bone1 bone 2 bone3 and in controller bone3 bone1 bone2.
Need I sort bones to make them be as bone1 bone 2 bone3?
I want to sort bones because I want to optimize animation algorithm and simplify it a little. If I have sorted bones, I could just multiply current animation matrix * parent.
If I have not sorted bones, I need to multiply them in hierarachy till the first level each time.
Do you understand what I mean?
25 February 2015 - 11:58 PM
What do you mean? Could you explain more detail?
21 February 2015 - 03:33 PM
OK, digging around I found an issue:
1. I import collada to DirectX, so all matrices should be transposed.
2. I use Yup axis and Blender has Zup axis, so I have to change axis with special matrix
M11 - 1
M23 - 1
M32 - 1
M44 - 1
multiply each joint matrix once like this - newjointMatrix = axisChangeMatrix * jointMatrix * axisChangeMatrix
You need to do this once during load.
Then I should just multiply offset * keyframeMatrix. Or If I have hierarchy - keyframe*keyFrame.Parent *..... Parent and so on.
Then - send final matrices array to shader.
Now animation works correct.
GameDev.net™, the GameDev.net logo, and GDNet™ are trademarks of GameDev.net, LLC