Textures – Arma Reforger
Lou Montana (talk | contribs) (Add texture suffix warning messagebox) |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 276: | Line 276: | ||
! colspan="9" | Material | ! colspan="9" | Material | ||
! colspan="9" | Texture | ! colspan="9" | Texture | ||
|- class="sticky-top" | |- class="sticky-top" style="font-size: .75em" | ||
! Particle | ! Particle | ||
! Grass | ! Grass | ||
Line 357: | Line 357: | ||
| | | | ||
| {{Icon|checked}} | | {{Icon|checked}} | ||
| in PBRTree Trunk shader behaves as N<s>M</s>O | | in PBRTree Trunk, shader behaves as N<s>M</s>O: metalness is ignored | ||
| {{Icon|checked}} | | {{Icon|checked}} | ||
| {{Icon|checked}} | | {{Icon|checked}} | ||
Line 521: | Line 521: | ||
| ColorHQCompression/ DXTCompression | | ColorHQCompression/ DXTCompression | ||
|- | |- | ||
| colspan="9" |Used in "clutter collection config" and "procedural grass config" to drive the distribution | | colspan="9" | Used in "clutter collection config" and "procedural grass config" to drive the distribution | ||
| Clutter Mask | | Clutter Mask | ||
| _CMASK | | _CMASK | ||
Line 577: | Line 577: | ||
| | | | ||
| | | | ||
| {{Icon|checked}} in Trunk behaves as N<s>M</s>O | | {{Icon|checked}} in PBRTree Trunk, shader behaves as N<s>M</s>O: metalness is ignored | ||
| | | | ||
| | | | ||
Line 672: | Line 672: | ||
== Texture Preview == | == Texture Preview == | ||
After opening a texture in Workbench, you will see its preview in the Workbench viewport, above it are some buttons and right to it "Details" and "Import Settings" tabs. | |||
See [[Arma Reforger:Resource Manager: Texture Editor|Resource Manager: Texture Editor]]. | |||
{{GameCategory|armaR|Modding|Guidelines}} | {{GameCategory|armaR|Modding|Guidelines}} |
Revision as of 11:33, 29 December 2022
Source Image format
- preferred image data format is TIFF (.tif, .tiff) - it provides the best output size and compression. We use RGB Color mode and 8 Bits per channel, image compression ideally LZW.
- all other formats (.png, .tga, ...) will work as well, but are not preferred.
- recommended settings for saving in Photoshop (for better compatibility reasons across SW):
- Compression Type: LZW
- Layer Compression: Discard Layers and Save a Copy
Basics
- All textures are 8-bit per channel to save memory, unless "Original Pixel Bit Depth" is checked in texture "import settings", which is really ok only for HDR (ENV) textures used for lighting in Workbench viewport.
- Enfusion uses DirectX normal maps and only red (+x) and green (-y) channels.
- Upon registering a texture and importing it for the first time, correct Compression is automatically assigned based on used suffix except for channel masks 1 and 2 - these must be set manually.
- When RedGreenHQCompression is used, only Red and Green channels of texture are compressed and used, other channels are not used (appear as black in workbench preview). Similarly, RedHQCompression compressed only R channel, others are not used
- Best quality for textures with 3 to 4 channels (RGB/RGBA) is achieved by ColorHQCompression.
- When looking for best compression in the case of alpha channel missing, or the alpha is very contrasted like almost just with values 1 and 0 in pixels, DXTCompression can be used. This leads to a six times smaller texture but with worse quality than ColorHQCompression.
Texture Types
Base Color
Albedo of the surface, which basically defines what color each pixel have.
Roughness
Greyscale texture, which defines which parts of the model are shiny or rough looking.
Metalness
Greyscale texture which defines which parts of model behave like metal (value 1 - steel, gold, aluminum etc) or dielectrics (value 0 - wood, rubber, soil etc).
Normal
Define bumpiness of the model surface.
Opacity
Define which parts of model are transparent (0) or opaque (1).
Height
Used for parallax effect which emulates high detail per pixel tessellation of decal or terrain surface (currently no usage for model shaders).
Mask
There are multiple mask types:
Global Mask
Determine distribution of "sub-materials" inside PBRMulti and PBR2Layers shaders. Each channel represents here one "sub-material". It can be imported as RGB texture or R-channel only depending on how much masks you need to get from the texture. If a mask for PBR2Layers shader or just for 2 sub-materials in PBRMulti is needed, then the R-channel only mask is enough (black and white). If a mask for 3+ sub-materials in PBRMulti is needed, then the RGB mask should be used (black, red, green, blue).
Detail Mask
Greyscale texture, which determines "breakup" of the "Global Mask". Result masking should look more detailed (hi-res).
Normal Mask
Basically the same as one channel Global Mask with a mask for Detail Normal in the second channel. it is used in PBR2Layers shader.
Camo mask
Special mask, which defines where "Camo" color texture appears in PBRCamo shader.
Ambient Occlusion
Determine the intensity of ambient lighting in places where the natural light does not reach.
Cavity
Determine intensity of both Diffuse and Ambient lighting (both in shadows and on sun).
Global/Macro Textures
These are special textures which combine with underlying sub-materials in a specific way in order to breakup sub-materials' repetitiveness or add some unique "macro" looking details.
Albedo/roughness uses _MCR because they are imported differently than _BCR.
For normal, metal and ambient occlusion the ordinary _NMO textures is used, because the same texture import is required.
There is an option to use _O texture suffix for ambient occlusion if only that is required.
Emissive
Define which parts of model will glow and how much at night or in the dark.
Environment Cube Map
HDR (High Dynamic Range) texture used only for lighting inside viewport inside Workbench. It has no real application for game assets but a world can be created with a different lighting setup and atmosphere.
Texture Import
- Place the texture into the game or mod project data structure.
- In Resource Browser, right-click on the texture and select Register or Register and Import.
- Register - only meta file containing import settings is created. These setting can now be changed from default in the "Import Settings" tab, which appears when the source texture is opened.
- Register and Import - the metafile containing import settings is created and the texture is imported right away with default import settings.
- Import - upon binarised and compressed version import of the source, an .edds texture is created right next to the source texture.
- After the import, the texture preview can be opened by double-clicking on it or right-click and selecting Open file in new tab.
Import Settings
The import settings are quite complex which is why it is important to use the correct texture suffix, as it 99% of the tim sets the proper settings automatically (exceptions being _MCR texture and 1 or 2 channel MASK where manual color space setup is required).
Format Compress
Used for quality/speed of internal mipmaps compression, higher values mean bigger compression time.
Compress Treshold
Ratio of internal data mipmap compression. Each mipmap is compressed using internal compression - if the ratio between compressed and original size is less than this ratio, mipmap is stored in compressed format, otherwise in original.
Remove Mips
Remove better mipmaps (1, 2, etc) in order to lower texture memory consumption. The full mipmap chain is generated before the mipmaps are removed unless "ContainMips" is checked when full custom mimmap atlas/texture is imported.
Max Size
This setting sets the maximum resolution in which the texture is going to be imported.
Conversion
Defines conversion of texture format used at runtime (eg. compressed GPU format or channel removal).
None
No channel compression is used.
DXTCompression
Conversion into lossy DXT1 (RGB) / DXT5 (RGBA) format (decision based on alpha channel's presence).
Final size: usually 1/4 to 1/6 of uncompressed RGBA
Alpha8
Only alpha channel is kept - when used as a texture, RGB is automatically 0.
Final size: 1/4 of uncompressed RGBA
Red
Only the red channel is kept - when used as a texture, GB is automatically 0 and A is 1.
Final size: 1/4 of uncompressed RGBA
RedHQCompression
Only red channel is kept and compressed using lossy BC4 compression - when used as a texture, GB is automatically 0 and A is 1.
Final size: is 1/8 of uncompressed RGBA
RedGreen
Only red and green channels are kept - when used like a texture, B is automatically 0 and A is 1
Final size: is 1/2 of uncompressed RGBA
RedGreenHQCompression
Only red and green channel are left and compressed by lossy BC5 compression - when used as a texture, B is automatically 0 and A is 1.
Final size: 1/4 of uncompressed RGBA
ColorHQCompression
RGBA compression into lossy BC7 format - better quality than DXT compression, a little worse compression speed.
Final size: 1/4 of uncompressed RGBA
HDRCompression
16 bits HDR lossy compression into BC6 format
Final size: 1/4 of uncompressed texture
ConversionQuality
This slider defines quality of compressor when converting the BCx format. Higher values may mean much worse compression time with a little quality improvement.
OriginalPixelBitDepth
Usually all textures with better precision (16 bits) are converted automatically to 8 bit format. When this option is checked, the original texture format is kept.
Swizzling
Special channel reordering that may differ for various materials and texture usage - it is present as legacy support for some internal test projects.
ColorSpace
conversion of color space, albedo maps should be in sRGB, otherwise linear, this value should be usually left as "Default".
if conversion to another color space is performed, the source would be ideally 16 bits due to possible loss of quality.
Default
- ToSRGB or ToLinear is used based on texture suffix
- Tio. - only texture type, where both color spaces are possible is _MCR texture. The colors in this texture can be prepared for both color space usage.
ToSRGB
The given texture is considered to be done in graphics editor such as Photoshop and the source texture values/colors are shifted from sRGB in which they were created so they can be correctly loaded into the shaders, usually for albedo textures (BCR).
ToLinear
The texture values/colors are not altered (are considered already as linear) and are loaded into shaders just as they are.
ContainsMips
Must be checked in case the source texture contains mipmaps (see picture).
GenerateMips
Generate the full mipmap chain. This is enabled by default as mipmap helps a lot to:
- speed up rendering
- fight against aliasing
- surprisingly reduce memory overhead in engine even though they are bigger: Resource Manager can load only the necessary mipmaps and not the full mipmap chain
MipMapFunction
Define what to do with mipmap after them being generated.
Filter
Normal filtering - reduces contrast in lower mipmaps as they are somehow avereage from previous one.
Normalize
Useful for normal maps as usual filtering decrease contrast, though it may add noise at lower mipmaps (specular aliasing).
ColorNoise
Color is left as it is and to alpha channel is generated noise (for some special purposes)
MipMapFilter
Three types for filtering mipmaps, Box is default, others can produce better mipmaps but sometimes may show artifacts.
- Box, Triangle, Kaiser
- FoliageAlpha 1 - 5 - this is used for vegetation opacity textures, so they keep better/denser opacity also in smaller MIPs, which are drawn further away from camera
TiledTexture
Used to improve wrapping around edges when generating mipmaps
VolumeTexture
Will disable other settings and convert flat texture for example 256x16 texture to 16x16x16 3D volume texture. Used mainly for LUT textures like.
GenerateCubeMap
Generate cube map from unwrapped texture with spherical mapping
Texture Properties
and channel distribution table below is chart of all valid texture types, in what shaders they are used and some of their "import properties".
Material | Texture | ||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Particle | Grass | Terrain | PBRDecal | PBRTree Crown/Trunk | PBRMulti | PBR2Layers | PBRBasic | PBRCamo | Type | Suffix | Red Channel |
Green Channel |
Blue Channel |
Alpha Channel |
Bit depth per pixel | Color space | Compression |
Base Color | _BC | Albedo | Albedo | Albedo | 32 | sRGB | ColorHQCompression | ||||||||||
Base Color + Opacity mask | _BCA | Albedo | Albedo | Albedo | Opacity mask | 32 | sRGB | ColorHQCompression | |||||||||
Base Color + Roughness | _BCR | Albedo | Albedo | Albedo | Roughness | 32 | sRGB | ColorHQCompression | |||||||||
in PBRTree Trunk, shader behaves as N |
Normal map + Metalness + Ambient Occlusion | _NMO | Normal
+X |
Normal
-Y |
Metalness | Ambient Occlusion | 32 | linear RGB | ColorHQCompression | ||||||||
Normal map | _N | Normal
+X |
Normal
-Y |
16 | linear RGB | RedGreenHQCompression | |||||||||||
Transparency/Opacity | _A | Opacity mask | 8 | linear RGB | RedHQCompression | ||||||||||||
Height | _H | Height | 8 | linear RGB | RedHQCompression | ||||||||||||
1 channel |
1 channel Detail Mask | _DETAIL_MASK | Mask | 8 | linear RGB | RedHQCompression
(must set manually) | |||||||||||
1 channel |
1 channel |
1 channel Mask | _GLOBAL_MASK | Mask | 8 | linear RGB | RedHQCompression
(must set manually) | ||||||||||
2 channels |
2 channels Mask | _GLOBAL_MASK | Mask | Mask
(DetailNormal) |
16 | linear RGB | RedGreenHQCompression
(must set manually) | ||||||||||
3 channels |
3 channels Mask | _GLOBAL_MASK | Mask | Mask | Mask | 24 | linear RGB | ColorHQCompression/ DXTCompression | |||||||||
Used in "clutter collection config" and "procedural grass config" to drive the distribution | Clutter Mask | _CMASK | Clutter Distribution
Mask |
Clutter Height Mask | 16 | linear RGB | RedGreenHQCompression | ||||||||||
VFX | _VFX | Mask (dirt) | Mask
(mud) |
16 | linear RGB | RedGreenHQCompression | |||||||||||
Global/Macro Base color and Roughness | _MCR | Color | Color | Color | Roughness | 32 | linear RGB / sRGB | ColorHQCompression | |||||||||
in PBRTree Trunk, shader behaves as N |
Normal map + Transmittance + Cavity | _NTC | Normal
+X |
Normal
-Y |
Transmittance | Cavity | 32 | linear RGB | ColorHQCompression | ||||||||
Normal map + Height + Cavity | _NHO | Normal
+X |
Normal
-Y |
Height | AO | 32 | linear RGB | ColorHQCompression | |||||||||
Camo mask + roughness + metalness | _CRM | Mask | Roughness | Metalness | 24 | linear RGB | ColorHQCompression/ DXTCompression | ||||||||||
Emissive | _EM | Color | Color | Color | 24 | linear RGB | ColorHQCompression/ DXTCompression | ||||||||||
For lighting purposes inside Workbench viewport and in World editor (replaces atmosphere lighting). It has no in-game usage in shaders. | Environment cube map | _ENV | Color | Color | Color | 24+ | linear RGB | HDRCompression |
Texture Preview
After opening a texture in Workbench, you will see its preview in the Workbench viewport, above it are some buttons and right to it "Details" and "Import Settings" tabs.