Imposters

Revision as of 13:16, 22 March 2023 by AyyMang (talk | contribs) (Created page with "Category:TechDocs == Imposters == Imposters are a feature associated with most medium to large natural props found on planets in No Man's Sky. Their purpose is to replace models seen at large distances with two dimensional renders of those models to save on performance. It is important to note that although imposters would typically be part of a game's LOD system, the imposters in No Man's Sky function independently of the LODs, and are set up differently. When a...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)


Imposters

Imposters are a feature associated with most medium to large natural props found on planets in No Man's Sky. Their purpose is to replace models seen at large distances with two dimensional renders of those models to save on performance. It is important to note that although imposters would typically be part of a game's LOD system, the imposters in No Man's Sky function independently of the LODs, and are set up differently.

When an imposter renders, it is displaying a 2d billboarded sprite of whatever model it is replacing. This render is generated at runtime and will accurately capture all procedural parts and textures, including custom ones that have been modded in. The distance at which any given model will switch from a 3d mesh to a 2d imposter is set in the OBJECTLIST file that it is being called by. Imposters do not require any specific components to be applied in the relevant model's ENTITY file, and will even work on models with no entities.

No Man's Sky's imposters are done almost entirely in shader and are included as geometry in all the relevant models' SCENE files. Each scene has no more than one imposter included, and that imposter will be single vertical plane with a slightly larger width and height than the largest meshes in that scene. Each imposter will also use it's own material, and although they are all similar, they are not all identical:

  • All imposter materials use the UBERSHADER
  • All imposter materials use the _F01_DIFFUSEMAP, _F03_NORMALMAP, _F11_ALPHACUTOUT, _F19_BILLBOARD and _F44_IMPOSTER flags.
  • Some imposter materials use the _F40_SUBSURFACE_MASK flag to allow for some parts of the render to use subsurface scattering, and/or the _F28_VBSKINNED flag when parts of the base model are skinned to animate with bones.
  • All imposter materials call TEXTURES/COMMON/IMPOSTERTEXTURE.DDS as a diffuse texture, TEXTURES/COMMON/IMPOSTERTEXTURE.MASKS.DDS as masks and TEXTURES/TESTS/CHECKERBOARD2.DDS as a normal map.

None of these images have associated TEXTURE.MBIN files, and both TEXTURES/COMMON/IMPOSTERTEXTURE.DDS and TEXTURES/COMMON/IMPOSTERTEXTURE.MASKS.DDS are blank 2x2 pixel images.

Known Issues

Imposters are somewhat infamous for breaking very easily when mods touch scene files that include them. When a scene containing an imposter breaks, the imposter will show up as a large solid red square that is visible from any distance, even when close enough to see the 3d version of the model. This will only effect the broken scene, all other scenes' imposters will display fine.

Although we don't currently know to much on why the imposters are so easy to break, the current information we have is as follows:

  • Imposters may break when attached to a scene that is not at path that would normally lead to a scene with imposters (Needs testing to confirm!)
  • Imposters may break when attached to a scene without a matching geometry file at the same directory (Needs testing to confirm!)
  • Imposters may break when being exported from the NMSDK Blender plugin
  • Imposters that are broken by the NMSDK plugin can sometimes be fixed by modifying their data in the scene file to match vanilla