Jump to content

Porting a Texture from 4 to 76


yojeff

Recommended Posts

Fallout 76 introduced some changes to the texture system, and it implements lighting and PBR differently. I would at first try replacing only the _d.dds texture, and for the other three (n = normal, r = reflectance, l = lighting), keep the vanilla Fallout 76 files.

 

Edit: for reference, these are the standard texture maps for Fallout 76 materials:

  • _d.dds: Diffuse or albedo texture, typically in BC1_UNORM_SRGB or BC3_UNORM_SRGB format. Fallout 4 textures are not flagged as being in sRGB color space, which resulted in the gamma issue that can be seen on the above screenshots. Another notable difference is that in Fallout 76, this texture is black on pure metal surfaces.
  • _n.dds: Normal map in BC5_SNORM format (2 channels). Unlike in Fallout 4, the data type is signed 8-bit.
  • _l.dds: Lighting texture in BC1_UNORM or BC3_UNORM format, 3 or 4 channels:
  • * R: smoothness map, low = rough, high = glossy
  • * G: ambient occlusion map, applied to indirect lighting
  • * B: subsurface scattering map, used optionally if enabled in the material file
  • * A: grayscale emissive map (optional)
  • _r.dds: Reflectance at normal incidence (table of reference values for common materials), usually in BC1_UNORM_SRGB (3 channels) or BC4_UNORM (grayscale) format. This is often just a 4x4 grayscale texture filled with a solid color of #0A0A0A, or about 4% reflected in linear color space.

Optional texture maps include:

  • grad.dds: Grayscale to palette map, it works similarly to Fallout 4. On shader materials, the U and V texture coordinates are calculated from the intensity of the original diffuse texture, and the product of the vertex color intensity and the grayscale to palette map scale parameter, respectively.
  • _g.dds: RGB emissive map.
  • _e.dds and _m.dds: Environment map and mask, unlike in Fallout 4, these are normally not used on shader materials (due to being unneeded with PBR and dynamic cube maps from Enlighten), but are sometimes used on effect materials like glass.

The material (.bgsm and .bgem file) format version has been increased from 2 to 20. The differences between these can be seen in material.cpp in the source code of NifSkope.

Edited by fo76utils
Link to comment
Share on other sites

Thanks for the answer! When you talked about lighting, I thought about the alpha channel. I opened the _d.dds file in Paint.net, and the alpha was at 255. I lowered it to 0. The whiteness has disappeared in Nifskope. I have not tried it in game yet!

Link to comment
Share on other sites

Thanks for the help. I ended up recoloring the white texture in yellow in order to have a really clean version.

 

That was the first step for what I really wanted to do : having the first aid box and chem box as floor and wall decorations in my camp.

 

The floor decorations work, but as wall decoration, I would need to flip the nif around the z-axis, but Nifskope 2.0 Dev 8 doesn't allow saving nif files.

 

Now I'm wondering if this is why the Nifskope development seems kind of dead, that Betheseda said : You can look, but no modification...

Edited by yojeff
Link to comment
Share on other sites

Having another look at the files, I think the problem could be that the Fallout 4 texture is in BC1_UNORM format, while the Fallout 76 one is in BC1_UNORM_SRGB (DXGI format codes 0x47 and 0x48, respectively). Fallout 76 shaders work in linear color space, which is what is physically correct, so the format code requests conversion from sRGB to linear on texture read (and the inverse is done when writing to the frame buffer), while the older game just uses the texture colors without conversion. With the Fallout 4 texture on a Fallout 76 mesh, NifSkope skips the first conversion but still does the second, making the image much brighter. So, changing the format code by saving the texture again as sRGB, or just editing the header, should fix the colors.

Link to comment
Share on other sites

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...