Kitty Corp Meow Mix Forums

Help & Tutorials => Model Tutorials => Topic started by: Segab on October 21, 2012, 07:18:32 PM



Title: How to properly optimize your model (3dsmax)
Post by: Segab on October 21, 2012, 07:18:32 PM
INTRODUCTION

Modeling for a film is very different from modeling for a video game. Games are rendered live as the player moves, while films are pre-rendered.
Depending on which engine and on which console you're working on, your video game oriented model will have to save on polygon count.

When you're importing a model from another game into Brawl, sometimes it's going to have too many polygons for the Wii to handle. Even some models from Wii games will have trouble on Brawl because the games are using different engines.

If you modeled your character yourself, you might still have this problem because you put too much detail in your clothes or face for example.

The solution: optimization.

Mario's Brawl model (including the FLUDD) is 6207 polygons, so try to stay around 6k polys.


BEFORE STARTING

I'll start with Flygon's Oak model (click on the thumbnails to see them bigger)
(http://i.imgur.com/YOtiNs.jpg) (http://i.imgur.com/YOtiN.jpg)

Check the polycount
So first of, you need to check if your character needs optimization.
You can check that by pressing 7:
(http://i.imgur.com/ELKxJ.jpg)
Look at the "Polys" line. That's nearly 3 times as many polygons as the suggested 6k.

Now you want to know where the polycount went wrong.
Press F4.
(http://i.imgur.com/T0fI2s.jpg) (http://i.imgur.com/T0fI2.jpg)
The model clearly has too many polygons on the head and foot.
Look at the amount of polygons there are on the legs, that's just enough to be believable in-game. That's what you're aiming for.

Keeping your rig [optional/situational]
If you've already rigged and you don't want to lose your rig while optimizing, you have do this:
To keep your rig while optimizing, make sure your model is in T-stance (not one foot in the air or something)
then click on the Skin modifier, and scroll down to the Advanced Parameters:
(http://i.imgur.com/LhMy3.jpg)
and uncheck Always Deform

Collapsing the model [optional/situational]
If your model isn’t one big mesh, you'll have to make sure that there’s no modifiers left except Skin.
(http://i.imgur.com/rFDK0.jpg)

PREPARING THE MODEL

Turning into an Editable Poly
The way I optimize you have to be in Editable Poly mode, not in Editable Mesh.
Open the Spoiler if it's an Editable Mesh.
If you haven't rigged yet, good, it's super easy. Right click on Editable Mesh and select this:
(http://i.imgur.com/ToIMc.jpg)
Done!

If you've already rigged, you'll have the Skin modifier so you can't do that.
Make sure "Always deform" is unchecked, like I said before.
Then do this:
(http://i.imgur.com/JRjbM.jpg)

Merging useless vertices
Sometimes it's because you didn't notice, sometimes it's because the model imported smoothing groups in an odd way, but you might have hundreds of polygons that add nothing to the model but weight.
For example, those vertices should move together, but for some reason you can move them separately.
(http://i.imgur.com/TCe2zl.jpg) (http://i.imgur.com/TCe2z.jpg)

To fix this, follow these steps.
Do this even if you don't see anything wrong with your model.
Click on Editable Poly and click Yes if a window pops up. Then this:
(http://i.imgur.com/TMaer.jpg)


MANUALLY OPTIMIZING THE MODEL

Why not ProOptimizer?
When I say manually, I mean we're not going to use the ProOptimizer thingy. That's the lazy way out and it's risky because you barely have any control on how it optimizes your model.

However, if you had trouble using ProOptimizer before, try using it now that you've done all the steps above. I guess it's better than nothing.

For example, the sandal on the left is the one I've optimized using ProOptimizer. On the right is the high-poly one.
(http://i.imgur.com/jpeG5l.jpg) (http://i.imgur.com/jpeG5.jpg)
It went from 578 polys to 148 polys, but look at how uneven the faces are. If this is ugly right now, imagine how it will be when rigged and animated.

Snapping vertices
When you're optimizing a model, you're merging vertices with eachother to make less polygons.
To start moving the vertices around, you need to activate snapping by pressing S on the keyboard or by clicking this:
(http://i.imgur.com/qXKVE.jpg)

Then you need to figure out which vertices you're going to get rid of. Let's start with these edges.
(http://i.imgur.com/Vt6Rms.jpg) (http://i.imgur.com/Vt6Rm.jpg)

To do that, you'll drag and drop a vertex you want to get rid of onto the closest vertex you want to keep.
(http://i.imgur.com/u7PdKs.jpg) (http://i.imgur.com/u7PdK.jpg)

I did that for the sandal. Half of the vertical lines are gone now, but the shading is all weird.
(http://i.imgur.com/eUQnns.jpg) (http://i.imgur.com/eUQnn.jpg)
That's because they're not welded yet. The polycount hasn't decreased yet.

Weld the vertices like we did before (http://i.imgur.com/TMaer.jpg).
(http://i.imgur.com/xEITIs.jpg) (http://i.imgur.com/xEITI.jpg)
That fixed the shading and we got rid of 102 polygons.

Now let's do the same for horizontal lines.
(http://i.imgur.com/HvPjSs.jpg) (http://i.imgur.com/HvPjS.jpg)
After welding we got rid of 134 more polygons.
(http://i.imgur.com/m9f4Gs.jpg) (http://i.imgur.com/m9f4G.jpg)

Finishing the optimization

Once you have a reasonable polygon count, you'll have to do some final steps before exporting.
First, go out of vertex mode:
(http://i.imgur.com/rBUeL.png)

If your model was already rigged, Go back in the Skin modifier and check Always Deform
(http://i.imgur.com/sOMFJ.png)

If the texture is a little bit distorted, you can try to fix the UV with an Unwrap UVW modifier.



TIPS

Alt+X to make the model transparent. Useful to see if some faces could be deleted because you'll never see them.
Right click > Hide selection. If your model is separated into a few sub-models, you can hide the ones that get in the way. Undo that with Right click > Unhide all.
If you want advanced techniques on how to optimize a model, look up Valve's LOD tutorial (https://developer.valvesoftware.com/wiki/Level_of_detail).


CONCLUSION

I've only optimized one sandal but you get the idea. If you do that for the whole model, you'll have under 6k polygons and your model will work in Brawl.
This technique will keep your smoothing groups, texture coordinates, and rigs.
It's long and annoying but in the end the results are worth it.


Title: Re: How to properly optimize your model (3dsmax)
Post by: Pervyman Trigger on October 21, 2012, 07:26:30 PM
the only reason I've used prooptimizer and never tried manual was uv's, but you say they'll stay using this o-o Awesome, glad ya made this. It's gonna be very helpful


Title: Re: How to properly optimize your model (3dsmax)
Post by: Exorcist on October 21, 2012, 07:37:00 PM
Seems hard but I'll have to do this when I make Shepard v.2. The pro-optimizer really ruined his shoulders. :X

Thanks a bunch!


Title: Re: How to properly optimize your model (3dsmax)
Post by: Flygon on October 21, 2012, 07:45:06 PM
Thank you, this is really helpfull because now I can have a low file size without having to kill the texture quality.


Title: Re: How to properly optimize your model (3dsmax)
Post by: Iwvi on October 21, 2012, 08:19:38 PM
Good tips here. Just one question, instead of moving the vertex close and welding them, can we just use the target weld function? It does both things on one step. I'm not sure if it has disadvenajes though.


Title: Re: How to properly optimize your model (3dsmax)
Post by: Segab on October 21, 2012, 09:57:01 PM
Good tips here. Just one question, instead of moving the vertex close and welding them, can we just use the target weld function? It does both things on one step. I'm not sure if it has disadvenajes though.
I just prefer to do that because if I mess up, the vertices are still not welded, so I can fix them without having to ctrl+z or reload an old save.
It's also easier to toggle the Snap on and off with S than toggling Target Weld with the button on the sidebar.
And when you Weld them all at once, you can see directly how many polygons you saved, while Target Weld will reduce the number of polygons after every single weld.

So basically it's just a matter of preferences.


Title: Re: How to properly optimize your model (3dsmax)
Post by: Iwvi on October 21, 2012, 10:42:08 PM
True, I think this one is better, tried it out and it lets you plan the optimizing better instead of just doing it on the fly. Target weld could be used the same way but  sometimes I forget where I weld stuff  :P


Title: Re: How to properly optimize your model (3dsmax)
Post by: pikazz on October 22, 2012, 04:37:37 AM
a good tip for looking after vertices points who aren't weld is to use the "thing" between "Edge" and "Polygon" selection (forgot the name), if you select the whole model it will turn red on the edges who has the Vertices points not Welded


Title: Re: How to properly optimize your model (3dsmax)
Post by: Eternal Yoshi on November 10, 2012, 11:27:58 AM
This is an excellent tutorial, but there is an elephant in the room that must be addressed.

While Mario's model + Fludd is 6207 polygons, there are many Brawl characters that have much more than that. The reason for that is that their facial expressions make up half or more of their total Poly count. Here's some examples.
Code:
Character  \ Total  \ All Facial Expressions(Excluding Hair and Eyes, but including mouths)

Marth      \  11,197\ 5,310
Snake      \  11,357\ 7,032
Ike        \  11,983\ 6,132
Samus      \**11,064\ N/A
Zamus      \  11,787\ 8,160
Sonic      \**12,310\ 7,354
Yoshi      \ **7,010\ N/A
Popo       \   4,610\ *72
Nana       \   4,628\ See: Popo
MetaKnight \ **6,862\ N/A
Fox        \**10,154\ 5,080

* These characters use only textures for expressions, with each face having a plane on the character's face.
** These characters Poly count includes things like Egg, Spheres, or whatever is attached to the character's mdl0.

Characters like Mario, Popo, and Nana have different objects for their facial expressions, but only their eyes change. The higher poly characters such as Marth and Snake have entirely separately drawn faces altogether for their facial expressions.

Basically, I'd recommend making a scene for the character you're porting over to check their poly count, and not exceeding the original character's poly count by over 1000 Polys.


Title: Re: How to properly optimize your model (3dsmax)
Post by: jrush64 on November 18, 2012, 04:38:03 AM
@Segab, I think i love you.

With this technique, I shaved 8000 vertices of Nero's Jacket and It still looks [censored]ing HQ.


Title: Re: How to properly optimize your model (3dsmax)
Post by: DJ Lowgey on February 24, 2013, 03:14:07 PM
can´t get into the Snapping vertices menu thing :(
it dont work for me. can´t combine faces


Title: Re: How to properly optimize your model (3dsmax)
Post by: RAWRzilla on July 10, 2013, 01:51:44 PM
So if I want to import one of my Pokeball pokemon imports and take down the poly count without losing the Pokepark rig (so I can keep the animations I worked so hard to do) would that be considered difficult/tedious? I am willing to do it, but not if its going to take me a month.


Title: Re: How to properly optimize your model (3dsmax)
Post by: Iwvi on July 10, 2013, 07:56:21 PM
So if I want to import one of my Pokeball pokemon imports and take down the poly count without losing the Pokepark rig (so I can keep the animations I worked so hard to do) would that be considered difficult/tedious? I am willing to do it, but not if its going to take me a month.
You could, I don't think it should be too difficult. It depends on the model and your patience. It can get tedious though, since it is a kind of repetitive process. But if you are not working with incredibly high poly models then it shouldn't be too hard.


Title: Re: How to properly optimize your model (3dsmax)
Post by: RAWRzilla on July 12, 2013, 02:06:45 PM
I was hoping I could check how many faces the original pokeball pokemon had (Entei, Deoxys, take your pick) and then optimize the new model to have at least that many, and then re-import.


Title: Re: How to properly optimize your model (3dsmax)
Post by: GentlemanPotato on July 12, 2013, 05:48:07 PM
You can check how many faces they have in BrawlBox then make it less than that amount.


Title: Re: How to properly optimize your model (3dsmax)
Post by: RAWRzilla on July 17, 2013, 04:06:45 PM
So I gave it a try and took down Chandelure's model from about 1744 faces to 900. Took me all of 10 minutes once I figured out what I was doing. Although I managed to reimport it well, and the animations work, I have some concerns.

Disclaimer, I am a complete model importing noob. I just took about 15 minutes to figure it all out, so I have ZERO experience with this. That being said:

In animations, it seems blobby and disproportionate, and the specular maps (for glass effects and whatnot) do not work well anymore. I do not know how to import them to the model correctly in 3DS Max. My guess is that they do not function like regular textures, correct?

How Brawlbox handles the original model
(http://i5.photobucket.com/albums/y194/darkplasma22/Brawl%20Textures/Orig_zps6222b9ab.jpg)

How Brawlbox handles my edited, reimported model
(http://i5.photobucket.com/albums/y194/darkplasma22/Brawl%20Textures/Mine_zpsce5a648f.jpg)

How the model appears during animations
(http://i5.photobucket.com/albums/y194/darkplasma22/Brawl%20Textures/Animation_zpsb97add99.jpg)

It goes without saying that I've done something wrong, but the "what", "where" and "how" is completely lost on me. I want to re-release all my pokemon models so people can properly enjoy them, but I do NOT want to learn the entire universe of model importing, rigging and etc just to do that. Can somebody here help me? A point in the right direction?


Title: Re: How to properly optimize your model (3dsmax)
Post by: Iwvi on July 17, 2013, 08:18:41 PM
To RawrZilla.

The weird way it looks now is caused, more likely, by normals(They control how light affects the object). Are you using the latest brawlbox? does it look ok in Max?

For the animation thing. You'r optimizing most likely screwed the rig. You can fix it using skinwrap. These two tutorials explain the basics of skinwrap, it is not complicated at all.
Perfect Auto-Rig Guide (http://forums.kc-mm.com/index.php?topic=59059.0)
   
Skin Wrap, save time when adding objects (http://forums.kc-mm.com/index.php?topic=47138.0)

For the spec maps and stuff. They were lost when importing it back into max and into brawlbox. They can be easily fixed by replacing the materials with the ones of the original model (in brawlbox).


Title: Re: How to properly optimize your model (3dsmax)
Post by: RAWRzilla on July 18, 2013, 06:15:20 AM
I'm going to try all that, and yes, I am using the latest brawlbox and everything seems fine in Max.

When I am dragging textures to the model in Max, should I just forget adding the specular maps and all that, and just reimport the materials when I'm re-importing?


Title: Re: How to properly optimize your model (3dsmax)
Post by: Iwvi on July 18, 2013, 12:03:50 PM
Yes, all material stuff is done in brawlbox. The lighting problems are odd considering nothing it looks fine in max.


Title: Re: How to properly optimize your model (3dsmax)
Post by: RAWRzilla on July 18, 2013, 01:23:55 PM
Thats because I made the mistake of adding the speculars in Max. When I redo it (right now as a matter of fact) I will only include the textures.

Edit: I'm getting frustrated because I dont know how to do simple things like select pieces of the model, and edit those only. It seems to me that there isnt any way I'm accomplishing this without learning 3DS Max, which I really dont have the time to do. I guess I'm giving up.

REEDIT: If some kind soul wants to take the time to make a step-by-step for me, I will take the time to optimize and re-release all 32+ Pokemon models I did, including a few I wasnt able to do due to file size. As I have said, I feel this is a lot simpler than I know, but I feel like learning the ins and outs of 3DS Max us beyond me at the moment.

I'll even open up a thread and take requests.

Lv.4EDITINGPOWERS: So yeah. I found an automatic script that lets you reduce LOD by percentages automatically, and does a brilliant job with it too.
http://forum.unity3d.com/threads/130913-3ds-Max-Automatic-Level-of-Detail-Max-Script (http://forum.unity3d.com/threads/130913-3ds-Max-Automatic-Level-of-Detail-Max-Script)!
I reduce the polygons complexity by percentages, and if I dont like the result, I undo and chose a different percentage. When I am satisfied with the LOD, I delete the original polygon.

Took Chandelure from 1734 to 781 with no grand deformity to the model! Best of all, if you uncheck deform, it will keep normals! As to the rig, Ive yet to test that.

Edit5yeah: Somebody take a whack at it, please. My brain hurts. http://www.mediafire.com/download/zc34c16bcbdjw5c/Chandelure-Entei.zip (http://www.mediafire.com/download/zc34c16bcbdjw5c/Chandelure-Entei.zip)



Title: Re: How to properly optimize your model (3dsmax)
Post by: Linnom on October 17, 2013, 10:10:54 AM
There's some models in this site that i want to edit but i´m new in this kind of stuff, what should i do? Export the model in dae. format, load in 3ds max, reduce the poly count, rig it again? Someone experient help me!