{"id":18672104,"url":"https://github.com/dfirebaugh/sfb","last_synced_at":"2025-11-06T21:30:39.808Z","repository":{"id":250511287,"uuid":"834667902","full_name":"dfirebaugh/sfb","owner":"dfirebaugh","description":"experimental software renderer","archived":false,"fork":false,"pushed_at":"2024-07-28T01:52:50.000Z","size":56,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T19:29:47.718Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","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/dfirebaugh.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}},"created_at":"2024-07-28T01:42:43.000Z","updated_at":"2024-07-28T01:52:52.000Z","dependencies_parsed_at":"2024-07-28T03:12:26.229Z","dependency_job_id":null,"html_url":"https://github.com/dfirebaugh/sfb","commit_stats":null,"previous_names":["dfirebaugh/sfb"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fsfb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fsfb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fsfb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dfirebaugh%2Fsfb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dfirebaugh","download_url":"https://codeload.github.com/dfirebaugh/sfb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239513345,"owners_count":19651321,"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":[],"created_at":"2024-11-07T09:09:29.989Z","updated_at":"2025-11-06T21:30:39.772Z","avatar_url":"https://github.com/dfirebaugh.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sfb\n\nThis is kind of an expiremental project and possibly a bad idea. So, I wouldn't\nnecessarily recommend using it.\n\n## high level goal\n\nbuild a software renderer that can be used reasonably easily on machines with\nlow or no gpu\n\n### justifications\n\n- to get some experience writing a wrapper around C for go libraries\n- to explore the possibilities of making a software renderer (for machines with\n  no gpu)\n- to get some concurrency reps in\n\n### how does it work?\n\n1. The C layer calls SDL2 to load a window.\n1. We create a texture.\n1. we fill a buffer with pixels and then load it to that texture\n1. a small api is exposed through a shared object file\n1. there's a go wrapper library that hooks into that .so file and allows us to\n   set individual pixels in the buffer\n1. to draw shapes, we use some well known drawing algorithms that I tried to\n   concurrency-ify\n\nobviously, there are some limitations here. Like the larger your window is the\nslower it will run and the cost of rendering a shape is bound to the size of the\nshape. However, I was able to get these circles moving around at over 100fps\n(granted that's on a computer that has a pretty fast cpu)\n\n\u003cimg src=\"./assets/circles.png\" width=\"400\"\u003e\u003c/img\u003e\n\nI'd like to play around with rewriting the drawing functions in C to explore\nsimd operations. That's unexplored terrority for me, but maybe I'll jump down\nthat rabbit hole someday.\n\n### how to run\n\nYou need sdl on your system:\n\n```bash\napt install libsdl2-dev\n```\n\n```bash\nmake # make the .so file\ngo run ./examples/big_circle/ # run one of the examples\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfirebaugh%2Fsfb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdfirebaugh%2Fsfb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdfirebaugh%2Fsfb/lists"}