{"id":50197146,"url":"https://github.com/maximecb/tinkerfield","last_synced_at":"2026-05-25T18:33:20.979Z","repository":{"id":358256854,"uuid":"1177492217","full_name":"maximecb/tinkerfield","owner":"maximecb","description":"Toy 3D game engine based on signed distance fields","archived":false,"fork":false,"pushed_at":"2026-05-23T13:40:45.000Z","size":43678,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-05-23T15:23:57.255Z","etag":null,"topics":["3d-graphics","game-development","game-engine","isosurfaces","rust","signed-distance-fields","wgpu"],"latest_commit_sha":null,"homepage":"","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/maximecb.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":"2026-03-10T04:31:44.000Z","updated_at":"2026-05-23T13:40:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/maximecb/tinkerfield","commit_stats":null,"previous_names":["maximecb/tinkerfield"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/maximecb/tinkerfield","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximecb%2Ftinkerfield","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximecb%2Ftinkerfield/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximecb%2Ftinkerfield/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximecb%2Ftinkerfield/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximecb","download_url":"https://codeload.github.com/maximecb/tinkerfield/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximecb%2Ftinkerfield/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33488935,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-25T14:31:05.219Z","status":"ssl_error","status_checked_at":"2026-05-25T14:31:02.878Z","response_time":57,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["3d-graphics","game-development","game-engine","isosurfaces","rust","signed-distance-fields","wgpu"],"created_at":"2026-05-25T18:33:20.339Z","updated_at":"2026-05-25T18:33:20.962Z","avatar_url":"https://github.com/maximecb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# TinkerField\n\nTinkerfield is a toy 3D game engine / construction game based on Signed\nDistance Fields (SDFs), where you can edit the world in real time. It uses\nSDFs for all 3D graphics (no polygons or meshes).\n\nOne of my main goals with this project just to show people we're already at\nthe point where it's possible to build some kind of game engine with SDFs.\nIt doesn't have to be complicated, and you don't need some killer GPU to\nmake it work either.\n\nSupported platforms: macOS and Linux. Windows may work but is untested.\n\nDependencies:\n- The [Rust toolchain](https://www.rust-lang.org/tools/install)\n- wgpu, winit, png crates\n\nRunning the program:\n\n```\ncargo run --release\n```\n\nTo load a map file, pass it as an argument:\n\n```\ncargo run --release maps/city.map\n```\n\nSeveral example maps are provided in the `/maps` directory (`city.map`, `house.map`, `nature.map`).\n\n### Command-Line Options\n\n- `--width \u003cpixels\u003e`: Set the window width (default: 800).\n- `--height \u003cpixels\u003e`: Set the window height (default: 600).\n- `--screenshot \u003cpath\u003e`: Render a single frame, save it as a PNG to the given\n  path, and exit. Can be used as a tool for agents.\n\nFor example, to render a 1920x1080 screenshot of a map:\n\n```\ncargo run --release -- maps/city.map --width 1920 --height 1080 --screenshot city.png\n```\n\n## Controls\n\n### Player Movement\n\n- **W / S** (or Arrow keys): Move forward / backward\n- **A / D** (or Arrow keys): Strafe left / right\n- **Mouse**: Look around\n- **Left Click**: Select the brush under the crosshair\n- **Escape**: Exit\n\n### Brush Management\n\n- **O**: Create a new Box brush in front of the player\n- **T**: Cycle the selected brush's type (Box → Cylinder → Sphere → Cone)\n- **Q**: Toggle the selected brush between Add and Subtract mode\n- **C**: Subtract a cylinder aligned to the camera direction (quick tunnel tool)\n- **Enter**: Deselect the current brush\n- **Delete / Backspace**: Remove the selected brush\n- **N / M**: Cycle to the previous / next material\n- **Ctrl+C / Ctrl+V**: Copy / paste the selected brush\n- **Ctrl+R**: Reload the current map file from disk\n- **Ctrl+S**: Save the world back to the map file\n\n### Edit Modes\n\nSwitch modes with these keys when a brush is selected:\n- **P**: Position mode (default)\n- **X**: Scale/size mode\n- **R**: Rotation mode (work in progress)\n\n### Position and Scale Editing\n\nIn Position and Scale modes, holding a modifier key lets you move or resize\nthe selected brush with the mouse. The edit axes are snapped to world axes\nbased on your facing direction at the moment you press the modifier key.\n\n- **Shift + Mouse**: left/right controls the horizontal axis most aligned with\n  your view, up/down controls the vertical (Y) axis.\n- **Alt + Mouse**: left/right controls the horizontal axis most aligned with\n  your view, up/down controls the horizontal axis most aligned with your\n  forward direction — keeping movement on the ground plane.\n\nPositions and scales snap to a 0.1-unit grid.\n\n## Architecture\n\nThe world is made up of **brushes** — simple shapes (box, cylinder, sphere,\ncone) with a position, rotation, scale, material, and a CSG operation (add or\nsubtract). There are no polygons anywhere; every brush is defined purely by its\nSDF.\n\nTo render efficiently on the GPU, the world is partitioned into a 3D spatial\ngrid where each cell stores a short list of brush indices that overlap it. On\nevery frame, a wgpu compute/render shader ray-marches through this grid: for\neach pixel it steps along the ray cell by cell, evaluates only the brushes\nin the cells it visits, and finds the surface by standard sphere-tracing. This\nkeeps per-pixel SDF evaluation cheap even with many brushes in the scene.\n\nBrushes are stored in a GPU-side buffer and the grid is rebuilt on the CPU\nwhenever the world changes, then re-uploaded. Lighting is a simple diffuse +\nambient model computed in the fragment shader, with materials sampled from a\ntexture atlas.\n\n## Contributing\n\nAll code is licensed under the [MIT License](LICENSE), but textures are\nlicensed as CC0 (public domain).\n\nContributions for algorithmic optimizations and new features are welcome.\nHowever, note that smaller pull requests are more likely to get merged.\nPlease avoid opening pull requests with major design changes without discussing the changes\nyou would like to make first.\n\nNew textures welcome, we could particularly use more seamless materials, as long as they are\nlicensed under CC0 (public domain). Textures should be in 24-bit PNG format, and at a\nresolution of 512 pixels per meter.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximecb%2Ftinkerfield","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximecb%2Ftinkerfield","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximecb%2Ftinkerfield/lists"}