Quick LOD tutorial
Edward Peretti

I planned on writting this when I finished my model. I sent it off to JKII.net incase they wanted it to go in the tutorials section. I thought it might be useful to all those work in progress models.

This tutorial is intended for people who have already experienced building a player model for jk2 (basicaly common knowledge of 3dsmax).
I noticed that alot of the player models don't have LODs. I guess there is a feeling of dread when it comes to this stage. Though it isn't as hellish a task as you may think. Here is a brief explination on the stages I took:

First you'll need to download and install this plugin:


And this script:


Ok, now you'll have to start naming selections.

Select all model parts, including caps, and name this selection in the selection dropdown list "model". Select all tags and name the selection "tags". Select all the bones and name the selection to...guess what..."bones"! It's also a good idea to select all the facial bones and make a seperate selection "facial bones".

Now hide everything and select from the selection dropdown list "mesh" and "tags". Once you unhide them, select them all and make a copy (shift+click using the move tool).

Now select "mesh" and hide, select "tags" and hide. You are left with a weighted copy of the mesh and tags. Now run the script "re-namer2.ms" I won't explain how to use it because it's such a simple script! The script lets you add the essential _1, _2, _3 extensions for the LODs. At the same time it also alows you you erase duplicate auto naming, eg. arm01, get rid of the 01 and add _1, catch my drift? You will when you learn how to use this script. It's a real work saver! Select all your duplicate mesh/tags at once and use the script to sort out the rest.

1 second later everything is re-named

Now you want to start with the level of detail for the mesh. The way I do it is to preserve the caps (all the border vertices of each segmented part)

Now we use polychop!

Basicaly add this modifier above edit mesh and below skin. You may need to select the border/cap vertices in subobject mode and go up the stack to polychop and select "lockdown selected vertices". Polychop has a "lockdown border vertices" selection, but I find manually selecting the vertices is best. This plugin does a great job, but can be a little sloppy in areas, so you may want to add an edit mesh modifier abouve that to fix up areas. It preserves the mapping co-ordinates, but if you edit the model manualy after polychop, you may need to sort them out with uvw unwrap. Remember to keep everything below the skin modifier. This stage takes alot of getting used to the plugin and the technique, so I'm being real brief on the explination here.

Once you have your lowered model, the only concern is to whether the skin settings have been messed a little. I found that animating the pelvis bone far left or right, vertices and even bodyparts would stick. If this is the case try this:

for parts that remain stationary when the skeleton moves left or right in your simple animation, collapse to the stack of the part under skin modifier so you get editmesh and skin in the stack. Turn on sub-object/vertice mode, click off any selected vertices and turn off sub-object mode. Your part should snap into animated position.

For stray vertices, this is usually a skin problem. Just go into skin > sub-object mode and select the vertices and re-weight them. They should also snap back into position.

Remember to check the skining on the border vertices making sure they are at 1.0. Any face weights can kiss it goodbye! They will most likely be messed up and if like me they were to much of a pain to weight in the first place, they're not worth re-weighting for LODs. So just 1.0 the face weights to the cranium.

Repeat the stages for the other LODs. Remember to use name the selections with each one "mesh1" "tags1" etc. and make each LOD down from the previous one.

This is all roughly out of my head so please don't email me any problem questions. It's all trial and error with the stages. If something's wrong in carcass than it could mean you've missed somthing out. If you're precise with everything then it should all be dandy!

Good Luck!

This is a transcript from the Lucas forum thread by Edward Peretti: http://www.lucasforums.com/showthread.php?s=&threadid=87796


Ok so in theory it is exactly what Edward described, but in reality you might run into a few problems. The auto optimizer tool will most likely destroy some of your verts influence.

My method is pretty easy, what you want to do is create 3 different scenes in which you will be able to work independantly.

Dont forget to use the selection rollout for the various components of your model (tags, bones, mesh...etc.) once that's done you can begin.

First step is to save your final model (capped and fully ready to appear in game) save your model to a new scene let's say your default file name is LOD0.max (which is the highest lod for your model) go ahead and save that scene as LOD1.max so now you are working on a separate max file, which make things a lot easier and will preserve your weighting. Use the polychop modifier (or do it manually) to reduce the complexity of the model (lower the polycount...) first LOD should be about 60% of the original...

Unfortunately if you used manual weighting instead of enveloppes, you'll be pissed: everytime you will collapse verts to optimize, you will need to re-assign the resulting vert's weight manually.

Once optimized (or before, doesnt matter) use the renamer script:  http://www.chuggnut.com/scripts/re-namer2.zip

(note that newer versions of 3D Studio Max are now equipped with a renamer tool)

Rename all the components with a _1 even the SKELETON, meshroot, model root: everything!,  so you've just created LOD1, save your scene!.

Step 2, start with the previous saved scene and save it as LOD2.max, optimize about 60%, rename everything with a _2 and save...repeat process for other LODs.

The final step: load your original scene LOD0.max and merge LOD1.max. Now the selection rollout will come in handy, select your original skeleton (the one who doesnt have the _1 on every bone) HIDE it, dont delete it!...so you will be left with only the merged _1 skeleton visible, double click the pelvis of the _1 skeleton and go to the renamer, remove the _1...you now have an exact double of your original skeleton and it should have kept the original weighting info. I say should have cuz i only tried it with and un-optimized version of my model and it compiled fine and LOD 1 is available in modview and is weighted perfectly (just not optimized). Just repeat the process with LOD2.max scene LOD3...etc.

I find this method a lot cleaner, you dont have to worry about messing something up, and if something is screwed, you can always go back to the other individual files to fix the problem.

It is possible to simply clone body parts and rename them (they will keep their weight info) so that way you dont need 3 skeletons, they will remain linked to the original skeleton. Use the selection rollout to hide LOD stages and should be a piece of cake...yeah right!

Another possibility is to not rename the skeleton (only the meshes) when asked to merge into the highest LOD, max will see the duplicate skeleton and automatically assign the meshes to corresponding bones in the current scene.

Some more info about LODs and how the extra sets are weighted...
(thanx to shubes and Anakin)

- If you have LODs then you must make sure that the each mesh in the highest LOD is represented somehow in the lower LODs with the same name only with a "_*" suffix where * is the number of the LOD or number of iteration. So for example: "Stupidpouch" is a separate piece on the highest LOD, in the next LOD down it is named "Stupidpouch_1", and "Stupidpouch_2", and so on. Even if this piece becomes insignificant at the lowest LOD to the point where it is simply not needed because it won't be seen at that distance, it still needs to be represented in the lowest LOD as a single poly triangle at the very least.

- You can always drop out deformers as you go down the LOD hierarchy but you can not add them back into a lower LOD if you have already dropped them from a LOD previous and you can never introduce a bone of influence that the mesh on the highest LOD didn't have included as a deformer. So for example: let's say Stupidpouch is deformed by pelvis, femurX, and femurYZ. Stupidpouch_1 can drop a deformer so that it is only deformed by pelvis and femurX and Stupidpouch_2 may be deformed only by pelvis (or only by femurX) but you couldn't have Stupidpouch_2 be deformed by the same deformers as the highest LOD[0] if you dropped one or more of them at LOD1. And you couldn't have LOD1, LOD2, etc. be deformed also by lower lumbar unless it too was included in the highest LOD[0].

Edward Perretti, Psyk0Sith , Shubes & Anakin