Generate Material Automatically¶
This project provides a tool for automatically generating or overwriting a Material based on the material.json
file.
Basic Usage¶

The results generated by this tool are for reference only. Some detailed properties, such as BackFaceUseUV2
, etc., still need to be manually configured.
Double-clicking on the converted material.json
file opens the HSR Material Viewer
, which makes it easier to browse the contents of the material.json
file.

Tool Extension¶
After importing the HSR.NPRShader.Editor.Automation
namespace, declare a class with a parameterless constructor derived from BaseMaterialSetter
. The following members can be overridden:
Properties¶
Name | Description |
---|---|
Order | Priority. The smaller the number, the higher the priority. |
SupportedShaderMap | Shader map supported by this class. Key is the Shader name in the game, and Value is the converted Shader name in the project. |
Methods¶
The parameters passed in are the corresponding information in the material.json
file, and the methods return a list of properties to be set on the Material.
Name | Description |
---|---|
ApplyTextures | Set the Material's Texture properties. |
ApplyInts | Set the Material's Int properties. |
ApplyFloats | Set the Material's Float properties. |
ApplyColors | Set the Material's Color properties. |