kyhh08
04-27-2011, 04:20 AM
Hi guys.
I have run into some issues while doing the training video 'Real-Time Shader with XNA". I know that the XNA training videos for XNA do not work that well with 4.0 version of XNA.
1) when I have to do my projection, world and view matrices I made some changes to make it work.
I got the solution from a post at this forum, but it does not seem to fully work.
this is what i did:
foreach (ModelMesh mesh in gcv.Meshes)
{
foreach (SkinnedEffect effect in mesh.Effects)
{
//effect.World = Matrix.Identity;
effect.Parameters["Bones"].SetValue(bones);
effect.View = view;
effect.Projection = projection;
}
mesh.Draw();
}
from this:
foreach (ModelMesh mesh in gcv.Meshes)
{
foreach (Effect effect in mesh.Effects)
{
effect.Parameters["Bones"].SetValue(bones);
effect.Parameters["View"].SetValue(view);
effect.Parameters["projection"].SetValue(projection);
}
mesh.Draw();
}
When I do this I get a different result than form the video:
http://img706.imageshack.us/img706/8884/dtshader.jpg
and my result:
http://img156.imageshack.us/img156/1272/myshader.jpg
I use the files from the downloaded for this course.
2) In the training video 'Real-Time shaders with XNA' the skinnedmodel sample includes a SkinnedModel.fx file which is not included in the new version of it. In the video we create a new .fx file, but it does not seem to apply anything, which I think is because the code do not look for a SkinnedModel.fx file to begin with since it was not included. How can I get it to take my shader effects.
Anyone have any solutions for these issues?
Best Regards, Kim.
I have run into some issues while doing the training video 'Real-Time Shader with XNA". I know that the XNA training videos for XNA do not work that well with 4.0 version of XNA.
1) when I have to do my projection, world and view matrices I made some changes to make it work.
I got the solution from a post at this forum, but it does not seem to fully work.
this is what i did:
foreach (ModelMesh mesh in gcv.Meshes)
{
foreach (SkinnedEffect effect in mesh.Effects)
{
//effect.World = Matrix.Identity;
effect.Parameters["Bones"].SetValue(bones);
effect.View = view;
effect.Projection = projection;
}
mesh.Draw();
}
from this:
foreach (ModelMesh mesh in gcv.Meshes)
{
foreach (Effect effect in mesh.Effects)
{
effect.Parameters["Bones"].SetValue(bones);
effect.Parameters["View"].SetValue(view);
effect.Parameters["projection"].SetValue(projection);
}
mesh.Draw();
}
When I do this I get a different result than form the video:
http://img706.imageshack.us/img706/8884/dtshader.jpg
and my result:
http://img156.imageshack.us/img156/1272/myshader.jpg
I use the files from the downloaded for this course.
2) In the training video 'Real-Time shaders with XNA' the skinnedmodel sample includes a SkinnedModel.fx file which is not included in the new version of it. In the video we create a new .fx file, but it does not seem to apply anything, which I think is because the code do not look for a SkinnedModel.fx file to begin with since it was not included. How can I get it to take my shader effects.
Anyone have any solutions for these issues?
Best Regards, Kim.