fa icon indicating copy to clipboard operation
fa copied to clipboard

Patching textures for PBR use

Open Garanas opened this issue 3 years ago • 0 comments

Description

This issue is an extension of this forum post. The aim is to prepare the assets for PBR rendering. A lot of units are fine, but there are a few dozen that have missing or textures (channels) that are not entirely representative of the shape of the unit.

As an example, take the summit. This is what it looks like in Steam FA, we marked the issues in yellow:

image

And this is what it looks like in FAF:

image

The difference is in the normal maps. This is what got shipped with the game in 2006:

summit-incorrect

And this is what it looks like in FAF since 2022:

summit-correct

There are a lot of textures that look, or partially look, like the first image. And that is where a lot of the issues of shading of units originate from. As a few clear examples, look closely at the UEF Land Factories, The Atlantis and if you want a challenge: at the Mongoose. If the lighting feels off, it is because one of these textures being off.

Next to the normal maps being off occasionally units can also miss entire channels. We use those channels in the PBR calculations. As a result, the units look bland using PBR shaders.

Prerequisites

The following software / tooling / websites is recommended:

  • (1) Unit database, you'll use this to find the internal identifier of the unit. As an example, the identifier of the Mongoose is del0204 and the identifier of the UEF ACU is uel0001. Usually, the identifier consists of a prefix (x, d, or u), the faction (e, a, r, s), the type (l, s, a and b) and then four numbers that represent the tech level and an identifier to make it unique between tech levels.
  • (2) Nvidia DDS Converter: you'll use this to convert to and from the dds (Direct Draw Surface) format. All game textures are in the dds format, but not all software supports this type. Note that when you save to dds it needs to be BC3 or DXT5:

image

  • (3) Modified Cubemap Gen: you'll use this to adjust the sky / cube maps. Note that you don't need this if you intend to only work on units. We agree that the link looks a bit sketchy.
  • (4) Development environment for FAF: you'll use this to quickly test units and shaders changes in-game. When setup the game reloads textures and shaders on the fly, as you change them on disk. You can also use this video on Youtube.
  • (5) Editing software: you'll use this to edit the textures. This can include Photoshop, Gimp, or if you're an advanced user tools like Substance Painter, Mudbox.

And above all, a lot of patience. There are a lot of units to work through. A single unit can easily take an hour or more to process, and then there are still bits and pieces that you can improve.

Course of action

We'll use a spreadsheet to organize what units need attention.

Texture layers

UEF R G B A
Albedo R G B Unused
Normals Unused Y Unused X
Spec Roughness Roughness Emission Team color / Metallic + roughness reduction
Cybran R G B A
Albedo R G B Unused
Normals Unused Y Unused X
Spec Metallic Roughness Emission Team color / Metallic + roughness reduction
Aeon R G B A
Albedo R G B Unused
Normals Unused Y Unused X
Spec Metallic Roughness Emission Team color / Metallic + Roughness reduction
Seraphim R G B A
Albedo R G B Team color / emission / Roughness reduction
Normals Unused Y Unused X
Spec Unused Roughness Emission Unused

Test plan

We can not see dds textures in Github. To simplify the review procedure we ask you:

  • (1) Add screenshots of the unit, before you started working on it
  • (2) Add the textures of the unit, before you started working on it
  • (3) Add screenshots of the unit, after you finished working on it
  • (4) Add the textures of the unit, after you finished working on it

That creates a healthy track record for everyone to see on how the unit was adjusted.

Garanas avatar Nov 12 '22 13:11 Garanas