|
||||||||||||||||||
Add Forum to Favorites | Send Topic To a Friend | View Forum FAQ | Track this topic |
Last Thread Next Thread ![]() |
| Integrating Your XNA Engine With XSI ModTool |
|
![]() Ender1618 Member since: 4/30/2004 From: USA |
||||
|
|
||||
| Where in the render routine are the diffuse and normal textures supposed to be set to the effect? |
||||
|
||||
![]() Incommunicado Member since: 9/25/2000 From: Germany |
||||
|
|
||||
| Hi! Thank you for this very useful article. The integration between xna and a 3d package is something I have been looking for a long time. Only drawback I have encountered is that XSI Mod Tool frequently crashes, losing all data. Would be nice to hear if I am the only person having this problem or if it is maybe limited to ModTool but does not occur in the full version of XSI. If this is the case I might consider getting an evaluation copy and investing some cash into the package since I gathered some insight into this modelling tool (v1.5) several years ago, but never considered it again due to pricing. |
||||
|
||||
![]() MJP GDNet+ Member since: 3/29/2007 From: Irvine, CA, United States |
||||
|
|
||||
| Ender1618- The textures are set automatically by the content pipeline when an instance of the Effect is created. The idea is that these textures are inherently tied to any Model, so you don't need to every mess with them once you've loaded the Model and its associated Effects. Incommunicado- I've experienced these problems as well with ModTool. Unfortunately I have no idea whether these crashes occur in the full version, as I've never had the chance to use it. Matt Pettineo | DirectX/XNA MVP Ride into The Danger Zone PIX With XNA Tutorial |
||||
|
||||
![]() pirogoth Member since: 1/29/2006 From: San Lorenzo, CA, United States |
||||
|
|
||||
| I've been using XSI ModTool since it's release and I have to say, I'm quite pleased with it. I've actually never had it crash on me. However about three months ago I bought a copy of XSI Foundation. I've not used the ModTool since (for obvious reasons). Maybe you need to update your video card drivers? Also, keep in mind, there is a reason that these tools (XSI, Maya, 3DS Max) are not officially supported on consumer grade video cards. Mainly stability and the constantly changing drivers. The Quadro's and FireGL cards are very rigorously tested before release (specifically drivers). -Piro |
||||
|
||||
![]() MJP GDNet+ Member since: 3/29/2007 From: Irvine, CA, United States |
||||
|
|
||||
| Interesting...I never considered the issue of workstation video cards and it sounds like a very likely cause of trouble. Unfortunately I don't think I'll be getting a Quadro anytime soon...I'm a programmer on a very limited budget so performance/$ is what's important at the moment. Hopefully Softimage is working on this issue if there is one...I'd suspect that a very large percentage of ModTool users are running consumer GPU's due to the target audience. Matt Pettineo | DirectX/XNA MVP Ride into The Danger Zone PIX With XNA Tutorial |
||||
|
||||
![]() Adovid Member since: 1/12/2005 From: USA |
||||
|
|
||||
| I am currently running my Mod Tool pretty solidly. The occasional crash here or there due to me messing with stuff that I wouldn't be surprised about crashing XSI but overall my experience has been good. I have been using XSI Mod Tool since version 4.2 although I have had my share of crashes with version updates and re-installs. You can define a default texture via ResourceName: texture2D AmbientMap < string ResourceName = "default_ambocc_map.png"; string ResourceType = "2D"; >; custom textures applied in xsi and published (to .xsi) will override the default effect texture. To set the textures in XSI you would apply the shader(by dragging and dropping from wherever the source is to wherever the mesh is in a viewport) and then go to render->modify->texture (with the model/mesh selected) and then click your shader in the drop down menu (it will have the same name as the source file). This will open all of the properties defined in your semantics and annotations as interface features in this window which is pretty neat for tweeking (many effects will update on a viewport running directx9 in real time if they don't crash). From there just click on images and you can override all of the source images for the material you use on the model from there. edit:Oh well if you plan to publish your project doing it MJP's way is probably better because all of the overriding pathfile names in the .xsi file are not local, they are full path names that will not work in a different directory. You can tweek them in the .xsi file to be relative though if you want to go through the trouble. Thanks for the article MJP. [Edited by - Adovid on August 15, 2008 11:26:30 PM] |
||||
|
||||
![]() elkdanger Member since: 2/15/2006 From: Oban, United Kingdom |
||||
|
|
||||
| Thanks for the article. However, I just cannot get the Mod Tool integration to work as you describe. I've got a shader which I can already use in my game, and I would like to be able to do what you describe, which is apply that shader to a model using a third-party tool, so that essentially all this design type stuff is done outside of the coding environment. However, when I drag the .fx file into the material editor, I don't get any editable properties which I have specified using SAS tags in the effect file, and whenever I export the model using crosswalk into my game, the model processor complains that it can't find a processor for the image 'noclip.pic'. This image appears in the material editor for Mod Tool but I can't find a way to get rid of it (pressing 'delete' or using 'delete' from the context menu doesn't work). This whole experience has been frustrating to say the least. Have you any ideas as to why the above may be happening? |
||||
|
||||
![]() arby10101 Member since: 7/2/2006 From: Richmond, VA, United States |
||||
|
|
||||
| Elkdanger and others, I'm having a similar problem. If I use the original fx file from the article, it works fine. But with a different effect (one that works in my game), I'm not getting the results from the SAS markup I've added. The editable properties don't show up. For example, I have a variable defined this way in my effect: float3 g_MaterialAmbientColor < string SasUiControl = "ColorPicker"; string SasUiLabel = "Ambient Color"; > = {0.9f, 0.9f, 0.9f}; In the texture properties in Mod Tool, there are no entries under DirectXFX_Parameters. Also I have a texture defined this way: texture2D DiffuseMap < string ResourceType = "2D"; >; But under the effect properties on the images tab there is no place to make an entry, as if Mod Tool doesn't know that a texture is to be loaded. Can MJP or anyone else suggest an approach to get this to work? My SAS looks to me to be identical to that in the originally published effect. Mod Tool is a great tool with many advantages and MJP's article was excellent. Thanks |
||||
|
||||
![]() MJP GDNet+ Member since: 3/29/2007 From: Irvine, CA, United States |
||||
|
|
||||
| Hey guys, I saw arby's post on the XNA CC website and remembered I should probably check here too. :P elkdanger: The model processor will choke if you don't have an image assigned for a texture in the effect...ModTool will assign a default name in the .xsi file and then processor will crash when it can't find that file. I ran into problems with this when I added things like shadow maps to an effect...my workaround was to assign a dummy 1x1 image to these textures and then just override it in my engine code. arby: I answered your post at the CC website, and like I said there I'm not sure what the problem is. So if you want to post your effect here or in that other thread, I'll gladly take a look and try to figure out the problem. Oh and thanks for the feedback, everyone! Matt Pettineo | DirectX/XNA MVP Ride into The Danger Zone PIX With XNA Tutorial |
||||
|
||||
![]() MJP GDNet+ Member since: 3/29/2007 From: Irvine, CA, United States |
||||
|
|
||||
| Arby posted his shader on the CC website, and it turns out that ModTool doesn't like vs_1_1 or ps_1_1 shaders very much. Everything seems to work fine with SM20 and higher shaders. Matt Pettineo | DirectX/XNA MVP Ride into The Danger Zone PIX With XNA Tutorial |
||||
|
||||
![]() polaroidmonkey Member since: 9/21/2008 |
||||
|
|
||||
| I got this tutorial working. However I extended it by adding another mesh, a simple vertex shader that simply just transforms the vertices, a pixel shader only returning white. I also added a second technique using the simpleVS and simplePS I just did. I created two DirectX materials in XSI both using the same HLSL file. I assigned one to one mesh and the other DX material to the other. I set one to use the first technique (the one used in the tutorial) and set up its textures. Then I set the technique for the second mesh to use my simple VS and PS. Everything looks cool inside XSI. One got the normal mapped brick and one is flat white. So I export it to dotxsi. Then I import it into XNA using the tutorial project just replacing all references to the dotxsi model with my own. Now both my meshes gets rendered with the normal map technique. Since I didn't assign a texture to the second mesh in XSI I get a noicon_pic image instead. If I do assign a texture to it, that will be used. The dotxsi file contains the information of what technique to use for what mesh. Reimporting the dotxsi into XSI works excellent. So there seems to be no problem with the export. Why on earth doesn't it render with the right techniques? The technique being used is the first one in the shader if that makes any difference. If they switch places so my new technique is on top that is whats being used. [Edited by - polaroidmonkey on September 21, 2008 6:12:50 PM] |
||||
|
||||
All times are ET (US)![]() |
Last Thread Next Thread ![]() |
|