Marvel's Spider-Man Remastered
0 of 0

File information

Last updated

Original upload

Created by

hypermorphic

Uploaded by

hypermorphic

Virus scan

Safe to use

Tags for this mod

About this mod

Modder's tool for editing .material files. Allows you to change texture strings and shader input values. For Spiderman and Miles Morales.

Requirements
Permissions and credits
Background

This is my understanding so far.  Do your own experimentation, and let us know what you learn on the modding tool Discord server #materials channel.

There are two kinds of material assets in the game:  .material and .materialgraph (aka templates). Templates contain the shader code and define the input parameters it accepts (e.g. texture paths, colors, thresholds).  Materials execute one shared template and override its default input values as needed.  They sometimes contain their own shader, and templates can execute other templates.  This creates a chain that applies multiple "layers" to the mesh surface.

Inputs are unique to each shader.  There do not appear to be any universal values that apply to all, so you will have to experiment with each.  I've identified 350 of the ID names to display in the tool, but the majority display simply as numbers.  

Usage

Spandex allows you to edit the input values in material/template files.  The window is organized by input type.  If the file contains a shader, its values are shown in the first column, Internal Shader.  If the file refers to an external template, the asset path will be shown at the top of the second column in the Textures section, External Template Overrides.  The tool will look for the template file in the same directory as your material, and if found, its default values are shown in the third column, External Template Defaults.  You nearly always want the template to load so you can see all of the available overrides.  The third column values are not editable, but you can open the template directly.

Most of the time you will focus on the Override columns and make your edits there.  Leaving an override value blank means that the template will use its default value.  The inputs are divided between the two views:

  • Template - Appears in the first row of Texture inputs.  If you change the template path, save and reopen the file to load the new template.
  • Texture - Archive path to a .texture file.  Default values for shaders usually specify an empty "pink" texture rather than leaving the value blank.
  • Float (floating point) - Decimal values that can be used for nearly any kind of shader setting.
    • Single values - Thresholds, light levels, opacity, etc
    • Pairs - Tiling counts, texture offsets
    • 3 values - Usually RGB color values ranging from 0.0 to 1.0
    • 4 values - Probably RGB + Alpha, maybe a quaternion specifying a rotation
  • Integer - Whole number values.  Often these are simply 0 or 1 to turn a feature on or off

Named inputs usually correspond to values that are changed by the game engine during play, such as Damage Opacity or the visibility of a wrinkle map.  Unfortunately, there does not seem to be any information about the range of values the shader will accept.

If you change the template, some override values will appear in red.  This means that the input ID is not available in the new template, and it may cause all of your override values to be rejected.  I've seen this happen with one template and its float values, but I'm not sure it's the case for all them.  I've provided checkboxes that allow you to remove any missing IDs from the saved file.  This is the safest approach while you're trying to determine what each input does.

Autocomplete - For convenience, texture paths can be autocompleted by the tool.  To enable this, generate a Layout.CSV file from the Tools menu of the Mod Tool, and copy it to the same directory (or the working directory) of Spandex.exe.


FAQ

I've spent much more time analyzing the file format and creating the tool than I have actually editing materials.  Your best bet for questions is the modding Discord server.

Is source code available? - https://github.com/hypermorphicmods/Spandex/ . I tried to make the base class reusable for parsing other kinds of game assets.  There are still a few sections of the template format that I haven't deciphered.

How do I change X behavior of the material?  - Trial and error.  Edit the available values and pray that it does what you want. If not, you can try to find a different template/material that is closer to what you're trying to achieve.  If you're savvy and want to analyze the compiled shader code, grab the source code above.  The shaders are extracted by the base class.

Does it work for any other games?
Yes.  I was informed by Linkfla that it works for Ratchet & Clank: Rift Apart, so I added its material resource IDs in v1.0.2.  I do not own or provide any support for this game, but I am willing to add more IDs as other games are identified.