NoMansSky:Editing NMS Textures: Difference between revisions

From Step Mods | Change The Game
Line 44: Line 44:


== Photoshop ==
== Photoshop ==
Photoshop is Adobe's renowned picture editing program. Currently all existing versions require a paid license to use.
Photoshop is Adobe's renowned image editing program. Currently all existing versions require a paid license to use.


However, for users who do have Photoshop, all that is required to read/write .DDS files is the [https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html Intel Texture Works plug-in]. To install, copy the '''.8bi''' plugin to the '''File Formats''' directory ( <code>\Plug-ins\File Formats</code> ) within the Photoshop installation folder.
However, for users who do have Photoshop, all that is required to read/write .DDS files is the [https://software.intel.com/content/www/us/en/develop/articles/intel-texture-works-plugin.html Intel Texture Works plug-in]. To install, copy the '''.8bi''' plugin to the '''File Formats''' directory ( <code>\Plug-ins\File Formats</code> ) within the Photoshop installation folder.


To edit a .DDS file :
To edit a .DDS file :
* open Photoshop or directly the .DDS if you associated Photoshop with .DDS files
# Open the file from within Photoshop or, if .DDS files are associated to Photoshop, open the file directly from the folder
* if the texture has an alpha layer or one or several mimaps, a new window will ask which you want to import.
# When opening, a prompt will appear with options for loading the file. If the texture has an alpha layer or mimaps, users will see the following:
: https://wiki.step-project.com/images/4/45/OpenDDSinPS.png
#: https://wiki.step-project.com/images/4/45/OpenDDSinPS.png
: The alpha layer is mandatory so if you're asked about it, always check the checkbox.<br>
#:* The alpha layer is mandatory so if the option is available, always check the checkbox.
: For mip-maps, it will create a layer per mip-map that you will need to delete so I suggest to not import them. You can generate them at save time if you really want and if you forgot, game will work even without them.
#:* If mip-maps box is checked, it will create a separate layer for each mip-map. This is rarely useful as mipmaps should be auto-generated during save, therefore, users should generally avoid checking this box.
* When you have finished to edit your texture, go to File Menu\Save As and choose {{fc|#FFF|Intel texture Works .DDS}} as the file format.<br>
# When ready to save, go to {{ui|File}} and select {{ui|Save As}}. Choose {{fc|#FFF|Intel texture Works .DDS}} as the file format.
: A new window will open with .DDS specific settings :
#: A new window will open with .DDS specific settings :
: {{GallerySimple|id=ImageSet1|width=144|img=Image:SaveDDS_in_PS.png|caption=Save DDS window}} {{clear}}
#: {{GallerySimple|id=ImageSet1|width=144|img=Image:SaveDDS_in_PS.png|caption=Save DDS window}} {{clear}}
: Settings are as follow :
#: Settings are as follows :
:* Texture Type : NMS only deals with 2 of them : Color (if there's no alpha layer, for fully opaque textures) or Color + Alpha for textures with an alpha channel.
#:* '''Texture Type''' : Choose ''Color'' if there's no alpha layer (fully opaque textures) or ''Color + Alpha'' for textures with an alpha channel.
:* Compression : you might always choose the first method proposed. this means BC1 Linear for textures without alpha channels and BC3 Linear for textures with alpha channel.
#:* '''Compression''' : Users should select the same compression as the original file. However, BC7 will usually provide the best results for any texture unless it has a very noisy alpha channel.
:* Pre-compress Normal Maps Operation : could help in the only case you are editing normal maps and some of your channels are flipped. Not your common case.
#:* '''Pre-compress Normal Maps Operation''' : is only available when saving normal maps and could help if some of the channels are flipped. This is not a common.
:* Mip-Maps : This option offers to auto generate a given number of mip-maps. If you want to generate the mip maps you discarded or deleted at opening, just choose the same amount that were initialy in the file here.
#:* '''Mip-Maps''' : This option offers to auto generate a given level of mip-maps. Though the game will work without them, for performance reasons, users should always generate mip-maps if the original texture also included them. Generally, users should choose to generate the same level that the original texture included.
* Finaly hit OK to save your file. Your last step is to {{fc|#F88|rename the file from .dds into .DDS}} because {{fc|#F88|.dds files are not recognized by the game}}.
# Finally, click {{ui|OK}} to save the file.
# The final step is to {{fc|#F88|rename the file from ''.dds'' into ''.DDS''}} because {{fc|#F88|lowercase .dds files are not recognized by the game}}.


==Cached Textures==
==Cached Textures==

Revision as of 20:31, October 16, 2020

Template:TOC right

Introduction[edit | edit source]

No Man's Sky uses the common .DDS format for its texture files. They are located in the TEXTURES folder from the unpacked game assets. Conveniently, TEXTURES is more or less organized in directories that mimic the MODELS directories. Therefore if users find a 3D model, they can quite easily find the texture and vice versa by following the mimicked paths.

The Format, itself, stores one or more textures either with or without an alpha channel. Though the DDS format is well used by the gaming industry, many texture programs still require a plugin to be able to read and write the format. This tutorial will explain how to display thumbnails of .DDS files within Windows Explorer, as well as, how to edit the files in Paint.net and/or Adobe Photoshop.

System Setup[edit | edit source]

Texture Previews[edit | edit source]

Even if .DDS is a part of DirectX, created by Microsoft, Windows doesn't support the .DDS file format preview in its explorer.
Hopefully some other company did the job and the best way so far is to use Paint.net paired with the FileTypeDDS extension.

All you have to do is :

  • install paint.net
  • decompress FiletypeDDS zip file
  • copy-paste extracted folders into the paint.net directory to overwrite the default one
  • open any folder containing some NMS .DDS file
  • right click a .DDS file and choose "open with"
  • Select Paint.net
  • Close any texture folder

Starting from now on, opening any texture folder will display all the .DDS files as thumbnails instead of generic icons !

Various Texture Tools[edit | edit source]

Below are various tools that are helpful when working with textures.

DirectXTex
This is a shared source library for reading and writing .DDS files, and performing various texture content processing operations on such files. The item of interest here is Texdiag.
Texdiag is a command line tool used to analyze images. When ran on a texture, Texdiag will output useful information such as the texture size, compression format, channel information, mipmap levels, etc.

Paint.net (by Casebolt)[edit | edit source]

Paint.net is a free Open source photo editing software that can be downloaded here.

To open and read .DDS files, users will need this specific addon by Nick aka Dtzxporter.
Then follow the included readme file to install it. It's just a matter of copying 2 files.

Now, to edit a .DDS file :

  • Open Paint.net and go to [File] and select [Open] (or Ctrl+O). Choose the desired .DDS file.
  • Users can now edit the file as any other image.
  • To save the finished file, choose [File] and select [Save as] (or Ctrl+Shift+S). Select .DDS file type as the output type and click [Save].

Photoshop[edit | edit source]

Photoshop is Adobe's renowned image editing program. Currently all existing versions require a paid license to use.

However, for users who do have Photoshop, all that is required to read/write .DDS files is the Intel Texture Works plug-in. To install, copy the .8bi plugin to the File Formats directory ( \Plug-ins\File Formats ) within the Photoshop installation folder.

To edit a .DDS file :

  1. Open the file from within Photoshop or, if .DDS files are associated to Photoshop, open the file directly from the folder
  2. When opening, a prompt will appear with options for loading the file. If the texture has an alpha layer or mimaps, users will see the following:
    OpenDDSinPS.png
    • The alpha layer is mandatory so if the option is available, always check the checkbox.
    • If mip-maps box is checked, it will create a separate layer for each mip-map. This is rarely useful as mipmaps should be auto-generated during save, therefore, users should generally avoid checking this box.
  3. When ready to save, go to [File] and select [Save As]. Choose Intel texture Works .DDS as the file format.
    A new window will open with .DDS specific settings :
    Settings are as follows :
    • Texture Type : Choose Color if there's no alpha layer (fully opaque textures) or Color + Alpha for textures with an alpha channel.
    • Compression : Users should select the same compression as the original file. However, BC7 will usually provide the best results for any texture unless it has a very noisy alpha channel.
    • Pre-compress Normal Maps Operation : is only available when saving normal maps and could help if some of the channels are flipped. This is not a common.
    • Mip-Maps : This option offers to auto generate a given level of mip-maps. Though the game will work without them, for performance reasons, users should always generate mip-maps if the original texture also included them. Generally, users should choose to generate the same level that the original texture included.
  4. Finally, click [OK] to save the file.
  5. The final step is to rename the file from .dds into .DDS because lowercase .dds files are not recognized by the game.

Cached Textures[edit | edit source]

If ater replacing a texture, you can't see it ingame or get weird stripes where the texture should be, it's probably because you edited one of the NMS cached textures.
Indeed to speed up some texture access, NMS stores headers and footers of some of the textures in a cache file.
But when you edited your texture, you changed its properties and header and footer of your new file don't match the ones in the cache file, resulting in corrupted display.
The cache file is named CACHE.SQS and is in the TEXTURES folder but editing it is quite complex so the easiest solution is to use a workaround.

The working solution is quite simple :

  • Rename your texture, like LASER.DDS becomes LASER2.DDS.
  • Find the MATERIAL.MBIN file calling the original texture file and change the name of the texture to LASER2.DDS too

Doing that way, you are calling a texture that is not listed as cached and that will appear properly in game.
It sadly also needs to edit (and release) 2 files instead of one for a new mod, but that's a minor drawback. Template:NMSPageClose