Dust3D is a quick 3D modeling software. It automatically generates a
mesh from nodes drawn by the user. Most of the code is implemented in
C++ with Qt, including the UV unwrapper, rigger, pose and motion
editor etc, however, the core mesh algorithm was written in Rust.
Recently I have rewritten the Rust part. The
codebase is pure C++ now.
(Screenshot of Dust3D, the three thumbnails in the lower right
corner are the preview of exported result in Godot, Unity, and
I have been asked if I am going to migrate more of the C++ code in
Dust3D to Rust, and there is another author who has contributed many
excellent improvements on the Rust code, thanks
anderejd. I think I’d better explain a
little bit why I dropped the Rust
implementation from Dust3D.
The mesh generator was originally implemented in pure C, then migrated
to Rust. Why did I switch to Rust? C is quite lacking in
infrastructure, but I was sick of different C++ trivial variations
across different platforms, it’s a pain to introduce a third party
library if you want your whole code to work on different systems with
different versions and brands of compiler. Rust has all the merits I
wanted, it’s easy to start, painless to include other libraries, and
most importantly, it’s memory safe. If you have ever been heart
attacked by core dumps, you will know how beautiful this is.
Given so many advantages, why I am switching back to C++? The most
beautiful thing about Rust is also a disadvantage. When you implement
an algorithm using C++, you can write it down without one second of
pause, but you can’t do that in Rust. As the compiler will stop you
from borrow checking or something unsafe again and again, you are
being distracted constantly by focusing on the language itself instead
of the problem you are solving. I know the friction is greater because
I am still a Rust learner, not a veteran, but I think this experience
stops a lot of new comers, speaking as someone who already conquered
the uncomfortable syntax of Rust, coming from a C/C++ background.
Another reason is the Rust ecosystem is still immature. As an indie
game developer I can see the situation is changing, there is a website
Are we game yet? that lists many neat
things in the Rust world, there is a data driven game engine written
in Rust called Amethyst, all these things
look really promising. But, there is no Qt, no CGAL etc, all these
frameworks and libraries have been developed for so many years and
maintained very high level of quality. I know there are some bindings,
but it’s not mature and not enough.
Preparing Reference Sheet
Prepare two pictures, one shows the front view and the other shows the side view, you can take photo of a real object, google it from internet or even draw it if you are an artist. No matter from what method you got the two pictures, make sure they are vertical equally aligned, and been combined before used in the Dust3D as a reference sheet.
In this article, I will use my own guitar as an example, I took two pictures using my mobile phone, and combine them in GIMP (A photoshop like software but free).
Open the reference sheet from last step in the Dust3D menu: File / Change Reference Sheet...
Now place nodes on the canvas, adjust the radius of the nodes according to the reference sheet. There is nothing complicated need to explain, when you play it, you can easily handle the process of modeling in Dust3D, and you can still refer to this video for detailed demonstration: Make a 3D model from scratch using Dust3D.
Pick colors for parts from the eyedropper icon of parts tree, you can also choose different materials for parts from there. Currently, PBR (Physically based rendering) is one of the most popular shading models of the game industry, Dust3D supports the metal/roughness PBR materials, you can google “PBR Roughness/Metallic” for better understanding of it.
Create material from the Materials tab. There are five texture types you can customize, if you don’t understand what each type means, no worries, there are many free seamless PBR textures you can find in the internet (Keywords: “Free seamless PBR textures”), download the specified texture types from where it provided. In this article, We are going to use the Scratched Gold 01 and Wooden Planks 04 from cgbookcase.com, both are 1K Resolution.
Create two materials from the resources, and assign them to the neck and body of the guitar separately from the parts tree.
Phew, no manual UV unwrapping, it’s done! We got a game ready asset.
Now, export it as FBX for Unity or glTF for Godot from the main menu: File / Export....
Import to Unity
Import the outcome “guitar.fbx” from Unity menu: Project / Assets / (Right Click) Import New Asset…, you can see the imported asset guitar, choose the Materials tab from the Inspector window,
Click the button on the right of label “Textures”: Extract Textures… (If you ignore this step, there will be no materials applied on the model, just blank color), the popup “Select Textures Folder” dialog will ask you where to put the extracted textures, you can leave it as default path(Project Root / Assets) or create sub directory such as Materials.
With the current unity version (2018.2.17f1 Personal 64bit), there is a “NormalMap settings” dialog will popup during the importing, just click the “Fix now” and your asset is ready.
Import to Godot
Drag the exported outcome with name “guitar.glb” to the left bottom area of the main window, right click the imported item “guitar.glb”, choose “Open Scene(s)”, there will be a popup dialog ask you to confirm, just click the “Open Anyway”, now you can see the model showing in the scene view. Click the Mesh from “Scene / Scene Root” tree, then click the little guitar icon in the right bottom to preview the rendered model.
You can also view the glTF file from online: https://gltf-viewer.donmccurdy.com/
Further Edit in Other Tools
Dust3D is designed for easily making game ready assets, if you just want to make a base model in Dust3D and then further sculpt in another software such as Blender, that is totally fine, just export as OBJ format, this will make the exported result more quadified instead of triangulated.
We have demonstrated how to make a game asset easily in Dust3D, but it’s still, no animation.
Dust3D support pose and motion editing, let’s see what we can get in the following steps, A fully animated running cycle of camel:
To make the model animated, in other animation authoring tools, such as Maya and Blender, usually you need to create bones for the model and paint weights for each bone to influent the vertices. There is no difference of the underlying animation theory between Dust3D and other tools, however, Dust3D takes the heavy burden of bones creating and weights painting for you as long as you tell the software the key positions of a body.
Mark each limb and neck, and necessary joints, then choose the Rig Type as Animal, the auto-rigged result will show on the Rig window.
The animation feature of Dust3D is an experiment to replicate the work of the motion-picture pioneer Eadweard Muybridge. Let’s first see how Eadweard did his wonderful work in 1878, image courtesy of Library of Congress Prints and Photographs Division and Nevit Dilmen:
From the above motion clip, we can see the key of motion is the keyframe, in Dust3D, one pose consists of one single or a serials of keyframes.
Drag the nodes to adjust pose, just like modeling, the only difference is that you can not scale the radius of the node and there is no means of doing that.
You can compose of poses and even sub motions as one motion.
Right click the interpolating buttons to adjust the bouncing setting, which was mentioned in David Rosen’s GDC talk An Indie Approach to Procedural Animation as Spring Interpolation.