{"id":24072953,"url":"https://github.com/markusmoenig/rusterix","last_synced_at":"2025-06-20T04:05:07.332Z","repository":{"id":267944042,"uuid":"902300041","full_name":"markusmoenig/Rusterix","owner":"markusmoenig","description":"Rusterix is a fast software renderer and a retro game engine with support for procedural  content.","archived":false,"fork":false,"pushed_at":"2025-06-13T06:19:08.000Z","size":8986,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T22:15:57.020Z","etag":null,"topics":["2d-graphics","3d-graphics","game-engine","software-rendering"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markusmoenig.png","metadata":{"files":{"readme":"Readme.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE-APACHE","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},"funding":{"github":"markusmoenig","patreon":"eldiron","custom":"paypal.me/markusmoenigos"}},"created_at":"2024-12-12T09:51:08.000Z","updated_at":"2025-06-13T06:19:11.000Z","dependencies_parsed_at":"2025-01-13T11:31:42.643Z","dependency_job_id":"71d345ff-1232-4f50-ac99-7519afad3d70","html_url":"https://github.com/markusmoenig/Rusterix","commit_stats":null,"previous_names":["markusmoenig/rusterix"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/markusmoenig/Rusterix","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FRusterix","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FRusterix/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FRusterix/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FRusterix/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markusmoenig","download_url":"https://codeload.github.com/markusmoenig/Rusterix/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markusmoenig%2FRusterix/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260448212,"owners_count":23010632,"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":["2d-graphics","3d-graphics","game-engine","software-rendering"],"created_at":"2025-01-09T17:24:11.014Z","updated_at":"2025-06-20T04:05:02.318Z","avatar_url":"https://github.com/markusmoenig.png","language":"Rust","funding_links":["https://github.com/sponsors/markusmoenig","https://patreon.com/eldiron","paypal.me/markusmoenigos"],"categories":[],"sub_categories":[],"readme":"![Logo](images/screenshot_map.png)\n\n\nRusterix is a fast software renderer and a retro game engine with support for procedural content.\n\n---\n\n## How it works\n\nRusterix uses a multi-threaded, tile-based renderer and organizes 2D and 3D meshes into batches. It precomputes the bounding boxes and triangle edges for each batch during projection.\n\nThe main goal is to achieve a single rendering pass to maximize parallelization. The batching system makes this possible while also enabling grouping and optimizations for individual objects and content.\n\nBecause of these optimizations, Rusterix is not a general-purpose abstraction of a hardware rendering pipeline (for that, consider using the excellent [euc](https://github.com/zesterer/euc)). Instead, it features a custom pipeline specifically optimized for software rendering and operates within a fixed color space.\n\nRendering a rectangle and a 3D cube is as easy as:\n\n```rust\n// Create a scene with a static 2D rectangle and a box\nlet scene = Scene::from_static(\n    vec![Batch::from_rectangle(0.0, 0.0, 200.0, 200.0)],\n    vec![Batch::from_box(-0.5, -0.5, -0.5, 1.0, 1.0, 1.0).sample_mode(SampleMode::Nearest)],\n)\n.background(Box::new(VGrayGradientShader::new())) // Apply a background shader\n.textures(vec![Tile::from_texture(Texture::from_image(Path::new(\"images/logo.png\")))]); // And add a tile with one texture\n\n// Create a camera\nlet camera = D3OrbitCamera::new();\n\nlet width = 800;\nlet height = 600;\nlet mut pixels = vec![0; width * height * 4];\n\n// Rasterize the scene\nRasterizer::setup(\n    None, // No 2D projection matrix\n    self.camera.view_matrix(),\n    self.camera\n        .projection_matrix(ctx.width as f32, ctx.height as f32),\n)\n.rasterize(\n    \u0026mut self.scene,\n    pixels,  // Destination buffer\n    width,\n    height,\n    200,     // Tile size used per thread\n);\n```\n\n## Rusterix as a Game Engine (WiP)\n\nRusterix has built in procedural map generation and entity management. The map for the above screenshot was built with the following script in the `minigame` folder. The game engine is not yet fully functional and is under development.\n\n```python\nset(\"sky_tex\", \"sky\")\n\nset_default(\"wall_tex\", \"brickwall\")\nset_default(\"floor_tex\", \"brickfloor\")\nset_default(\"wall_height\", 2.0)\n\nbox_size = 15\n\n# big room\nwall(box_size)\nturn_right()\nwall(box_size)\nturn_right()\nwall(5)\nwall(1)\nset(\"wall_tex\", \"lightpanel\")\nadd_point_light(\"#ffffbb\", 2.0, 2.0, 13.0)\nwall(9)\nturn_right()\nwall(box_size)\n\n# fenced area consisting of 2 walls\nset_default(\"wall_tex\", \"fence\")\nmove_to(6, box_size)\nwall(6)\nturn_left()\nwall(6)\n```\n\nDocumentation for Rusterix will be provided soon at Rusterix.com.\n\n## Goals and Status\n\nOnce finished, you will be able to use Rusterix in several different ways:\n\n* As a library to rasterize 2D and 3D meshes, WIP. See the `Cube` and `Obj` examples.\n* As a retro game engine with text driven content, like Doom style map generation using Python based scripts.\n\nMy goals for both of these use cases:\n\n* Fast software based rendering.\n* Procedural materials and particles for in game effects and content.\n* Texture based and procedural entities / characters.\n\n## Implemented Features\n\n* Fast software-based rendering.\n* Supports batches of 2D and 3D geometry, each with configurable parameters (e.g., DrawMode, SamplingMode, CullingMode, RepeatMode, TextureIndex, etc.).\n* Shaders can be applied to the screen or individual batches.\n* Optional distance based UV jittering for avoiding Moire patterns.\n* Point, Distance, Spot and Area lights.\n* Modular, trait based Orbit, Isometric and First Person cameras.\n\n## Motivation\n\nI use `rusterix` as the rendering engine for my [Eldiron](https://github.com/markusmoenig/Eldiron) project. But it makes sense to split it out into a re-usable library and engine.\n\n## Examples\n\nTo execute an example just do something like ```cargo run --release --example cube```.\n\n* **cube** displays a textured cube. ![Cube](images/screenshot_cube.png)\n\n* **obj** demonstrates how to load and display an obj file. ![Logo](images/screenshot_obj.png)\n\n* **map** displays the map scene above. Walk around using the WASD keys.\n\n## Disclaimer\n\nRusterix is an independent project and is not affiliated with or endorsed by the Rust programming language team or the Rust Foundation. All trademarks are the property of their respective owners.\n\n## License\n\n`rusterix` is distributed under either of:\n\n- Apache License, Version 2.0, (LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0)\n\n- MIT license (LICENSE-MIT or http://opensource.org/licenses/MIT)\n\nat the discretion of the user.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusmoenig%2Frusterix","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkusmoenig%2Frusterix","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkusmoenig%2Frusterix/lists"}