Elurahu

I'm in the process of writing my master thesis about hybrid shadow casting methods using the Xbox360. I have a few questions I would love to have clearified.

- Say I wanted to use a .3DS file to represent my scene and models. Are there a way to get this file to the xbox360 without using the content pipeline since it doesn't support this format. I know this might be a simple problem, but I just can't seam to figure out how to do it. I know that Abi's RocketCommander uses some custom .level files which is just placed and copied directly. Would this work for .3DS files as well

- In case it does, how would I access it Normal file IO

This whole reason for using the .3DS file format is the fact that it incapsules geometry, cameras, light settings etc. in one file which eases the test scenarioes for me quiet a bit.

I hope someone will take the time to help me out a bit. It would be most appreciated.

Regards



Re: XNA Framework Files on Xbox360

Jon Watte

You can use regular file I/O from the XNA framework. The data lives inside your build output folder ("Debug" etc) if you make it "Copy to Output" in the project. You get the path to read from using StorageContainer.TitleLocation.

Once you read the 3ds, you can use the basic effect, create Texture2D instances and SetData, create VertexBuffer and IndexBuffer instances and SetData, create a VertexDeclaration and SetData, then bind it all to the device and issue DrawIndexedPrimitives to draw. You cannot compile an effect at runtime, though; this is the major draw-back of the XNA content model.





Re: XNA Framework Files on Xbox360

Elurahu

Wonderful news. Thanks. Don't really need dynamically compiled effects anyhow.



Re: XNA Framework Files on Xbox360

sugrhigh

Elurahu wrote:


- Say I wanted to use a .3DS file to represent my scene and models. Are there a way to get this file to the xbox360 without using the content pipeline since it doesn't support this format. I know this might be a simple problem, but I just can't seam to figure out how to do it. I know that Abi's RocketCommander uses some custom .level files which is just placed and copied directly. Would this work for .3DS files as well



I'm not sure as I haven't yet ordered my creators club subscription, BUT from what little i know about it, no... There most likely IS a way, I've just never seen it





Re: XNA Framework Files on Xbox360

Roger Klado

Since Autodesk aquired Alias it now owns FBX.

The newest FBX plug-in for MAX is working reliably fer me ( Animation, lights, materials, meshes and more.. in Maya import/export to MAX )

As Microsoft has partnered with Autodesk on the FBX intergration, I imagine if not yet, then hopefully soon for full scene pipeline import

Have you downloaded FBX yet

http://usa.autodesk.com/adsk/servlet/index siteID=123112&id=6839916





Re: XNA Framework Files on Xbox360

waruwaru

You might want take a look at Derek's project on threesixbox.com

http://www.threesixbox.com/project/ id=6c3eea10eb






Re: XNA Framework Files on Xbox360

Elurahu

Yes I do indeed plan on using the Threesixbox 3DS importer. Problem is that it doesn't use the content pipeline which you need when running on the xbox (as far as I'm aware. Please enlighten me if not).

I did indeed look at the FBX format which I have used for several other projects in the past. But as you said yourself I don't think GS supports full scene loads yet.





Re: XNA Framework Files on Xbox360

Derek Nedelman

Well, I haven't yet tried what Jon suggested but if it works (and I have no reason to think that it doesn't) then it means that you don't need to use the content pipeline. Of course, you still have to know which texture files your scene will need and then add them to your project so that they can be copied to the output directory, which is the same procedure you follow when using the content pipeline.

Regardless, I'm still actively developing the viewer and I will probably get some sort content processor/importer into the next release since, like you, I would like to run it on a 360. Also, having those things will be a benefit since loading a 3DS file directly isn't particularly fast due to all the normal and vertex preprocessing that has to occur.

Unfortunately I can't give you a release date for the next version since I find myself working on a handful of things at the moment. If you manage to run the viewer on a 360 on your own, or if you write some sort of content processor/importer I'd be very interested in hearing about it.





Re: XNA Framework Files on Xbox360

Elurahu

The way I was planning to go around it was to keep the 3DS files intact (as they are now) and load it using the BinaryReader as you do now. I see no reason to precompile them into the binary XNA format (I'm not particulary interested in fast load times since it doesn't benefit my project in any way atm).

I'll be sure to drop you a mail when I get it working (should be sometime next week). The only thing, I see, that prevents it from running as it is on the Xbox is the dynamically compiled shaders which should be easily removed. But then again we will see :)





Re: XNA Framework Files on Xbox360

Derek Nedelman

You won't want to remove the dynamically compiled shaders. It's much too slow to compile them all every time the program runs. Even if you don't care about fast load times, I doubt that you'll want to sit and wait for a few minutes every time you test your work.

In the Viewer subproject, in a file named ViewerUtilities.cs, look for a function called LoadEffect(). When it actually compiles using the Effect.CompileEffectFromFile() function, the TargetPlatform.Windows constant is passed in. To precompile for 360 you can change this value. Then you'll need to delete all the cached .fx.bin files (or rename their parent directory) to force a complete recompile of all the shaders - you'll do this on your Windows machine. These recompiled shaders are the ones you'll want to load on 360.





Re: XNA Framework Files on Xbox360

Elurahu

Ok I'll be sure to try that out. But doesn't compiling them prior to running the program make them static compiled :)

Just to make sure I completly understand what you're suggesting:

1. Compile the shaders by running the program on a windows machine while parsing the Xbox360 parameter.

2. Copy the precompiled shaders to the xbox360 output directory

3. Deploy on the xbox