Home Technical Talk

CAD Modelling for Games

polycounter lvl 3
Offline / Send Message
drooms polycounter lvl 3

Finished Model (textured & rendered):


Hey guys, my name is John Kilbride, and I'm a freelance Hard Surface Artist. I decided I wanted to give a small look into my workflow using CAD-modelling software for game-ready props, since when I started out experimenting with this there wasn't a lot of direction after exporting from Fusion.

CAD modelling is generally used for production parts, that would then later be sent to a 3D printer or a CAD Mill. We of course want to embed it into a game-engine, so well have to find workarounds on how we can use the data supplied by Fusion, Solidworks or your preferred CAD Modelling software.


What You need:

Fusion360 (or your preferred CAD modelling software), Moi3D, Maya (or your preferred Polymodelling software) & Zbrush


First off: The difference.

We all know poly modelling: extruding, pushing around vertices, making sure we don’t make the lines wonky; It can be a hassle, and you will spend a lot of time on adjusting it especially when working on highly complex models. Everything has to be done proficiently so that your shading is correct, because you don’t want to risk normal artifacts that a player could notice (and that would look bad ingame later on). Softwares like Zbrush or 3dsMax do make the hussle a little bit easier, but you will still have to fight with good geometry.

This is where CAD modelling is in someway ahead: It lets you stop worrying about edgeloops and topology somewhat in general. You block out your shapes via vector lines & curves, use booleans without having to adjust the geometry afterwards, and you can model the craziest models in no time. Everything you do can be accurate to the mm (and smaller) if you need it to be, and you don’t have to worry about non manifold faces, pinching, creases, or messed up normals. All that stuff is far behind you, so that you can solely concentrate on making your model awesome.

The only trade off: You do not have control over every vertex & making something looks organic is hard. I'd recommend working in a workflow that handles the hard surface parts inside of a CAD modelling software, and using a polymodelling software for everything else.


Step One: The Concept.

Every time you model something, you generally want to start off of a concept. For the sake of this tutorial, I decided to create a Dieselpunk Lock pick Gun, which means I will orient myself on the designs of motors, engines, inner car / plane parts in general, since they are the closest to that style that I can find in the real life. I will start out without a concept, but I'd recommend you have a strong idea about how it should look in the end, since you will create the lowpoly first (more to this later).


Step Two: Making the lowpoly.

With every modelling program, start out with a general blockout. CAD modelling requires you to be able to break down your concept into the most basic shapes, since you are only able to create sillhouettes on a 2D plane (that you then extrude).

If you haven't touched CAD modelling at all, I'd recommend watching this series by Isaac Oster (Fusion360): https://www.youtube.com/watch?v=CtL1ECQdruk

In the lowpoly, you want to have a fillet threshold; What I mean by that is that you shouldn't apply fillets unless the surface is too curved (you decide what is too much curvature, I generally go with what would be visible in the sillhouette and what not). Edgefillets, to make hard edges have nice normal detail, should generally be not applied in this stage, since they'd take up unnecessary geometry.



Step Three: Creating the Highpoly.

Now that you have the created the lowpoly, copy everything (I like to paste it to a new group in fusion so that low & highpoly can be kept separate) and paste it. Try to keep it organized, since the highpoly can become messy.



Step Four: Export the low & highpoly.

Once you have both designs finished, your ready to export them. you can check if their sillhuettes line up, but if you haven’t added / changed anything drastically besides greebling it you should be fine.

To export both & use them in a manner that makes later editing easier, you will want to go through Moi3D, another CAD modelling program. Export from Fusion / your CAD software both files as .step (other formats work, but I found this one the most reliable). Make sure you have disabled all the objects of the lowpoly when exporting the highpoly (just disabling the group doesn't always work) and vice versa to get two clean separate files, one with highpoly, one with lowpoly.

IMPORTANT: If you are planning to do a damage-pass through zbrush, you will have to fillet every edge of the highpoly. Zbrush doesn’t like non-filleted edges and can give you some nasty stretching at times.


For lowpoly:  Import the .step file inside of Moi3D, export as .fbx, and play around with the settings like seen below. you can find the export option through clicking on the little folder on the bottom, then go to export. Make sure you have a nice density while still keeping everything visually appealing. It is important that you export in ngons, since it makes cleanup a whole lot easier.



For highpoly: click on import again, save if you feel like it is necessary, then load the highpoly .step file into Moi and go through the same. with the highpoly, you will want to find a balance between necessary polygons and making it look "highpoly" (depending on the piece, set a limit where you think its okay. watch out that you are not going into the millions, since then your baker [Marmoset Toolbag for me] might not be able to load it). if you are planning to import the model into zbrush, make sure that you export it as only tris (instead of ngons or quad & tris), since that usually makes it easier for Zbrush to handle.



Step Five: Import (the highpoly) into maya.

Since I am still missing the tube I want to have running along the handle, I'll have to import the highpoly into maya. Here are a few important things:

Your high & lowpoly meshes will have the same mesh names, which in f.e. maya leads to not being able to import the second one on top of the first one. to change this, I'd advise on handling each version separately, meaning first you will do all you have to on the high / lowpoly, including changing the names (for baking), and then handle the other mesh. In this case, since i want to take the mesh over to Zbrush as well, I'm going to start with the Highpoly.

While Importing any of the two meshes, you might get this message:


Ignore it, no need to fear. I personally dont know what is causing this, but I never had any trouble with it, so its best to just ignore it and keep on working.

Added the tube, made a lowpoly copy of it (on a hidden layer) and onto the next step.


Step six (optional): Damage pass in Zbrush.

Generally, doing a damage pass for an used object is a must in my opinion. You have to understand the material you are working with / the material you want each and every part of the model to be, so if you are new to this, id advise on looking up reference images on f.e. rubber, plastic, cloth, metal, cast metal & wood. These will be materials you'll be facing the most, so its good to know what their damage patterns look like.

The body of the lockpick gun is full metal, the tube rubber, and only the trigger & knob on the top will be plastic.

Note: you can do a micro-damage pass, although id advise on doing that in your texturing program. doing this by hand can take a lot of time up, so for now concentrate only on the biggest damages this item could've had, without distorting it too much (do not decide you want to cut it in half all of a sudden ^^). For me to consistently edit and manipulate this object for f.e. edgedamage, ill have to remesh it, since in its current state it is not much use to me. for that, ill use the Zremesher and pump those values up to the top. put everything to (100), and don't change anything else. this should give you a fairly good remesh (if you have filleted all the edges before) that you can then work with.

Before:


After:


Export it as .fbx if you can, obj might not work with a too high triscount (to reimport it into your polymodelling software).


Step Seven: Cleanup, Uving of the lowpoly & readying the bake.

7.1. Cleanup

You've finished the highpoly, now lets ready the lowpoly for the bake. Import it into maya (or your polymodelling software) and remove edges that seem somewhat out of place, like the ones in the picture below:

Turn this:


Into this:


(I forgot to add the cable since it was in another file, added it afterwards)


At this point, yes, you CAN go in and go around with your target weld tool, merge vertices together, generally make the mesh even more pretty; but did I ever say this was a guide about topology? Hell, I want this thing to work in game, and I don't feel like fighting with the normals right now. The way it is now is fully alright for a non organic mesh (we will triangulate it later), I have reduced its triscount from 6k down to about 4.5k (with tube its about 5.3k), and the normals are perfect. So, lets UV this baby.


7.2. "UVing this baby"

I like to keep my mesh in Ngons during the UVing process, generally to see and select the lines clearer, since if I’d triangulate it some lines would be hard to select. UVing this model is basically the fastest part; You should have a model that already has UV seams. This is because Fusion360 automatically generates those to apply its own materials to it, and Moi3D keeps that selection. The only problem with these UVs is A. they are a mess, and B. there are too many cuts. So, you will most likely start out with something like this:


And if you've done everything right, you should end up with something similar to this:


Of course, everything will later on fit into the 1-1 UV space, and we can pretty much ignore shell orientation since we don’t have to worry about lightmaps (at least not with this model).

The one thing I really love about the UV shells I am able to generate this way is that they don’t have any stretching. I never had an issue where I had to manually reposition UV vertices, and I don’t think I’ll ever have one.

Once you've laid out your map, simply triangulate the mesh. This is to avoid wrong shading in the other software, since every program triangulates the meshes differently, and to be able to import it into programs that don’t like working with ngons.

Name the different meshes, export the lowpoly, but keep the project open (I'd recommend assigning a layer to it so that you can easily show and hide it) for


7.3. Readying the Bake.

You have finished the Highpoly, UVed and named the lowpoly, and now it's time to finally get our highpoly back into the program.

Note: On reimport in maya, it might be that the mesh changed a bit in size, which you definitely dont want for baking. So instead of resizing it per hand, go on and drag the highpoly you previously exported to zbrush into maya. it wont replace the meshes that you have in there (the ones with the damage pass) but instead it will adjust the size of them to the size of the already in the scene existing ones (neat little trick that i learned by accident).

Rename the meshes, assign vertex colors and export it again, ready to be baked.


8. Do all the other stuff.

All that remains now is for you to bake the maps and texture it. Export the textures in the right format for your engine, import the lowpoly mesh, assign textures and voila. The Fusion model is set up in game! This workflow can be done with any size or complexity of model, from Cars to Scifi Structures, nothing is out of reach. For bigger models, I'd recommend going the extra mile and fixing up the mesh though; vertices are cheap, but not free.


I hope you enjoyed this little look into my workflow; I decided to create this somewhat as a view into how things can be done, since I found a lot of different information on the web when i started using CAD for games. This is definitely not the only way this can be done, so if you don’t feel comfortable using this sort of workflow please don’t let this keep you from practicing CAD modelling. There are a lot of other ways out there that may be more fitting for you.

I also have to say this is not perfect; I’ve ran into some problem in the Zbrush stage where the ribbing on the handle started to get all blubbery. The fix for me was in the end to do two bakes, one with the Zbrush highpoly and one with the unedited one, cut the ribs out of the unedited and merge it onto the Zbrush one inside of Photoshop. not perfect, but it works. Looking back, a lot on this model could’ve been done better, I could’ve tightened of the clamps, added some more surface detail, but since this was a one day project to punch out this article i am actually quite happy with it.


Q & A:


Q: Do I have to have Moi3D?

A: In my opinion, it is vital. Moi3D is currently the only program whos exporter gives you the ability to tweak mesh density and format (with that I mean ngons, tris & quads and tris only). But, you can also export straight from fusion using it's sliders to adjust the polycount.


Q: Can I use any other CAD or 3D modelling software?

A: Yes, as long as the CAD software can export as either .step, .3dm, .igs/.iges or .sat. You can also use the polymodelling software of your choice.


Q: Is there a way to export a clean lowpoly?

A: Not that I know of; I wish there was, but at the moment this is the best I can offer. If you do have ideas, tips or questions that I haven't answered on this topic, or any topic regarding CAD to Game, you can always send me a private message. I'd love to hear from you.


Q: Can I use this workflow for animations / animated movies?

A: You can certainly try, but I wouldn’t advise you to. Most animated movies use subdiv modelling to speed up their rendering process and make rigging easier, so you’d have to create a lowpoly that could be used in the same sense. I use CAD modelling to eliminate the highly time consuming step of adjusting and tweaking the highpoly with edgeloops and keeping your topology somewhat clean to avoid any shading errors, which you’d basically then have to work into it again in recreating the mesh. It would probably be faster if you started out working with subdiv in the first place.


Well, I hope this was useful, I'm gonna have a drink now.

Cheers,

John Kilbride


Replies

  • Neox
    Offline / Send Message
    Neox veteran polycounter
    this is really cool stuff!

    but man that lowpoly mesh looks... exotic!
    how is the internal triangulation working out? i see a ton of places where i would fear that it will break :o 
  • drooms
    Offline / Send Message
    drooms polycounter lvl 3
    Neox said:
    this is really cool stuff!

    but man that lowpoly mesh looks... exotic!
    how is the internal triangulation working out? i see a ton of places where i would fear that it will break :o 
    Its honestly working out great, thats why I didnt spend much effort on it ^^. the mesh's normals are super clean, and importing them into Unreal or Unity is no problem at all; no fragments, no nothing whatsoever, just a cleanlooking model (they shall never know the truth :))
  • Neox
    Offline / Send Message
    Neox veteran polycounter
    how do these models LOD? that would also be one of my concerns, i guess spending another hour or two just to clean up the low should be worth it.
  • drooms
    Offline / Send Message
    drooms polycounter lvl 3
    Neox said:
    how do these models LOD? that would also be one of my concerns, i guess spending another hour or two just to clean up the low should be worth it.
    Thats a really good question; I didnt really think about it while modelling, but after throwing this mesh into unreal, I can't really see any issues. It keeps its silhuette pretty well in my opinion, and shading doesnt go bad shit crazy either (LODs are autogenerated by unreal). It's size is a bit off ofc ^^
    Edit: I fully agree though, if this is for a production pipeline, you'd want a cleaner mesh. this was generally to show what you can do, and how you can do it, and I have stated that triangulating isn't always the smartest idea; if you really wanna go nuts with the mesh, it is big or you need it to deform (f.e. rubber parts), clean it up. you won't get results that will proficiently work with just triangulating it.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    So many extra steps for something that can be done in polys and booleans from the start in a single program without the hassle of CAD data.

    Nice result, though, and good of you to share. There was a pretty much identical thread here recently with the same workflow breakdown, with the MOI step included. We can never have too many hard-surface workflows. :)


  • sacboi
    Offline / Send Message
    sacboi high dynamic range

    ^ Agreed.

    Though all the same nice share, always good to see what other people are up too.

  • Shrike
    Offline / Send Message
    Shrike interpolator
    If we are talking about new workflows
    Here is my workflow with the distance field volume builder in C4D, its non destructive and extremely powerful but also gets very laggy
    Not sure if other software also have something similar that could be used that way

    My highpolies are basically 95% of my lowpolies which saves tons of work and really offers a new dimension

    but can also be used to make pure highpolies. You basically press a button and voxelize your lowpoly model stack to a highpoly:



    Here is a test bake, I just made some crazy dirty boolean and auto UV + smoothing groups

     
    (of course the subtracted pattern is a bit too deep for a flat surface bake with no supporting geo)

    can be hacky as dirt, still works. As its potentially non destructive I could just turn down the cylinder subdivision etc but didnt bother here

    You can also add surface deformers with noise, which I use for surface details without sculpting, applies it evenly across the surface
    This detail is all made with layered noises non destructively, and it really affects the geometry, not just planar surfaces:


    (Final Baked Lowpoly model, the highpoly of that is the exact same geo, just includes some extra bolts)

    Here some better example:
    Highpoly Geo (Yes, thats the highpoly): https://hostr.co/OZNcM26KHG2x
    Voxelized the thing: https://hostr.co/92xuL1TNMBLm
    Final Bake (removed some unnecessary geo like bolts): https://hostr.co/zDyt5RMKv3lU

    The downside it that it can get very laggy and you have to wait for it to process on larger models which can be frustrating,
    and as it by nature, melts all meshes together for the cool smooth transistions, you have to seperate things you do not want to meld,
    and tiny objects and lines do get eaten by the smoothing 

  • Shrike
    Offline / Send Message
    Shrike interpolator
    I think ideally you want to just do a optimized lowpoly and get a good highpoly from that
    (if we care mostly about efficiency, which is my standpoint, I need to do a lot of stuff in short time, so I make things to diminishing return)

    Im not sure If I am a big fan of making the highpoly first and trying to get a lowpoly from that

    What you surely can do in other software is a lowpoly > hard edge subdivision (set subdivision hard edges by angle) > highpoly workflow
    That way I barely ever do manual edge loops for anything




    If you can control subdivision hard edges in your software, you can basically convert any type of final lowpoly into a decent highpoly or near perfect base to sculpt from



    What I also find very powerful as written by Drooms here in the thread is the abusing N-Gons



    Everyone knows you can't subdivide or bevel this boolean mess
    Lets say this is our final lowpoly because we are lazy and we want to get a highpoly


    There are surely features to not create the triangulation in booleans in most software so you get this:



    From this point you can maybe remove some error areas (the points at the bottom here) then allow using of Bevel modifiers or chamfer, which then stabilize the geo, (bevel & chamfer slide along the the supporting geometry, as this does not exist here, they do slide perfectly even) so you can do a perfect bevel or chamfer for a subdivision, for an super easy highpoly




    With these things I barely find myself doing any traditional subdivision work anymore but I'm not doing the most complex things on the other hand

    But if we think about it:
    Lowpolies: Need to be perfect, little margin of error, UVs matter, geo matters
    Highpolies: Just needs to look right, high margin of error, nothing really matters, imperfections sometimes are good

    So logically, Lowpolies are the things one should design, and highpolies the things one should be able to generate easily, if we look towards the future. If you go with that approach, you'll also only model things with your lowpoly in mind and that translates directly and well to your highpoly (but maybe some more unique shapes are avoided).

    But always depends on what you do, I need to crunch out tons of optimized "good enough" assets for a game while doing 4 other company jobs and don't have the luxury of spending all day on art, so its clearly biased towards my use case


  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter
    The distance field volume stuff is effectively the same as dynamesh.  You can also do it in houdini and (believe it or not) simplygon.

    It's a great way to handle shitty intersecting geometry and in houdini the resulting volume can be processed to give you nice tidy fillets etc. before being meshed.  


  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    I've recently gone from my long-time method of creating the final asset, first and foremost, and using chamfer mod/turbosmooth in Max, to creating the final asset and just self-baking the bevel shader to it in Blender. I don't even need a high poly anymore. Floaters/detailing/damage passes all in Substance Painter.

    Also, the Pablo Dobarro sculpting branch of Blender now has Voxel Remeshing.
  • Udjani
    Offline / Send Message
    Udjani interpolator
    The dynamesh like thing can be done in blender too without the Pablo branch, but is not as good performance wise. (6m tri for this)

    @musashidan man you don't have a tutorial on how to bake the bevel shader with hard edges in the lowpoly?, i can't get that thing right.
  • musashidan
    Offline / Send Message
    musashidan high dynamic range
    @Udjani No, but I'm definitely going to make one soon. Baking Bevel Shader is actually so simple and gives great results.

    Also, just tried the Open VDB addon in 2.80. Very nice implementation. The dev mentions that it's coming to 2.80 natively soon.
  • drooms
    Offline / Send Message
    drooms polycounter lvl 3
    ^ This stuff is incredibly interesting, did not know that cinema 4D is able to do that. Started out in it years ago but never found it incredibly helpful for modelling (as f.e. maya or 3ds max), this definitely tells me the opposite. Especially with the noise, it would eradicate the step through f.e. a program like Zbrush for the damage pass.
    So many extra steps for something that can be done in polys and booleans from the start in a single program without the hassle of CAD data.

    Nice result, though, and good of you to share. There was a pretty much identical thread here recently with the same workflow breakdown, with the MOI step included. We can never have too many hard-surface workflows. :)


    Aye, it is a lot of steps, but they are all very quick. I get an accurate lowpoly with a somewhat minimal polycount very easily, with the meshes already good for importing it into a game, and I don't have to fix any boolean geometry errors. I believe even with fixing the mesh correctly, adding support loops etc. to the lowpoly to get a nicer topology, it would still be faster then creating a complex boolean-ed mesh inside of any poly modelling software, and as I said, I don't have the daily fight with uv morphing or stretching. 

Sign In or Register to comment.