https://github.com/scanmountgoat/smush-material-research
Smash Ultimate material and rendering information
https://github.com/scanmountgoat/smush-material-research
lighting rendering smash-bros smash-ultimate textures
Last synced: 10 months ago
JSON representation
Smash Ultimate material and rendering information
- Host: GitHub
- URL: https://github.com/scanmountgoat/smush-material-research
- Owner: ScanMountGoat
- License: mit
- Created: 2018-11-29T18:30:27.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-06-26T14:26:52.000Z (almost 2 years ago)
- Last Synced: 2024-06-26T17:39:12.428Z (almost 2 years ago)
- Topics: lighting, rendering, smash-bros, smash-ultimate, textures
- Language: Rust
- Homepage: https://scanmountgoat.github.io/Smush-Material-Research/
- Size: 159 MB
- Stars: 18
- Watchers: 5
- Forks: 8
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Smash Ultimate Material Research
A collection of dumps, scripts, and markdown files for research into lighting, shading, rendering, and materials for Smash Ultimate.
The markdown files contain information on researched values for materials and can be viewed directly
in the browser. Please submit an issue or pull request for any incorrect or missing information. Ask questions or discuss in game rendering using [discussions](https://github.com/ScanMountGoat/Smush-Material-Research/discussions).
# [Website](https://scanmountgoat.github.io/Smush-Material-Research/)
The repository has a website for tutorials and real time demos. If any pages don't load properly or one of the demos is messed up, report the bug in [issues](https://github.com/ScanMountGoat/Smush-Material-Research/issues).
# Generating Data - WIP
Most of the dumps are generated using the `smush_materials` Rust project. The Rust toolchain can be installed from https://www.rust-lang.org/tools/install. Build the project with `cargo build --release`. For commandline usage, run `cargo run --release -- --help`.
## SQLite Material Database
Most of the data is stored in an SQLite database generated by the program in the [Smush-Material-DB](https://github.com/ScanMountGoat/Smush-Material-DB) repo. The repo contains instructions for how to build and run the tool. The database can be used with the provided python scripts for data visualization even without any SQL knowledge.
## XMB to XML
`cargo run --release -- xmb `
## Stage Light NUANMB JSON
`cargo run --release -- stage-lighting `
## Shader Info
Generates the shader info JSON with rendering related information used by ssbh_wgpu. This includes the required material parameters and vertex attributes from the nufxlb as well as data mined from the decompiled source code like alpha testing and accessed color channels for parameters and attributes.
`cargo run --release -- shader-info `
## Shader Database
The JSON dump of the Nufx file can be converted to an SQLite database for more efficient querying.
`python create_shader_db.py nuc2effectlibrary.json nufx.db`
The file contains duplicate entries for each render pass (_opaque, _sort, etc). These entries can be removed by adding the `--remove_duplicates` flag.
`python create_shader_db.py nuc2effectlibrary.json nufx.db --remove_duplicates`
## Nushdb Metadata
Generates a separate JSON metadata file for each of the shaders in the nushdb files. This metadata describes how material inputs are mapped to the shader code.
`cargo run --release -- nushdb-metadata `
## Shader Binaries
Extracts the shader binaries from the .nushdb files since each file contains multiple shaders.
`cargo run --release -- shader-binaries `
## Decompiled Shaders
The shaders can be decompiled using Ryujinx's ShaderTools.
`cargo run --release -- shader-binaries `
## Annotated Decompiled Shaders
Replaces input and output attributes, textures, and uniforms in the decompiled shaders using variable names from the nushdb metadata. See [shaders](https://github.com/ScanMountGoat/Smush-Material-Research/blob/master/Shaders.md) for details. The start of the main function contains declarations for uniform parameters. Not all parameters are used in the actual code.
`cargo run --release -- annotate-decompiled-shaders `
## GLSL Dependencies
Finds all the lines of a decompiled GLSL shader that contribute to the final assignment of the given variable. This is helpful when trying to analyze the source code related to a particular variable since only the relevant lines are added to the output file. This command works with any decompiled GLSL shader, but the annotated source files will be easier to interpret.
`cargo run --release -- glsl_dependencies `
`cargo run --release -- glsl_dependencies "SunShaft1PS.glsl" "out.glsl" OUT_color.x`
# Additional Tools
[ssbh_lib](https://github.com/ultimate-research/ssbh_lib) - Contains the `ssbh_lib_json` and `ssbh_data_json` executables for editing various rendering related file types as JSON
[xmb_lib](https://github.com/ultimate-research/xmb_lib) - Contains the `xmb` executable that can be used to convert XMB files to and from XML
[Ryujinx](https://ryujinx.org/) - Nintendo Switch emulator used for the research and documentation of in game rendering.
Yuzu - Nintendo Switch emulator used for early research. Not recommended for research due to its decompiled shaders and rendering commands being structured differently than Ryujinx.
[RenderDoc](https://renderdoc.org/) - a powerful GPU debugging program that can be used with Ryujinx or Yuzu to analyze in game rendering.