{"id":23577303,"url":"https://github.com/wooster0/soft","last_synced_at":"2025-07-12T04:36:34.632Z","repository":{"id":62399811,"uuid":"560293841","full_name":"wooster0/soft","owner":"wooster0","description":"A software renderer","archived":false,"fork":false,"pushed_at":"2023-09-20T14:52:29.000Z","size":283,"stargazers_count":16,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-05T23:14:17.614Z","etag":null,"topics":["2d","graphics","opengl","software-renderer","vulkan","webassembly","zig"],"latest_commit_sha":null,"homepage":"","language":"Zig","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/wooster0.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}},"created_at":"2022-11-01T06:43:36.000Z","updated_at":"2025-02-25T09:19:25.000Z","dependencies_parsed_at":"2023-07-23T17:52:42.517Z","dependency_job_id":null,"html_url":"https://github.com/wooster0/soft","commit_stats":null,"previous_names":["wooster0/wool","wooster0/soft"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooster0%2Fsoft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooster0%2Fsoft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooster0%2Fsoft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wooster0%2Fsoft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wooster0","download_url":"https://codeload.github.com/wooster0/soft/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252590632,"owners_count":21772940,"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","opengl","software-renderer","vulkan","webassembly","zig"],"created_at":"2024-12-26T22:28:40.978Z","updated_at":"2025-05-05T23:14:23.829Z","avatar_url":"https://github.com/wooster0.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\n  Soft - a software renderer (GPU is not used)\n\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003e\n  \u003ci\u003eDrawing graphics anywhere!\u003c/i\u003e\n\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003cimg alt=\"Ferris\" src=\"demo.png\" /\u003e\n  \u003cp align=\"center\"\u003e\n    \u003ci\u003e\u003cb\u003eThe \u003ca href=\"examples/metaballs.zig\"\u003emetaballs\u003c/a\u003e example running in the UEFI (TODO: build.zig broken ATM), on the web, in the terminal, and natively using OpenGL\u003c/b\u003e\u003c/i\u003e\n  \u003c/p\u003e\n\u003c/p\u003e\n\n## Usage\n\nFor now, until we have a [package manager](https://github.com/ziglang/zig/issues/943), copying this directory (not just `src/` as it doesn't include `LICENSE`)\ninto a `lib/` of yours might have to do. You can do something like this in your `build.zig`:\n```zig\n    exe.addPackagePath(\"soft\", \"lib/src/main.zig\");\n```\n\n## Building \u0026 Running examples\n\nRun `zig build --help` and see `Project-Specific Options`:\n```\n  -Dexample=[string]           The example to run (pass \"help\" for a list)\n  -Dbackend=[string]           The backend to use for examples and tests:\n                               none, opengl, terminal, uefi, vulkan, web (default: terminal)\n```\n\nThis means e.g. `zig build run -Dexample=rectangle -Dbackend=terminal` will build and run the `examples/rectangle.zig` example in your terminal (Ctrl+C to quit).\n\n## Goals\n\n* Have a simple, portable way to show graphics on the screen, using the CPU.\n* Easy integration into any environment.\n* Ability to test graphics output:\n  Often in graphics and video games it's hard to test output accurately.\n  Soft being a software renderer, it's easy to accurately test graphics output. The GPU is not used and all pixels are rendered by hand.\n* Reusability and flexibility:\n  As an example, a single `drawRect` serves to draw rectangles with solid colors, gradients, rounded corners, everything.\n  All this keeps the library small yet powerful.\n\n## Application\n\n* **Video games**:\n  Soft provides a lot of primitives for making video games.\n* **Embedded**:\n  The microcontroller you're developing for may not have a GPU.\n* **GUIs**:\n  Soft provides a solid base for creating graphical user interfaces.\n* **Emulators**:\n  Many older systems work in a similar fashion to framebuffers and didn't use GPUs as advanced as we have them today.\n  This means Soft might be a good fit for emulators.\n* **Prototyping and experimentation**:\n  Soft is very easy to use and quickly lets you draw something to the screen.\n  This makes Soft an excellent candidate for experiments.\n  A great example of this use case in practice can be found at `examples/`.\n\n## Why do the drawing on the CPU instead of the GPU?\n\n* Simplicity\n* More control, over every pixel\n* Portability\n* A GPU may not be available\n* You know exactly what's happening\n\n## How is there an OpenGL and a Vulkan backend if \"the GPU is not used\"?\n\nTo clarify, these two backends only take a bunch of CPU-rendered pixels (a texture) and display that on the screen.\nThat is the only purpose all the backends serve. The main work of creating those pixels is done by Soft itself.\n\n## FAQ\n\n### Question\n\nWhy are the example backends not part of Soft itself?\nSo that I doesn't have to copy the example backend that renders the grid into my app for my platform/environment?\n\n### Answer\n\nThis is because doing so would be a monumental task and significantly increase complexity.\nFor example, if the Vulkan example backend would be a backend as part of the Soft library itself:\nhow would we ever provide enough control over what's happening inside the backend for every use case?\nThe Vulkan API gives the user a ton of control that we would have to pass through our abstraction.\nOr for Wasm: how would we include the JavaScript that interpolates the memory it gets from\nZig through Wasm as an image in the Soft library and make it so that the user has enough control over it?\n\nAll this is why platform/environment-specific backends stay out of the Soft library itself and drawing the grid is left to the user.\nAs always, you can take inspiration from the example backends for rendering your grid in your environment.\nThis is one thing Soft does not do for you out of the box.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooster0%2Fsoft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwooster0%2Fsoft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwooster0%2Fsoft/lists"}