{"id":31763988,"url":"https://github.com/supernovaengine/supershader","last_synced_at":"2025-10-09T23:39:24.026Z","repository":{"id":40123958,"uuid":"372563719","full_name":"supernovaengine/supershader","owner":"supernovaengine","description":"Cross-compiler command line tool that converts GLSL code to other GLSL versions, HLSL and MSL","archived":false,"fork":false,"pushed_at":"2025-09-08T00:48:16.000Z","size":10355,"stargazers_count":6,"open_issues_count":0,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-08T02:36:13.606Z","etag":null,"topics":["glsl","glslang","mlsl","msl","shader","spirv-cross","toolset","transcompiler"],"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/supernovaengine.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-05-31T16:11:06.000Z","updated_at":"2025-09-08T00:48:30.000Z","dependencies_parsed_at":"2024-01-12T23:37:07.384Z","dependency_job_id":"beba940b-9a55-4f67-b196-97985e597d59","html_url":"https://github.com/supernovaengine/supershader","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/supernovaengine/supershader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supernovaengine%2Fsupershader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supernovaengine%2Fsupershader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supernovaengine%2Fsupershader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supernovaengine%2Fsupershader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/supernovaengine","download_url":"https://codeload.github.com/supernovaengine/supershader/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/supernovaengine%2Fsupershader/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002311,"owners_count":26083340,"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","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["glsl","glslang","mlsl","msl","shader","spirv-cross","toolset","transcompiler"],"created_at":"2025-10-09T23:39:12.566Z","updated_at":"2025-10-09T23:39:24.019Z","avatar_url":"https://github.com/supernovaengine.png","language":"C++","readme":"## Supershader: Cross-compiler for shader language\n\n**Supershader** is a command line tool that converts GLSL code to other GLSL versions, HLSL and MSL.\n\nIt is used in [Supernova](https://github.com/supernovaengine/supernova) engine as shader creation tool.\n\n\n### Build\n\n1. Download glslang external libs (SPIRV-Tools)\n\n```bash\ncd libs/glslang/\npython update_glslang_sources.py\n```\n\n2. Supershader uses CMake\n\n```bash\ncmake -S $SOURCE_DIR -B $BUILD_DIR\n\ncmake --build $BUILD_DIR --config Release\n# \"Release\" (for --config) could also be \"Debug\", \"MinSizeRel\", or \"RelWithDebInfo\"\n```\n\n\n### Usage\n```bash\n./supershader --vert=shader.vert --frag=shader.frag ---defines \"USE_UV=1; HAS_TEXTURE\" --lang glsl330 --output shaderoutput\n```\n\n#### Arguments\n```\n    -h, --help                show this help message and exit\n    -v, --vert=\u003cstr\u003e          vertex shader input file\n    -f, --frag=\u003cstr\u003e          fragment shader input file\n    -l, --lang=\u003cstr\u003e          \u003csee below\u003e shader language output\n    -o, --output=\u003cstr\u003e        output file template (extension is ignored)\n    -t, --output-type=\u003cstr\u003e   output in json or binary shader format\n    -I, --include-dir=\u003cstr\u003e   include search directory\n    -D, --defines=\u003cstr\u003e       preprocessor definitions, seperated by ';'\n    -L, --list-includes       print included files\n```\n\n#### Current supported shader stages:\n- Vertex shader (--vert)\n- Fragment shader (--frag)\n\n#### Current supported shader langs:\n- glsl330: desktop (default)\n- glsl100: GLES2 / WebGL\n- glsl300es: GLES3 / WebGL2\n- hlsl4: D3D11\n- hlsl5: D3D11\n- msl12macos: Metal for MacOS\n- msl21macos: Metal for MacOS\n- msl12ios: Metal for iOS\n- msl21ios: Metal for iOS\n\n#### Output format types:\n- json\n- binary (SBS file)\n\n#### Output\nFor default Supershader output format is json with reflection info and bare shader output:\n\n```bash\n./supershader --vert=shader.vert --frag=shader.frag --output shaderoutput  --lang glsl330\n```\n* Output: ```shaderoutput_glsl.json```, ```shaderoutput_vs.glsl```, ```shaderoutput_fs.glsl```\n\nWith ```--output-type=binary``` argument we have .sbs binary file:\n\n```bash\n./supershader --vert=shader.vert --frag=shader.frag --output shaderoutput  --lang glsl330 --output-type=binary\n```\n* Output: ```shaderoutput.sbs```\n\n\n### SBS file format\n\u003e Inspired by **septag** file format: [sgs-file.h](https://github.com/septag/glslcc/blob/master/src/sgs-file.h)\n\nEach block header is 8 bytes ( uint32_t fourcc code + uint32_t for size).\n- **SBS** block\n\t- **struct sbs_chunk**\n\t- **STAG** blocks: defines each shader stage (vs or fs)\n        - **struct sbs_stage**\n\t\t- **[CODE or DATA]** block: actual code or binary (byte-code) data for the shader stage\n\t\t- **REFL** block: Reflection data for the shader stage\n\t\t- **struct sbs_chunk_refl**: reflection data header\n\t\t- **struct sbs_refl_input[]**: array of vertex-shader input attributes (see `sbs_chunk_refl` for number of inputs)\n\t\t- **struct sbs_refl_texture[]**: array of texture objects (see `sbs_chunk_refl` for number of textures)\n\t\t- **struct sbs_refl_sampler[]**: array of sampler objects (see `sbs_chunk_refl` for number of samplers)\n\t\t- **struct sbs_refl_texture_sampler[]**: array of texture-sampler pair objects (see `sbs_chunk_refl` for number of pairs)\n\t\t- **struct sbs_refl_uniformblock[]**: array of uniform blocks objects (see `sbs_chunk_refl` for number of uniform blocks)\n\t\t\t- **struct sbs_refl_uniform[]**: array of uniform objects (see `sbs_refl_uniformblock.num_uniforms` for number of uniforms)\n\n### Updates\n\n#### 1.6\n- Shader bindings adjustments\n- New sbs file version\n\n#### 1.5\n- Storage buffer support\n- New sbs file version\n\n#### 1.4\n- Changed json to be default output type format\n- Created sampler and texture-sampler pair blocks\n- Input and output shaders validation\n\n#### 1.3\n- Changed json and sbs file spec to support uniform blocks with float and int types inside\n- Changed sbs file spec to support uniforms\n\n#### 1.2\n- Option to disable optimization\n- Fixed optimization errors\n\n#### 1.1\n- Full Metal support\n- Shader lang defines\n\n#### 1.0\n- First version\n\n### Inspired by\n- sokol-shdc (https://github.com/floooh/sokol-tools/blob/master/docs/sokol-shdc.md)\n- glslcc (https://github.com/septag/glslcc)\n\n\n### External libraries\n- glslang (https://github.com/KhronosGroup/glslang)\n- SPIRV-Cross (https://github.com/KhronosGroup/SPIRV-Cross)\n- nlohmann json (https://github.com/nlohmann/json)\n- argparse (https://github.com/cofyc/argparse)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupernovaengine%2Fsupershader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsupernovaengine%2Fsupershader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsupernovaengine%2Fsupershader/lists"}