- Follow the steps on the Getting started page of the rust3ds org on Github to setup your dev environment.
- Run
git submodule update --initto include thecitro3d-rssubmodule required to build the 3DS app - Inside the
appfolder, runrustup override set nightlyto tell Cargo to use Rust nightly when compiling that project - Use
cargo 3ds build --releaseorcargo 3ds run --address <3dslink address> --releaseinsideappto test the 3DS app (or alternatively run the examples in thecitro3d-rs/citro3drepo/folder) (be sure to use release mode, as debug will be very slow to deserialise and load the model data at startup, resulting in a black screen for a long time before it actually renders)
After building, the output files will be in target/armv6k-nintendo-3ds/release. app.3dsx can be run directly in an emulator like Citra.
app- The main 3DS app I'm working onapp/assets- Place any assets like images to be used as textures orgltf/glbfiles to be used as models, these will be preprocessed and placed in theromfsfolder and bundled in the resulting.3dsxfile.
core3d- A crate for handling much of the 3D data and processing in the 3DS apppreprocessor- A crate for preprocessing assets likegltf/glbor image files and usescore3dto structure and serialize the data so it can be easily imported and used in the main 3DS appcitro3d-rs- My fork of the Rust wrapper for the 3DS GPU driver. This is included as a submodule so it can be kept in a separate repo but still easily have the 3DS project refer to a local and easily-modifiable copy of the crate
The app can currently import and render an animated model exported from Blender in the GLTF format.
The Blender model must have a maximum of 18 bones, as that is the limit I've set in the shader (physical limit of the GPU with the current implementation is ~20 bones).
When exporting a model as gltf/glb, change Skinning -> Bone Influence to 3, and make sure to enable Mesh -> Apply Modifiers if you have any modifiers that haven't already been applied to the model, such as Decimate. Animations and Textures should be included in the export, I left the Materials settings as Export and Automatic, and Animation enabled and with default settings.
Any assets including the output gltf/glb file from Blender, any png/jpg files to be used as textures, or other resources, can be placed inside the app/assets folder, where they will be preprocessed and moved to the app/romfs folder which gets bundled inside the resulting .3dsx file. These can read in using the std::fs module as long as the ctru::romfs has been initialised, and any file paths are prepended with romfs:/.
Feel free to have a look at 3DS programming experience.pdf to see a little presentation I made for my friends about part of my experience with getting all this set up.