{"id":23864481,"url":"https://github.com/scanmountgoat/smush-material-research","last_synced_at":"2025-08-24T03:37:45.942Z","repository":{"id":40204001,"uuid":"159710183","full_name":"ScanMountGoat/Smush-Material-Research","owner":"ScanMountGoat","description":"Smash Ultimate material and rendering information","archived":false,"fork":false,"pushed_at":"2024-06-26T14:26:52.000Z","size":166828,"stargazers_count":18,"open_issues_count":16,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-06-26T17:39:12.428Z","etag":null,"topics":["lighting","rendering","smash-bros","smash-ultimate","textures"],"latest_commit_sha":null,"homepage":"https://scanmountgoat.github.io/Smush-Material-Research/","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ScanMountGoat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-11-29T18:30:27.000Z","updated_at":"2024-06-26T14:26:30.000Z","dependencies_parsed_at":"2024-05-13T15:12:26.628Z","dependency_job_id":null,"html_url":"https://github.com/ScanMountGoat/Smush-Material-Research","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScanMountGoat%2FSmush-Material-Research","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScanMountGoat%2FSmush-Material-Research/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScanMountGoat%2FSmush-Material-Research/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ScanMountGoat%2FSmush-Material-Research/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ScanMountGoat","download_url":"https://codeload.github.com/ScanMountGoat/Smush-Material-Research/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":232310594,"owners_count":18503480,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["lighting","rendering","smash-bros","smash-ultimate","textures"],"created_at":"2025-01-03T08:26:28.351Z","updated_at":"2025-01-03T08:26:28.956Z","avatar_url":"https://github.com/ScanMountGoat.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Smash Ultimate Material Research\nA collection of dumps, scripts, and markdown files for research into lighting, shading, rendering, and materials for Smash Ultimate.\nThe markdown files contain information on researched values for materials and can be viewed directly\nin 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).\n\n# [Website](https://scanmountgoat.github.io/Smush-Material-Research/)\nThe 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). \n\n# Generating Data - WIP\nMost 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`.    \n\n## SQLite Material Database\nMost 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.\n\n## XMB to XML\n`cargo run --release -- xmb \u003cARC root folder\u003e \u003cexport folder\u003e`\n\n## Stage Light NUANMB JSON\n`cargo run --release -- stage-lighting \u003cARC root folder\u003e \u003cexport folder\u003e`\n\n## Shader Info\nGenerates 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.\n\n`cargo run --release -- shader-info \u003cnuc2effectlibrary.nufxlb\u003e \u003cshader binary folder\u003e \u003cdecompiled source folder\u003e \u003coutput JSON\u003e`  \n\n## Shader Database\nThe JSON dump of the Nufx file can be converted to an SQLite database for more efficient querying.  \n`python create_shader_db.py nuc2effectlibrary.json nufx.db`  \nThe file contains duplicate entries for each render pass (_opaque, _sort, etc). These entries can be removed by adding the `--remove_duplicates` flag.  \n`python create_shader_db.py nuc2effectlibrary.json nufx.db --remove_duplicates`   \n\n## Nushdb Metadata\nGenerates 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.\n\n`cargo run --release -- nushdb-metadata \u003c/render/shader/bin folder\u003e \u003cexport folder\u003e`  \n\n## Shader Binaries\nExtracts the shader binaries from the .nushdb files since each file contains multiple shaders.  \n`cargo run --release -- shader-binaries \u003c/render/shader/bin folder\u003e \u003cbinary export folder\u003e`  \n\n## Decompiled Shaders\nThe shaders can be decompiled using Ryujinx's ShaderTools.  \n`cargo run --release -- shader-binaries \u003cbinary export folder\u003e \u003cexport folder\u003e \u003cShaderTools.exe\u003e `  \n\n## Annotated Decompiled Shaders\nReplaces 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.  \n \n`cargo run --release -- annotate-decompiled-shaders \u003cdecompiled shaders\u003e \u003c/render/shader/bin folder\u003e \u003cexport folder\u003e`\n\n## GLSL Dependencies\nFinds 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.\n \n`cargo run --release -- glsl_dependencies \u003cGLSL input file\u003e \u003cGLSL output file\u003e \u003cvar\u003e`  \n`cargo run --release -- glsl_dependencies \"SunShaft1PS.glsl\" \"out.glsl\" OUT_color.x`  \n\n# Additional Tools\n[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  \n[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  \n[Ryujinx](https://ryujinx.org/) - Nintendo Switch emulator used for the research and documentation of in game rendering.  \nYuzu - Nintendo Switch emulator used for early research. Not recommended for research due to its decompiled shaders and rendering commands being structured differently than Ryujinx.  \n[RenderDoc](https://renderdoc.org/) - a powerful GPU debugging program that can be used with Ryujinx or Yuzu to analyze in game rendering.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscanmountgoat%2Fsmush-material-research","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscanmountgoat%2Fsmush-material-research","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscanmountgoat%2Fsmush-material-research/lists"}