Recreating normal maps through Blender and Substance Painter - FAForever/fa GitHub Wiki

Prerequisites

Recommended

  • Adobe Photoshop
  • Photoshop plugin to read .dds file format from here (requires free nvidia developer account)
  • Intel Texture works Plugin for Photoshop from here

Steps of the process

Prep: Install the prerequisite software and activate addons

Notes: It is strongly recommended to set up a development environment following Jips youtube tutorial or the wiki. With DiskWatch (enabled by default) you can switch textures without reloading the game to save time!

1) Getting started

  1. Decide which unit to work on and get its ID from the FAF unit DB (example: DEL0204 is the Mongoose)
  2. Go to your SupCom installation folder (usually "C:\Program Files (x86)\Steam\steamapps\common\Supreme Commander Forged Alliance\gamedata" if you have the steam version) and navigate to /gamedata and find the file units.scd
  3. make a copy in of it in your working directory and rename it to a .zip instead of a .scd Note: some units may already have been modified. Their data can be found in "C:\ProgramData\FAForever\gamedata" proceed with the units.nx2 file there if it has
  4. extract the folder of your unit to your working directory ("DEL0204" in case of the Mongoose)
  5. open Blender and activate the "Import-Export Supreme Commander SCM&SCA format" addon

2) Blender - Preparing the original model

  1. Import the correct .scm file for your unit. In our example case "DEL0204_lod0.scm"
  2. split up the mesh into its parts (press L to select connected and use the material option). Make sure to select all the symmetrical parts of the meshthat may have overlapping UVs and have them be a single object. (In my example both legs were using the same UV space 4 times so I only modeled one and used symmetry)
  3. give your objects proper names and add the suffix "_low" to all of them (batch rename is your friend)
  4. you can but should not need to remove the armature modifier from the objects but keep the edge split modifier active. make sure the scale is applied, the actual size of the model shouldnt matter for our purpose
  5. edit all the UVs, select overlap, and move all overlapping faces except the one you want to use for baking 1 UV unit to the side until there is no overlap left inside the 0-1 UV space
  6. move the original model to its own collection and name it ("DEL0204_original" in my case)

Notes: The smoothing on the imported mesh CANNOT be trusted! It may be entirely different in game!

Tip: Use a 0.5 RGBA Debug texture in all slots (albedo, normal, specTeam) to easily view the mesh "without texture" and switch on the fly.

3) Blender - Recreating the model as high poly

  1. create a new collection and name it ("DEL0204_rework" in my case)
  2. you can copy many of the original objects over and use them as a starting point
  3. an easy way to create paneling is to use the knife tool and kut them into the new mesh, mark them as sharp, then use the following modifiers in that order
  • edge split (sharp only, not by angle)
  • solidify (offset -1, rim only, even thickness, thickness depends on your desired bevel size)
  • bevel (at least 3 segments, thickness as you see fit, harden normals)
  • set the object to "auto smooth"

This will instantly yield you a good starting point. Everything from here is your creative work. You can use other modifiers in between like boolean, mirror, or another bevel. Just make sure not to break it.

3b. paneling is not something to concern yourself with at this stage. Only model out the big shapes that could not be easily recreated as a height map.

  • Apply proper smoothing to all the objects
  • use an appropriately sized bevel on all the bigger edges, keep in mind the final texture resolution (that is also why panelling is not done for now).
  1. name your reworked meshes the same way you name the ones they should bake to but change the suffix "_low" to "_high". For matching purposes in Substance Painter you can add more suffixes AFTER that for objects that should bake to the same low poly part. (example: "hull_high_extras" will bake to "hull_low")

4) Exporting from Blender

  1. select all the low poly objects and export that selection as .fbx
  2. select all the high poly objects and export that selection as .fbx
  • make sure you do not have concave ngons, since they may be triangulated differently in Substance Painter and break
  • only export the selected meshes, no animation or other objects

In case you have to export the mesh as .scm as well:

  • make sure the bones, especially of turrets, are oriented correctly
  • keep the same vertex groups so the bones still work
  • you can export the mesh as seperate objects used for baking and reuse the originals armature. All meshes must be parented to said armature.
  • if you change vertex groups make sure to unassign the old bone group so it is only influenced by one at a time.

ALWAYS TEST your results in the game before creating a pull request! A broken bone rotation could mean a turret shooting in the wrong direction, entirely breaking the unit and therefore requiring an immediate hotfix!

5) Substance Painter - Baking

  1. start by importing your low poly fbx file into a fresh project
  2. set the textureset resolution to your desired output
  3. open the "bake mesh maps" window and select your high poly mesh as the high definition mesh
  4. adjust the settings to fit your individual case
  5. choose Match: "By Mesh Name". this will ensure overlapping meshes will not bake onto the wrong object
  6. check the Matching by name tab at bottom and make sure there are no errors or mismatches
  7. check on the "Normal" option as your target bake map, the rest is irrelevant, and hit "Bake selected textures"
  8. finally return to paint mode and check if everything looks right

5b) Substance Painter - Detailing

  1. after baking the normals without panelling (step 3, 3) create a new fill layer with a black mask
  2. set the fill to only influence height and set it to a negative value (-0.2 to -0.4 worked well, try what works)
  3. use the brush with "shape" as alpha (soft circle), set the size to the smallest value
  4. draw in the panellines using the white colored brush into the mask (black to erase). Using UV projection mode and drawing in the 2D view really helps with straight lines (ctrl + shift)
  5. a bigger hard square shaped brush and different layers with different height values can really speed up the process of creating normal detail, while being nondestructive

6) Substance Painter export and file finalization

  1. check the texture set resolution again
  2. open the "export textures" window
  3. I recommend creating an output template called "FAF_normal" with the following settings
  • export a RGB+A texture
  • RGB channel: Normal OpenGL (GREEN CHANNEL ONLY)
  • Alpha channel: Normal OpenGL (RED CHANNEL ONLY)
  • .png 8bit should be good enough
  1. return to the export settings and choose the newly created template and your output directory
  2. finally hit export
  3. convert the exported .png file into a .dds file (the easiest way I found was to use a web converter for the job, alternatively see 7)
  4. name the resulting .dds file in the correct format (example: "DEL0204_normalsTS.dds")

Additional notes for normal maps:

  • The format of the channels need to be set up and inverted or not has to be tested in game. Make sure you do so and it looks right!
  • Sometimes both X(alpha) and Y(rgb) of the normal have to be inverted for it to look correct

7) Working with maps in Photoshop

  1. importing .dds files requires the intel and/or nvidia plugins
  2. you can edit different channels and layers as you normally would
  3. use references from other (working) units as a point of reference for value ranges on your own textures (brightness of alpha channel in specTeams alpha, or general brightness of albedo for example)
  4. to export you cannot use the nvidia plugin as the resulting files cannot be read by the game. Use the intel plugin by selecting "save as" and choosing the .dds file format. (make sure alpha channel is included when needed)

8) Testing - NEVER PUSH UNTESTED ASSETS!

  1. at this point you should already have a testing environment set up. if you do not, follow the above mentioned setup guides
  2. Put all the assets into their correct location in your development repository (./units/DEL0204/ in my case)
  3. launch the dev batch file applicable for your operating system to launch the game from the repository. The "DiskWatch" flag is important here, but should be enabled by default.
  4. launch a sandbox game and spawn in your reworked unit

Testing Checklist:

  • Does the unit look right?
  • How does the unit compare to comparable units of the same faction? Brightness, team color, general look.
  • Do all the turrets still shoot in the correct direction? This includes AA, TMD turrets, so only a ground fire is not enough!
  • Do the animations still work correctly? Walking, death etc.!

9) Creating a pull request

  1. commit and push your work to your local fork of the repository.
  2. create a pull request following the template.
  3. make sure you provide wirtten and visual information to accelerate the review process.
  4. be responsive when it comes to feedback and be nice. Thank you for your efforts!

Congratulations, your final file is now ready to be put into the game!