XSI Render in TX3D
by Tony Pitman · in Torque X 3D · 06/22/2009 (7:49 pm) · 3 replies
I don't have the money to buy a 3D modelling program, so I am using the free XSI Mod Tool Pro that XNA CC premium members can get for free. I am able to create a cylinder, publish it (XSI term) as a .xsi model and render it by using the T3DXSIRenderComponent object.
I then tried to render my real object that I created for a different game. For this other game I had to use the XSISASContainer class and do all kinds of lighting and rendering stuff. I wrote that game with XNA and XSI only stuff...no TX3D because I didn't have TX3D yet.
Anyway, so when I add my airplane.xsi to my project along with all of the proper folders and such it build fine, but when I run I get the exception shown below. It appears that TX3D is trying to use the BasicEffect, but I know this model has a Phone.fx shading in use. Can someone tell me how to get the 2 to work together? My model also has animation and bones and such. How will I be able to use them?
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at GarageGames.Torque.Materials.XNABasicEffect._SetupObjectParameters(RenderInstance renderInstance, SceneRenderState srs)
at GarageGames.Torque.Materials.RenderMaterial.SetupObject(RenderInstance ri, SceneRenderState srs)
at GarageGames.Torque.RenderManager.BaseRenderManager._RenderGroup(List`1 renderInstances, RenderMaterial material, MaterialInstanceData materialData, SceneRenderState srs, GraphicsDevice d3d)
at GarageGames.Torque.RenderManager.BaseRenderManager._RenderDiffuse(SceneRenderState srs, GraphicsDevice d3d)
at GarageGames.Torque.RenderManager.BaseRenderManager.RenderOpaquePass(SceneRenderState srs)
at GarageGames.Torque.RenderManager.SceneRenderer.Render(SceneRenderState srs)
at GarageGames.Torque.SceneGraph.BaseSceneGraph.Render(GFXDevice gfx, TorqueObjectType renderMask, TorqueObjectType noRenderMask)
at GarageGames.Torque.GUI.GUISceneview.OnRender(Vector2 offset, RectangleF updateRect)
at GarageGames.Torque.GUI.GUICanvas.OnRender(Vector2 offset, RectangleF updateRect)
at GarageGames.Torque.GUI.GUICanvas.RenderFrame()
at GarageGames.Torque.XNA.TorqueEngineComponent.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
at GarageGames.Torque.GameUtil.TorqueGame.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.WiThe program '[0x1B98] StarterGame3D.exe: Managed' has exited with code -1073741819 (0xc0000005).
ndows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(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 StarterGame3D.Game.Main() in C:MyDevGamesMathBugger3DMathBugger3DGameGame.cs:line 40
I then tried to render my real object that I created for a different game. For this other game I had to use the XSISASContainer class and do all kinds of lighting and rendering stuff. I wrote that game with XNA and XSI only stuff...no TX3D because I didn't have TX3D yet.
Anyway, so when I add my airplane.xsi to my project along with all of the proper folders and such it build fine, but when I run I get the exception shown below. It appears that TX3D is trying to use the BasicEffect, but I know this model has a Phone.fx shading in use. Can someone tell me how to get the 2 to work together? My model also has animation and bones and such. How will I be able to use them?
Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object.
at GarageGames.Torque.Materials.XNABasicEffect._SetupObjectParameters(RenderInstance renderInstance, SceneRenderState srs)
at GarageGames.Torque.Materials.RenderMaterial.SetupObject(RenderInstance ri, SceneRenderState srs)
at GarageGames.Torque.RenderManager.BaseRenderManager._RenderGroup(List`1 renderInstances, RenderMaterial material, MaterialInstanceData materialData, SceneRenderState srs, GraphicsDevice d3d)
at GarageGames.Torque.RenderManager.BaseRenderManager._RenderDiffuse(SceneRenderState srs, GraphicsDevice d3d)
at GarageGames.Torque.RenderManager.BaseRenderManager.RenderOpaquePass(SceneRenderState srs)
at GarageGames.Torque.RenderManager.SceneRenderer.Render(SceneRenderState srs)
at GarageGames.Torque.SceneGraph.BaseSceneGraph.Render(GFXDevice gfx, TorqueObjectType renderMask, TorqueObjectType noRenderMask)
at GarageGames.Torque.GUI.GUISceneview.OnRender(Vector2 offset, RectangleF updateRect)
at GarageGames.Torque.GUI.GUICanvas.OnRender(Vector2 offset, RectangleF updateRect)
at GarageGames.Torque.GUI.GUICanvas.RenderFrame()
at GarageGames.Torque.XNA.TorqueEngineComponent.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.Draw(GameTime gameTime)
at GarageGames.Torque.GameUtil.TorqueGame.Draw(GameTime gameTime)
at Microsoft.Xna.Framework.Game.DrawFrame()
at Microsoft.Xna.Framework.Game.Tick()
at Microsoft.Xna.Framework.Game.HostIdle(Object sender, EventArgs e)
at Microsoft.Xna.Framework.GameHost.OnIdle()
at Microsoft.Xna.Framework.WindowsGameHost.ApplicationIdle(Object sender, EventArgs e)
at System.Windows.Forms.Application.ThreadContext.System.Windows.Forms.UnsafeNativeMethods.IMsoComponent.FDoIdle(Int32 grfidlef)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.WiThe program '[0x1B98] StarterGame3D.exe: Managed' has exited with code -1073741819 (0xc0000005).
ndows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(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 StarterGame3D.Game.Main() in C:MyDevGamesMathBugger3DMathBugger3DGameGame.cs:line 40
#2
I just tried importing the .fx file into the project as well and still got the same error. I am guessing that I will need to find a way to change the XNABasicEffect mentioned in the exception into the Phone effect somehow if I want to continue to use XSI.
I have used blender. In fact I used it for my first game, Math Sniper 3D. If it is easier to use than XSI then maybe I need to go back to it.
Can you recommend a good tutorial for how you need to set things up for TX3D with animations and textures and everything to export properly for DTS with TX3D?
06/22/2009 (8:11 pm)
An interesting thing is before I copied all of the files from my other project into this one I got errors during the build process and one of them was a reference to the .fx file. I copied the .fx file into this project in the same relative folder and that fixed the build error so that it built completely.I just tried importing the .fx file into the project as well and still got the same error. I am guessing that I will need to find a way to change the XNABasicEffect mentioned in the exception into the Phone effect somehow if I want to continue to use XSI.
I have used blender. In fact I used it for my first game, Math Sniper 3D. If it is easier to use than XSI then maybe I need to go back to it.
Can you recommend a good tutorial for how you need to set things up for TX3D with animations and textures and everything to export properly for DTS with TX3D?
#3
http://filmmakeriq.com/general/featured/555-blender-tutorials.html
is another good site with... 555 tutorials.
Apart from that I'm new to TorqueX as well, and I'm yet to get a controllable object of some description going.
06/22/2009 (8:32 pm)
I can't recommend a tutorial on animation, as I'm not up to learning about that yet, but blenderartists.org is a great place to ask questions, it's how I worked out how to do UV mapping in blender (which btw is a lot easier in 2.49 than it used to be).http://filmmakeriq.com/general/featured/555-blender-tutorials.html
is another good site with... 555 tutorials.
Apart from that I'm new to TorqueX as well, and I'm yet to get a controllable object of some description going.
Torque Owner Trent
You say you don't have the money for the 3D modelling programs, but are you aware that you can only use XSI for the XBOX 360? If you want to use it for windows games you need to buy it. An alternative here is Blender. It's a great modelling tool, it has a DTS exporter add in and is totally free.