{"id":13713017,"url":"https://github.com/fogleman/fauxgl","last_synced_at":"2025-10-06T18:35:24.319Z","repository":{"id":16393247,"uuid":"79294188","full_name":"fogleman/fauxgl","owner":"fogleman","description":"Software-only 3D renderer written in Go.","archived":false,"fork":false,"pushed_at":"2025-02-14T20:49:21.000Z","size":9223,"stargazers_count":884,"open_issues_count":12,"forks_count":68,"subscribers_count":24,"default_branch":"master","last_synced_at":"2025-04-15T00:43:49.614Z","etag":null,"topics":["3d","go","graphics","opengl","rendering"],"latest_commit_sha":null,"homepage":"","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/fogleman.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,"zenodo":null}},"created_at":"2017-01-18T02:15:55.000Z","updated_at":"2025-04-11T17:16:48.000Z","dependencies_parsed_at":"2024-06-18T12:37:42.500Z","dependency_job_id":"dd4f1fc1-313b-4f23-bffa-185dfa289ac0","html_url":"https://github.com/fogleman/fauxgl","commit_stats":{"total_commits":130,"total_committers":1,"mean_commits":130.0,"dds":0.0,"last_synced_commit":"27cddc103802008bbda73dc74cab49038d96fdf3"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Ffauxgl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Ffauxgl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Ffauxgl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fogleman%2Ffauxgl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fogleman","download_url":"https://codeload.github.com/fogleman/fauxgl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254243353,"owners_count":22038044,"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":["3d","go","graphics","opengl","rendering"],"created_at":"2024-08-02T23:01:26.051Z","updated_at":"2025-10-06T18:35:19.300Z","avatar_url":"https://github.com/fogleman.png","language":"Go","funding_links":[],"categories":["Go","Repositories"],"sub_categories":[],"readme":"# FauxGL\n\n3D software rendering in pure Go. No OpenGL, no C extensions, no nothin'.\n\n\u003cbr\u003e\n\n![Dragon](http://i.imgur.com/uwehodr.png)\n\n### About\n\nIt's like OpenGL, but it's not. It's FauxGL.\n\nIt doesn't use your graphics card, only your CPU. So it's slow and unsuitable for realtime rendering. But it's still pretty fast. It works the same way OpenGL works - rasterizing.\n\n### Features\n\n- STL, OBJ, PLY, 3DS file formats\n- triangle rasterization\n- vertex and fragment \"shaders\"\n- view volume clipping\n- face culling\n- alpha blending\n- textures\n- triangle \u0026 line meshes\n- depth biasing\n- wireframe rendering\n- built-in shapes (plane, sphere, cube, cylinder, cone)\n- anti-aliasing (via supersampling)\n- voxel rendering\n- parallel processing\n\n### Performance\n\nFauxGL uses all of your CPU cores. But none of your GPU.\n\nRendering the Stanford Dragon shown above (871306 triangles) at 1920x1080px takes about 150 milliseconds on my machine. With 4x4=16x supersampling, it takes about 950 milliseconds. This is the time to render a frame and does not include loading the mesh from disk.\n\n### Go Get\n\n    go get -u github.com/fogleman/fauxgl\n\n### Go Run\n\n    cd go/src/github.com/fogleman/fauxgl\n    go run examples/hello.go\n\n### Go Doc\n\nhttps://godoc.org/github.com/fogleman/fauxgl\n\n### Complete Example\n\n```go\npackage main\n\nimport (\n\t. \"github.com/fogleman/fauxgl\"\n\t\"github.com/nfnt/resize\"\n)\n\nconst (\n\tscale  = 1    // optional supersampling\n\twidth  = 1920 // output width in pixels\n\theight = 1080 // output height in pixels\n\tfovy   = 30   // vertical field of view in degrees\n\tnear   = 1    // near clipping plane\n\tfar    = 10   // far clipping plane\n)\n\nvar (\n\teye    = V(-3, 1, -0.75)               // camera position\n\tcenter = V(0, -0.07, 0)                // view center position\n\tup     = V(0, 1, 0)                    // up vector\n\tlight  = V(-0.75, 1, 0.25).Normalize() // light direction\n\tcolor  = HexColor(\"#468966\")           // object color\n)\n\nfunc main() {\n\t// load a mesh\n\tmesh, err := LoadOBJ(\"examples/dragon.obj\")\n\tif err != nil {\n\t\tpanic(err)\n\t}\n\n\t// fit mesh in a bi-unit cube centered at the origin\n\tmesh.BiUnitCube()\n\n\t// smooth the normals\n\tmesh.SmoothNormalsThreshold(Radians(30))\n\n\t// create a rendering context\n\tcontext := NewContext(width*scale, height*scale)\n\tcontext.ClearColorBufferWith(HexColor(\"#FFF8E3\"))\n\n\t// create transformation matrix and light direction\n\taspect := float64(width) / float64(height)\n\tmatrix := LookAt(eye, center, up).Perspective(fovy, aspect, near, far)\n\n\t// use builtin phong shader\n\tshader := NewPhongShader(matrix, light, eye)\n\tshader.ObjectColor = color\n\tcontext.Shader = shader\n\n\t// render\n\tcontext.DrawMesh(mesh)\n\n\t// downsample image for antialiasing\n\timage := context.Image()\n\timage = resize.Resize(width, height, image, resize.Bilinear)\n\n\t// save image\n\tSavePNG(\"out.png\", image)\n}\n```\n\n![Teapot](http://i.imgur.com/DaqbkLR.png)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogleman%2Ffauxgl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffogleman%2Ffauxgl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffogleman%2Ffauxgl/lists"}