 |
BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6  | This is the forum to discuss the Wrox book Professional XNA Game Programming: For Xbox 360 and Windows by Benjamin Nitschke; ISBN: 9780470126776 |
|
Welcome to the p2p.wrox.com Forums.
You are currently viewing the BOOK: Professional XNA Game Programming: For Xbox 360 and Windows ISBN: 978-0-470-12677-6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
|
|
|

May 15th, 2007, 06:35 AM
|
Registered User
|
|
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
i cant swich out the .X files on chapter 5
in the unit test for "TestRenderOurNewGraphicsEngine" i can't swap out the .X files..it says that ...here is the exception
System.ArgumentNullException was unhandled
Message="You may not pass in a null value for this parameter.\r\nParameter name: value"
Source="Microsoft.Xna.Framework"
ParamName="value"
StackTrace:
at Microsoft.Xna.Framework.Graphics.Effect.set_Curren tTechnique(EffectTechnique value)
at XnaGraphicEngine.Graphics.Model.Render(Matrix renderMatrix) in C:\Documents and Settings\Chris Hawley\Desktop\Chapter5\XnaGraphicEngineChapter5_C ode\XnaGraphicEngineChapter5\Graphics\Model.cs:lin e 164
at XnaGraphicEngine.Graphics.Model.<>c__DisplayClass2 .<TestRenderModel>b__1() in C:\Documents and Settings\Chris Hawley\Desktop\Chapter5\XnaGraphicEngineChapter5_C ode\XnaGraphicEngineChapter5\Graphics\Model.cs:lin e 217
at XnaGraphicEngine.Game.TestGame.Draw(GameTime gameTime) in C:\Documents and Settings\Chris Hawley\Desktop\Chapter5\XnaGraphicEngineChapter5_C ode\XnaGraphicEngineChapter5\Game\TestGame.cs:line 92
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Paint(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameWindow.OnPaint()
at Microsoft.Xna.Framework.WindowsGameWindow.mainForm _Paint(Object sender, PaintEventArgs e)
at System.Windows.Forms.Control.OnPaint(PaintEventArg s e)
at System.Windows.Forms.Form.OnPaint(PaintEventArgs e)
at System.Windows.Forms.Control.PaintWithErrorHandlin g(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Mes sage& m)
at System.Windows.Forms.ContainerControl.WndProc(Mess age& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at Microsoft.Xna.Framework.WindowsGameForm.WndProc(Me ssage& m)
at System.Windows.Forms.Control.ControlNativeWindow.O nMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.W ndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallba ck(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at CallWindowProcW(IntPtr , HWND__* , UInt32 , UInt32 , Int32 )
at MouseSubClassFunc(HWND__* hWnd, UInt32 msg, UInt32 wParam, Int32 lParam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchM essageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager. System.Windows.Forms.UnsafeNativeMethods.IMsoCompo nentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.Run MessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at Microsoft.Xna.Framework.WindowsGameHost.Run()
at Microsoft.Xna.Framework.Game.Run()
at XnaGraphicEngine.Game.TestGame.Start(String testName, RenderDelegate initCode, RenderDelegate renderCode) in C:\Documents and Settings\Chris Hawley\Desktop\Chapter5\XnaGraphicEngineChapter5_C ode\XnaGraphicEngineChapter5\Game\TestGame.cs:line 115
at XnaGraphicEngine.Graphics.Model.TestRenderModel() in C:\Documents and Settings\Chris Hawley\Desktop\Chapter5\XnaGraphicEngineChapter5_C ode\XnaGraphicEngineChapter5\Graphics\Model.cs:lin e 208
at XnaGraphicEngine.Program.Main(String[] args) in C:\Documents and Settings\Chris Hawley\Desktop\Chapter5\XnaGraphicEngineChapter5_C ode\XnaGraphicEngineChapter5\Program.cs:line 30
is there anything i could do/try?
p.s. im using 3d Max studio and have the panda .X exporter
yoyokid
|

May 17th, 2007, 04:17 PM
|
Registered User
|
|
Join Date: May 2007
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
It appears the error occurs when setting the shader. I cant remember now how the shader is saved in the .X file, but you should look into that (it doesnt seem your model has a shader attached).
|

May 17th, 2007, 05:32 PM
|
Registered User
|
|
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
ok, thanks, but i tried all the options on Panda Exporter(the one mentioned in the book) and it still wont work, giving me the same messege everytime pointing to this line "effect.CurrentTechnique = effect.Techniques["Specular20"];"
yoyokid
|

May 24th, 2007, 09:48 PM
|
Wrox Author
|
|
Join Date: May 2007
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
You either can disable the effect.CurrentTechnique line and just use the effect's first technique or you can export a .X file with the correct shader set, which has a "Specular20" technique (I would use the NormalMapping.fx shader).
In later chapters it will handled differently from the settings in the .X file with help of the TangentModelImporter project.
You can also check out my www.RocketCommander.com tutorials on Coding4Fun were I explain in a video tutorial step by step how to export a model from 3D Studio Max to an .X file with help of the Panda DirectX exporter.
But it is true that X files are very hard to handle and way too complicated if you just want to render something quickly. For that reason I like the Collada format much better because even if there is something missing in there you can easily add it after the exporting has happend. For more details check out my SkinningWithColladaModels project on my blog.
http://abi.exdream.com
|

May 29th, 2007, 03:43 PM
|
Wrox Author
|
|
Join Date: May 2007
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
If you have troubles finding the Rocket Commander Video tutorials, here they are:
http://blogs.msdn.com/coding4fun/arc...06/997852.aspx
Video Tutorial 1 explains a little bit about the basics and shows 3D Studio Max.
Video Tutorial 4 and 6 also go a little bit deeper into the used model formats and how to use the TangentVertexFormat and setting the shader correctly (both in code and in 3DS Max).
Hope that helps. If you still have problems, I can maybe provide a little walk-through here in the forums.
http://abi.exdream.com
|

May 31st, 2007, 08:16 AM
|
Registered User
|
|
Join Date: May 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
thank you, i think i will need the tutorial...thanks!!!
yoyokid
|

July 24th, 2007, 03:43 AM
|
Registered User
|
|
Join Date: Jun 2007
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Hi there!
Just bumping this question up as I'm having exactly the same problem as yoyokid - But ANY model I try to change in ANY of the tutorials just doesn't work!
It's starting to wear me down.
I understand that the code is looking for a shader from the .X file (Which seems a bit strange to me, but hey) but I can't work out how to export this using the Panda exporter?
I know Ben's busy, so if anyone could explain in a bit more detail his "export a .X file with the correct shader set, which has a "Specular20" technique (I would use the NormalMapping.fx shader)."
idea that would be great?
Or point out where (In which video and at roughly what time!) he shows an export from 3DS MAX to .X in his tutorial videos that would be brilliant?!
Or even, take the time to point me in the right direction - I don't want much, just to change a model!
Tom.
|

September 6th, 2007, 11:23 PM
|
Registered User
|
|
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
Tom or yoyokid,
Did either of you ever resolve your problem?
I'm experiencing the exact same issues and have yet to resolve them.
abi (Benjamin)
I'm not a modeler, nor do I have a friend who is. I use 3DS MAX, but only enough to be dangerous. I don't understand what/how we associate a shader with a model and/or associate specular20 with a model. Can you either provide more specifics or recomend a modeler who can help us?
Thanks all
|

September 12th, 2007, 10:26 AM
|
Registered User
|
|
Join Date: Aug 2007
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
I got it to work. It wasn't until I upgraded from 3ds max 7 to 9 (I'm not sure about 8). In max 7, when you go into the material editor and choose select texture, there is no directX shader reference. However, after installing max 9, now I see a texture option for a direct X shader. After choosing it I was able to select any of the shaders supplied in with the book, Professional XNA Game Programming, and even create my own.
Hope that helps.
|

January 18th, 2008, 05:17 AM
|
Wrox Author
|
|
Join Date: May 2007
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
BTW: If you use one of my newer projects (e.g. Dungeon Quest) the 3D Models are all loaded from .dae Collada files. They cause no headaches and you can easily check if something is wrong due the fact that they are .xml text files. Collada files are also supported by a greater variety of applications and in case you don't have a shader or material attached to a mesh, the engine can easily check it and provide another material or shader.
http://abi.exdream.com
|
|
 |