When modifying the Bohemia Sample models, you may find the base model, or your modified model end up with very high section counts.
This affects performance adversely for every instance of the object. So for even a small object like a wall or a tree or a bush that is repeated many times througout a terrain; it is VERY important to optimize models.
For highly modified models you can end up with needlessly high section counts, which are tedious but simple enough to rectify.
I want to give a special thanks to RKSL-Rock for advising M1lkm8n on how to accomplish this, as well as Snakeman of PMC Tactical for also providing relevant info and advice! and OBVIOUSLY to M1lkm8n for passing it on to me!
Models can and should be optimized in MANY ways when being created from scratch, however this tutorial only focuses on correcting problems that can happen when forward porting, or editing, an existing BI model.
I am making this tutorial mainly due to the lack of readily referenceable material regarding section counts in modelling for arma or in general. I am by no means an expert in the field, nor do I have a solid fundamental background in 3d modelling or texturing.
I. A quick primer
Models in O2 and all modelling software are made up of 3 components:
1. Points - Fairly clear, it's a dot somewhere in the 3d space of modelling software. In design based 3d software like AutoCad this can literally be a list of xyz coordinates entered in sequence.
2. Faces - Faces are a planes that connect any 3 to 4 points to create a solid surface, on which textures, materials, or shaders may be applied
3. Sections - a section is an collection of connected faces that all use a common texture, or material
In the normal resolution lods, the model is UV unwrapped and textures are mapped to that "section" of the UVmap. The section count is a direct result of the number of unique textures + the number of different RVMats for any texture.
Also worthy of note, is that the SAME texture can exist in multiple namespaces, so it's VERY important to ensure textures are being pathed to the same namespace when applying them initially, or during the modelling process.
II. Why are sections bad?
1. Because smarter people than me say so.
2. Everyone I know that went to school for modelling be it for commercial or entertainment purpose, say the same thing... section count is THE PARAMOUNT consideration. If you can (and you should) make ALL models 1 section.
I have no idea if this is currently accurate, or applicable directly to Arma, but I have been told by MANY Arma specific modders, and one of the BI DevZ that it was the most important consideration for models in Arma as well... DRASTICALLY more important than poly or face count.
HOWEVER, it must be stated, that some of the SMD buildings were in circulation for a LONG time with INSANELY high section counts, and no noticeable effect on performance, upto and including having them in an MP game state where loot was spawned in every room.
I did not go to school for modelling, and I have not really found many resources outlining the intimate details, or even identifying the proper verbiage
BUT... essentially, graphics cards are forced to start an entirely new draw cycle when they encounter a new section... so if you have high section counts the GPU is forced to spend more time assembling processable packages, and lining them up for processing, instead of screaming through huge chunks of assembled data.
So, the section counts drastically increasing was quite a mystery to M1lkm8n and I for a while, and many people gave us guidance, and pointers in the right direction.
III. What goes wrong?
1. When moving a model's namespace OR when port forwarding model content (see glossary below) the pathing to the textures are re-pathed to the new namespace or texture type, this can often be done less than optimally.
2. When copy/pasting faces from a model back in and manipulating them can often cause Oxygen or Object Builder to not associate the new face/texture with the section it was copied from.
1. BACKUP YOUR FILES before you begin work. OFF the P drive.
2. Monitor the changes you are making in Bulldozer after EVERY change and BEFORE saving progress
3. Check, Double Check, Re-Check, Check again, and when you're done with that CHECK AGAIN!
4. Save your progress often and BACK IT UP OFF the P drive.
IV. How to fix it
The process is tedious but very simple, it's very likely that someone could script something to automate this in O2, but I do not know how to do that.
1. Open your model
2. Select the 1st Resolution LOD (normally 1.000, in the example shown it is 0.000)
3. In "Resource Library" Window (If this window is not shown you can activate it as shown: Window->Resource Library)
4. Open the dropdown for "Current LOD" and then open the "Textures" folder
As you see in the example picture, there are 8 textures used for the model. This means that there will be a final MINIMUM section count of 6, however, if any of those textures are using different RVMats, then the section count will be higher.
In SOME cases, you can normalize the rvmats to reduce section count with little to no visual effect in the final model... In other cases, you will ruin the appearance of your model, and it will be difficult to revert the changes if you have saved your progress.
Back to the example, and you can see an ASTOUNDING section count of 164
No idea, but lets get to work on fixing it.
5. Right click in the empty space in the "Lods" Window (If this window is not shown you can activate it as shown: Window->Lods)
6. Selct "new" from the dropdown menu
7. You will see a new resolution lod created
8. Re-Select the 1st resolution lod (in the example 0.000), in the "Lods" Window by double clicking on it with the LMB
9. Select the 1st texture listed in the "Resource Library" window (in the example "drevo_prkna_stara_co.paa") by clicking on it once with the LMB
10. Now, click on the selected texture with the RMB to activate the properties menu and click "select in object"
11. Copy the selected faces (ctrl+c)
12. Select the LAST resolution lod that you created in step 6/7 by double clicking on it with the LMB
13. Paste the copied faces (ctrl+v) into the new resolution lod
14. Check the section count in the new resolution lod
- IF there is only 1 then skip BACK to step 9 and repeat for the next texture listed in the "Resource Library" window until all the listed textures have been pasted into the new lod
- If there is more than one section or MANY sections then:
15. Press "E" (or from the file menu select Faces->Face Properties)
16. You will see two Text Entry areas in the "Texture and materials" portion of the window. The "Texture" will show the name of the texture you selected with it's full namespace path. The "Material" will show "..."; this indicates that there are more than one RvMats referenced by the same texture. In some cases this is required or intentional. If it's a matter of saving 1-2 sections, then carry on for now, although I do check to see if the changes are noticeable and use the same RvMat if it will look fine.
17. Select one or more faces listed with the RvMat that you wish to use, Copy that full path in the text entry area marked "Material"
18. Select ALL the faces that you want to change the RvMat for and paste the full path of the rvmat into the text entry area marked "Material"
19. Watch the section count drop.
20. Once you have completed steps 9-19 for ALL the listed textures in the 1st resolution lod. Continue to step 21
21. Select the last resolution lod you created in step 6/7 by double clicking on it with the LMB
22. Select all (ctrl+a) and Copy (ctrl+c) to copy ALL the points/faces/sections
21. Select the 1st resolution lod by double clicking on it with the LMB.
22. Select All (ctrl+a) and delete by hitting the "delete" button on your keyboard, or by selecting "delete" from the Edit drop down file menu
23. Pasted all the points/faces/sections from the final resolution lod that are still stored in memory by hitting "ctrl+v"
Your model should now have the lowest possible section count without altering the UV unwrapping or textures.... in the 1st lod ONLY...
24. Repeats steps 8-23 for EVERY resolution lod the model has. In example model this is 0.000, 1.000, 3.000, 5.000, and 20.000
It is a tedious and time consuming process, but it is an absolute necessity to optimize your models as much as possible.
This is only ONE means of optimizing the models. I wanted to take the time to document this process specifically because I had not seen any information publicly detailing the process.
I am by NO MEANS an expert in modelling or model optimization, so if I have mis-stated or poorly summarized ANY aspect of this tutorial PLEASE feel free to provide additions or corrections.
Thanks for Reading!
*Reference / Glossary
Namespace - Refers to the location in which a model expects to exist. The default namespace in arma 2 is CA, all models exist in either the common or the addons folder, hence the namesapce CA. Modified Addons must exist in a unique namespace, otherwise they will overwrite the defailt models as the modified models are loaded after the core game files.
Ex: The 2 story Brick Apartment building is called "panelak.p3d" inside the PBO "buildings". It's namespace is "\ca\buildings\panelak.p3d"
Our modified version of the 2 story brick apartment is called "smd_panelak.p3d" and it's inside a folder called "buildings" inside the PBO "smd_sahrani_artif_obj". It's namespace is: "\smd_sahrani_artif_obj\buildings\smd_panelak. p3d"
Port Forwarding - Refers to the process of taking an asset from a previous release of a game, and making it fully compatible and featured as possible in the next iteration of the engine.
---------- Post added at 04:26 ---------- Previous post was at 04:24 ----------
Putting this up before doing the video again that way there is some peer review going on before I do the video.
Some example figures from buildings I've done already.... smd_budova3: old count: 100 sections! Fixed Count: 11. Oi!