Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 15th, 2007, 06:35 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to yoyokid
Default 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
  #2 (permalink)  
Old May 17th, 2007, 04:17 PM
Registered User
 
Join Date: May 2007
Location: , , Denmark.
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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).

  #3 (permalink)  
Old May 17th, 2007, 05:32 PM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to yoyokid
Default

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
  #4 (permalink)  
Old May 24th, 2007, 09:48 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

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
  #5 (permalink)  
Old May 29th, 2007, 03:43 PM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

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
  #6 (permalink)  
Old May 31st, 2007, 08:16 AM
Registered User
 
Join Date: May 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to yoyokid
Default

thank you, i think i will need the tutorial...thanks!!!

yoyokid
  #7 (permalink)  
Old July 24th, 2007, 03:43 AM
Registered User
 
Join Date: Jun 2007
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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.
  #8 (permalink)  
Old September 6th, 2007, 11:23 PM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to QUADgnim Send a message via AIM to QUADgnim Send a message via MSN to QUADgnim Send a message via Yahoo to QUADgnim
Default

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
  #9 (permalink)  
Old September 12th, 2007, 10:26 AM
Registered User
 
Join Date: Aug 2007
Location: , , .
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to QUADgnim Send a message via AIM to QUADgnim Send a message via MSN to QUADgnim Send a message via Yahoo to QUADgnim
Default

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.
  #10 (permalink)  
Old January 18th, 2008, 05:17 AM
Wrox Author
 
Join Date: May 2007
Location: Hannover, , Germany.
Posts: 29
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to abi.exdream.com
Default

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
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 7: permission Denied while uploading files matrixbegins BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 July 28th, 2008 06:55 PM



All times are GMT -4. The time now is 09:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.