Explore some of the best practices for preparing models that are going to come into Stingray.
- [Instructor] Whether your models are coming from 3ds Max, or Revet, or some other modeling application, they all need to take into account some of the same principles of creating 3D datasets that are used in game engines. Everything that happens in a game engine, happens in real time. What's rendered to the screen is being rendered to the screen as it's being seen by the person who's interacting with it. It's a user-driven experience. So, the models need to accommodate this type of on-the-fly processing.
Generally speaking, that means low polygon counts and efficient textures. Let's go ahead and dive in and take a closer look at geometry, first. For this task, we'll be using 3ds Max. At this point, you should have installed the exercise files onto the C drive or any other local drive of your machine. Before we can do anything in 3ds Max, we actually have to set up the project directory, so that 3ds Max can properly find all of the files that we'll going to be using during this course.
To do that, it's very simple. We look for a series of buttons at the top of the interface, and we're looking for the Set Project button. Once we click on that, we can actually browse to the directory where we have the exercise files. In this case, I put it on my C drive, Exercise Files, MaxProject, and you'll see all the folders that contain all of the assets that we're going to be using for this course. So, just go ahead and make sure that the MaxProject folder is selected, and say OK. Now, when you go to open a file, it will automatically default to that location.
Now, when we click File Open, you'll be able to see all the files that we're going to be using for the duration of the course. In the event that you get any errors upon loading any of the Max files, such as missing texture maps, make sure that you've gone through and actually set this project folder, otherwise, all of the texture map files in these Max files won't be located properly. We're going to be looking at a couple of different files in 3ds Max. The first one is chapter 02_01, sofa, unconverted.
So, now that I have our file loaded, we're going to be taking a look at some of the typical geometry issues that people will run into when they're dealing with geometry that's coming from other applications, or, maybe, from people who aren't used to really working with game engines. The big thing about game engines is you want to have as few polygons as possible, but you don't want to have too few polygons, so that the geometry looks clunky and noT very well made. So, let's take a look at a couple of things that are commonly used to smooth out geometry when you're rendering objects, but aren't really good to be used in game engines, 'cause it just adds a ton of geometry, and that's the use of TurboSmooth and OpenSubdiv.
We can see here, if I hit the F4 key, we can see our geometry in smoothed and edge-faced mode, and we get a good look at what the surface topology looks like. If we come over here to this blanket and zoom in, we can see it's filled with a crazy amount of polygons in here; that's really indicative of a cloth simulation. If we look at TurboSmooth and OpenSubdiv, either one of these things can be added to smooth things out, but they don't really work well for game engines.
I'm going to hit the 7 key on the keyboard, and it's going to show my viewport statistics over here, and I'm going to show you the impact of both of these types of subdivision modifiers. Now, you might be thinking, well, why use a subdivision modifier at all? Because you still might want to have rounded-over topology, and you still might want the benefit of getting some of that smooth-looking surface out of it. Each one of these modifiers brings a different advantage to the scene. The first one is TurboSmooth.
This is probably the one you're used to working with the most, because it's been around the longest, and it's a real simple modifier that just adds a ton of geometry with each iteration. Now, we would never actually have geometry this detailed in a scene, but there might be a time where we want a lot of detailed geometry on something like a corner. In the past, a lot of people would probably go right to TurboSmooth to do this, but the downside to TurboSmooth is it adds a lot of extra geometry in the interior portions of the objects.
If you turn on isoline display, it actually hides all of the extra geometry, and makes it look like the objects are more simplified than they really are. The way we can really tell what's going on with the geometry is looking over here in the upper left-hand corner at the statistics. So, with isoline display off, we can actually see all of the surface topology that's being created in conjunction with the polygon counts of the selected object over here. Let me go ahead and turn off TurboSmooth, and you can see that it drops it down significantly in the polygon count.
Now, let's take a look at OpenSubdiv. OpenSubdiv is a relatively new modifier, compared to TurboSmooth, and it does things a little differently. I'm going to go ahead and select the OpenSubdiv modifier; I'm going to turn off TurboSmooth; and I'm going to turn on OpenSubdiv; and we can see that it kind of looks very similar. If I turn on isoline display, it actually hides all of the extra topology, but if you take a look at our polygon counts, they're significantly different. So, the advantage of using OpenSubdiv is it gives you the ability to get rounded-over corner geometry without adding all of the supporting geometry in the center of the objects.
And if I just do a real simple toggle of these two modifiers, you can see the difference of the impact in the scene. So, OpenSubdiv increases our total polygon count to just over 300,000, whereas TurboSmooth increases it to almost 350,000 polygons. So, you can see that OpenSubdiv is the much better way to go, if you have to have a subdivision modifier for whatever reason. So, why have a subdivision modifier at all? Well, it all depends on how much data is going to be in your scene.
If you're doing a huge city layout, maybe you're doing a large site plan, something with a lot of pieces of geometry, and you're looking over a large distance in, say, an exterior shot, you're probably not going to want to use any subdivision at all. But, if you're doing an interior scene, or maybe a scene that has a very constrained field of view, and you're going to be looking at geometry up close, you probably want to consider using a subdivision modifier, but being very deliberate in the way that you use it. Let's focus in on this blanket.
Now, this blanket is the exact opposite of what we're looking for. There is a ton of geometry in here, and although it looks really great, it's just not practical to have this much data in a game engine. I can tell that it was used in a cloth simulation, because everything is a triangle. That's how this data came about. How can I possibly reduce all of this geometry? We're going to take a look at a modifier that'll really help you with that. Now, it's important to understand that, once we zoom in, we can see that our texture is still on here.
A lot of times when you're going to be adjusting geometry, and you make geometric or deestructive edits to the surface topology, you can actually ruin the texturing. We don't want that to happen here, because we don't want to have to go in and reapply all of our textures. So, we're going to add a modifier called ProOptimizer. I'll select the throw, and go to the modify command panel, and, in my drop-down menu, I'm looking for the ProOptimizer modifier. So, before we start crunching our geometry, we want to make sure that we check the Keep Textures check box.
We don't want to destroy our textures and then have to fix them later. Once you've got that set up, we're going to go ahead and click Calculate, and what this does is this goes in and calculates all of the different parts of the geometry, the vertex count, the vertex locations, and things like that, and lets us actually make intelligent decisions about how we want to reduce this geometry. To reduce the geometry, all we have to do is adjust the Vertex % or the Vertex Count. I like to use percent, just because it's easier. I'm going to start reducing the Vertex % value, and I can immediately see changes in my geometry.
I'm going to hold down the control key, and that'll accelerate the change in the Vertex %. And we have to be careful, because if we take it too far, our geometry is going to completely disappear, and is obviously going to be useless. If we make it too low, we're going to start to see interpenetrations with the geometry that's underneath it, as you can see it here. The nice thing about it is, since it's a modifier, and it's a parameter, we can adjust it and change it and get it to be exactly what we want it to look like. So there, I've reduced the vertex count to around 8%, and if I rotate around, I'm just doublechecking for any interpenetrations from the geometry underneath, and I think we have a pretty usable piece of geometry.
The important thing is that it's maintained the textures, so that it'll look great when we take it into the game engine.
- Creating a new project
- Using templates
- Preparing assets in 3ds Max
- Importing 3D assets
- Connecting to 3ds Max via Live Link
- Working with environments
- Adding visual effects, lighting, and reflections
- Using Flow nodes for materials and animation
- Deploying Stingray projects