{"id":13661176,"url":"https://github.com/needle-tools/shader-variant-explorer","last_synced_at":"2025-04-24T23:32:01.415Z","repository":{"id":65758000,"uuid":"383635530","full_name":"needle-tools/shader-variant-explorer","owner":"needle-tools","description":"Shader Variant Explorer lets you peek into Unity's shader compilation process to better understand the composition of shader files.","archived":false,"fork":false,"pushed_at":"2023-10-12T01:58:10.000Z","size":214,"stargazers_count":66,"open_issues_count":1,"forks_count":5,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-24T08:04:51.186Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"C#","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/needle-tools.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":null,"license":"License.md","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":"2021-07-07T00:59:50.000Z","updated_at":"2025-01-10T16:49:39.000Z","dependencies_parsed_at":"2024-08-02T05:20:24.514Z","dependency_job_id":null,"html_url":"https://github.com/needle-tools/shader-variant-explorer","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/needle-tools%2Fshader-variant-explorer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/needle-tools%2Fshader-variant-explorer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/needle-tools%2Fshader-variant-explorer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/needle-tools%2Fshader-variant-explorer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/needle-tools","download_url":"https://codeload.github.com/needle-tools/shader-variant-explorer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250727725,"owners_count":21477360,"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":[],"created_at":"2024-08-02T05:01:30.673Z","updated_at":"2025-04-24T23:31:56.404Z","avatar_url":"https://github.com/needle-tools.png","language":"C#","funding_links":[],"categories":["C\\#"],"sub_categories":[],"readme":"# Shader Variant Explorer\n\n![Unity Version Compatibility](https://img.shields.io/badge/Unity-2020.3%20%E2%80%94%202021.2-brightgreen) \n\n## What's this?\n\nShader Variant Explorer lets you peek into Unity's shader compilation process and understand the composition of shader files better.  \nUnder the hood, existing Unity tools and APIs are exposed with a fast-to-use UI.\n\n## Installation 💾\n\nShader Variant Explorer is available on OpenUPM: https://openupm.com/packages/com.needle.shader-variant-explorer  \n\n1. \n    \u003cdetails\u003e\n    \u003csummary\u003eAdd the OpenUPM registry with the \u003ccode\u003ecom.needle\u003c/code\u003e scope to your project\u003c/summary\u003e\n\n    - open \u003ckbd\u003eEdit/Project Settings/Package Manager\u003c/kbd\u003e\n    - add a new Scoped Registry:\n    ```\n    Name: OpenUPM\n    URL:  https://package.openupm.com/\n    Scope(s): com.needle\n    ```\n    - click \u003ckbd\u003eSave\u003c/kbd\u003e\n    \u003c/details\u003e\n2. Add this package:\n   - open \u003ckbd\u003eWindow/Package Manager\u003c/kbd\u003e\n   - click \u003ckbd\u003e+\u003c/kbd\u003e\n   - click \u003ckbd\u003eAdd package from git URL\u003c/kbd\u003e or \u003ckbd\u003eAdd package by name\u003c/kbd\u003e\n   - paste `com.needle.shader-variant-explorer`\n   - click \u003ckbd\u003eAdd\u003c/kbd\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cem\u003eAlternative: git package (no PackMan updates, not recommended)\u003c/em\u003e\u003c/summary\u003e  \n\n   - open \u003ckbd\u003eWindow/Package Manager\u003c/kbd\u003e\n   - click \u003ckbd\u003e+\u003c/kbd\u003e\n   - click \u003ckbd\u003eAdd package from git URL\u003c/kbd\u003e or \u003ckbd\u003eAdd package by name\u003c/kbd\u003e  \n   - paste `https://github.com/needle-tools/shader-variant-explorer.git?path=package`  \n   - click \u003ckbd\u003eAdd\u003c/kbd\u003e\n\n\u003c/details\u003e\n\nYou can open the **Shader Variant Explorer** by selecting `Window \u003e Analysis \u003e Shader Variant Explorer`.\n\n## How to use 💡\n\n1. Open `Window \u003e Analysis \u003e Shader Variant Explorer`  \n2. Select a shader file  \n3. Click \u003ckbd\u003ePreprocess\u003c/kbd\u003e. This will run Unity's shader preprocessor, extract line and file information, and collect used keywords.  \n     _Note: due to a limitation in Unity's APIs, this will open the resulting file. Just ignore that for now._  \n4. Scroll through the preprocessor result. You can double-click lines to quickly jump to their original source file.  \n5. Press \u003ckbd\u003eCollapse Files\u003c/kbd\u003e to see a structural overview of the shader (which files is it composed of, and in which order).  \n6. In the top toolbar, you can choose the shader compilation target, e.g. `Vulkan`. Clicking \u003ckbd\u003ePreprocess\u003c/kbd\u003e again will update the results.   \n     _Note: some targets might not work or crash the shader compiler, e.g. PS5 will crash if you don't have that Unity module installed._  \n7. Click on \u003ckbd\u003eSelect Keyword Combination\u003c/kbd\u003e to choose which variant you want to see.  \n   You can also use the breadcrumb navigation to add/remove keywords.  \n\n8. Once you chose some keywords, you can also click \u003ckbd\u003eSelect Filtered Combination\u003c/kbd\u003e to pick from the remaining valid options.  \n\n9. (on 2021.2+) you can also compile _just_ the selected keyword variant by clicking \u003ckbd\u003eCompile selected variant\u003c/kbd\u003e or enabling \u003ckbd\u003eAuto Compile\u003c/kbd\u003e in the right pane.\n    \n## Known Issues 🦴\n\nThe shader compiler and preprocessor will crash in some combinations.  \nAlso, you might find Unity shader bugs.  \n- if you create a new surface shader and select `DIRECTIONAL_COOKIE` — one of the valid variants returned by the preprocessor — you'll get a shader compile error)  \n\nPressing the \u003ckbd\u003eCompile\u003c/kbd\u003e button can take ages, depending on which shader you're trying to compile.  \n- URP/Lit compiles into a 2GB file\n- haven't dared to check HDRP/Lit.\n\nIn some cases, the shader compiler seems to crash completely. From then on, only empty files are returned; you'll need to restart Unity. \n\n## Contact ✒️\n\u003cb\u003e[needle — tools for unity](https://needle.tools)\u003c/b\u003e • \n[Discord Community](https://discord.gg/UHwvwjs9Vp) • \n[@NeedleTools](https://twitter.com/NeedleTools) • \n[@marcel_wiessler](https://twitter.com/marcel_wiessler) • \n[@hybridherbst](https://twitter.com/hybridherbst)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneedle-tools%2Fshader-variant-explorer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fneedle-tools%2Fshader-variant-explorer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fneedle-tools%2Fshader-variant-explorer/lists"}