{"id":26102488,"url":"https://github.com/straightcurve/ryuko","last_synced_at":"2026-05-25T03:36:04.342Z","repository":{"id":267496168,"uuid":"901431829","full_name":"straightcurve/ryuko","owner":"straightcurve","description":"transpiler from a custom shader language to GLSL","archived":false,"fork":false,"pushed_at":"2025-03-09T14:30:05.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-09T15:27:37.487Z","etag":null,"topics":["cpp20","glsl","parser","transpiler"],"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/straightcurve.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":"2024-12-10T16:40:40.000Z","updated_at":"2025-03-09T14:30:09.000Z","dependencies_parsed_at":"2024-12-10T18:19:08.426Z","dependency_job_id":"55753625-8544-4d75-9bee-d4a5eae5e076","html_url":"https://github.com/straightcurve/ryuko","commit_stats":null,"previous_names":["straightcurve/ryuko"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightcurve%2Fryuko","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightcurve%2Fryuko/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightcurve%2Fryuko/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/straightcurve%2Fryuko/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/straightcurve","download_url":"https://codeload.github.com/straightcurve/ryuko/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242744061,"owners_count":20178171,"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":["cpp20","glsl","parser","transpiler"],"created_at":"2025-03-09T19:42:04.304Z","updated_at":"2025-12-25T03:02:54.401Z","avatar_url":"https://github.com/straightcurve.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ryuko\n\n`ryuko`(流光, meaning \"flowing light\") is a transpiler from a custom shader language to GLSL.\n\n## Features\n\n1. Shader Parsing\n\n   Parses GLSL code to extract functions and varyings.\n\n2. Transformation\n\n   Modifies main shader functions' return values, ensuring compatibility with Vulkan requirements:\n    - Vertex shader: `vert()`'s return expression is converted into assignment to `gl_Position`.\n    - Fragment shader: `frag()`'s return expression is assigned to a custom `out` variable.\n\n3. GLSL Code Emission\n\n   Transpiles and emits modified vertex and fragment shader code to separate GLSL files.\n\n4. Error Handling\n\n   Provides detailed error messages with formatted outputs for easier debugging.\n\n## Getting Started\n\n### Prerequisites\n\n- C++ Compiler: Requires a compiler that supports C++20.\n- Libraries:\n    - fmt: For formatted text output.\n- CMake: Building the project.\n- [mei](https://github.com/straightcurve/mei): Building the project.\n\n⚠️ Requires the `fmt` [xrepo](https://xrepo.xmake.io/) package to be installed. It can be installed with:\n\n```bash\nxrepo install -y fmt\n```\n\n## Compilation\n\n### Clone the repository:\n\n```bash\ngit clone https://github.com/straightcurve/ryuko.git\ncd ryuko\n```\n\n### Generate CMakeLists.txt\n\n```bash\nnpx @sweetacid/mei\n```\n\n### Create a build directory:\n\n```bash\nmkdir build \u0026\u0026 cd build\n```\n\n### Configure and build:\n\n```bash\ncmake ..\nmake\n```\n\n## Code Structure\n\n### Parser\n\nExtracts functions, varyings and shader version.\n\n### Transpiler\n\nModifies shader code to align with Vulkan requirements:\n\n- Rewrites `return` statements into appropriate assignments.\n- Adds varying variable declarations when necessary.\n\n### Emitter\n\nResponsible for emitting the final GLSL code:\n\n- Ensures functions are emitted in dependency order.\n- Handles GLSL version declarations and varying declarations.\n\n### Main Functionality (`transpile`)\n\nOrchestrates the parsing, transpiling and emission of shaders.\n\n## Example Input/Output\n\n### Input Shader:\n\n```glsl\n#version 450\n\nvarying vec4 Position;\nvarying vec4 Color;\n\nvec4 vert() {\n    Color = vec4(Position.zyx, 1.0);\n\n    return vec4(Position.xyz, 1.0);\n}\n\nvec4 frag() {\n    return Color;\n}\n```\n\n### Output Vertex Shader:\n\n```glsl\n#version 450\n\nlayout (location = 0) in vec4 Position;\nlayout (location = 0) out vec4 Color;\n\nvoid main() {\n    Color = vec4(Position.zyx, 1.0);\n    gl_Position = vec4(Position.xyz, 1.0);\n}\n```\n\n### Output Fragment Shader:\n\n```glsl\n#version 450\n\nlayout (location = 0) in vec4 Color;\nlayout (location = 0) out vec4 ryuko_outColor;\n\nvoid main() {\n    ryuko_outColor = Color;\n}\n```\n\n## Error Handling\n\nReports errors such as:\n\n- Missing vertex or fragment main functions.\n- Invalid GLSL syntax __(partial)__.\n- Parsing failures due to unsupported constructs.\n\n## License\n\nThis project is licensed under the MIT License. See the LICENSE file for details.\n\n## Contributing\n\nContributions are welcome! Feel free to submit issues or pull requests for bug fixes, enhancements, or additional\nfeatures.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraightcurve%2Fryuko","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstraightcurve%2Fryuko","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstraightcurve%2Fryuko/lists"}