{"id":26157117,"url":"https://github.com/kosua20/ptahrenderer","last_synced_at":"2025-09-09T21:42:52.545Z","repository":{"id":78954341,"uuid":"51691365","full_name":"kosua20/PtahRenderer","owner":"kosua20","description":"A small software graphics renderer","archived":false,"fork":false,"pushed_at":"2018-06-06T11:57:21.000Z","size":39871,"stargazers_count":88,"open_issues_count":0,"forks_count":7,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-27T22:23:24.428Z","etag":null,"topics":["computer-graphics","graphics-rendering","rasterization","software-rendering","swift"],"latest_commit_sha":null,"homepage":null,"language":"Swift","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/kosua20.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}},"created_at":"2016-02-14T11:06:42.000Z","updated_at":"2025-03-11T15:29:34.000Z","dependencies_parsed_at":"2023-02-27T16:46:12.158Z","dependency_job_id":null,"html_url":"https://github.com/kosua20/PtahRenderer","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosua20%2FPtahRenderer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosua20%2FPtahRenderer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosua20%2FPtahRenderer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kosua20%2FPtahRenderer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kosua20","download_url":"https://codeload.github.com/kosua20/PtahRenderer/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248852109,"owners_count":21171839,"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":["computer-graphics","graphics-rendering","rasterization","software-rendering","swift"],"created_at":"2025-03-11T09:55:16.271Z","updated_at":"2025-04-14T08:53:46.185Z","avatar_url":"https://github.com/kosua20.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PtahRenderer\n\nA small software graphics renderer. Offline and online demos available on macOS and Linux (tested on Ubuntu). See [Programs](#Programs) for requirements and build instructions. Associated blog post [here](http://blog.simonrodriguez.fr/articles/18-02-2017_writing_a_small_software_renderer.html).\n\n![](images/icon.png)\n\nWritten with the help of (among other resources) :\n\n- *Interactive Computer Graphics - A Top-Down Approach*, 2012, E. Angel \u0026 D.Shreiner\n- *Introduction to Computer Graphics* course, M. Pauly, EPFL 2015\n- *How OpenGL works*, D. V. Sokolov, available at [github.com/ssloy/tinyrenderer](https://github.com/ssloy/tinyrenderer/wiki)\n- *Triangle rasterization in practice* and the following posts, F. Giesen, available [here](https://fgiesen.wordpress.com/2013/02/08/triangle-rasterization-in-practice/)\n- *Rasterization: a Practical Implementation*, , available at [scratchapixel.com](https://www.scratchapixel.com/lessons/3d-basic-rendering/rasterization-practical-implementation/overview-rasterization-algorithm)\n- *How to write a (software) 3d polygon pipeline*, C. Bloom, available [here](http://www.cbloom.com/3d/techdocs/pipeline.txt)\n\n\n![Image produced with the software renderer](images/header.png)\n\n### Programs\n\nThe project is composed of two library modules, and three programs:\n\n- **PtahRenderer** contains the internal logic to perform transformation, rasterization and clipping,... along with primitive types.\n- **PtahRendererDemo** contains the scene, the objects and shaders, and handles camera movements and animations.\n- **PtahRendererDemoOffline** is a command-line utility that renders one frame of the scene and saves it to a `.tga` file in the `renders/` directory \n- **PtahRendererDemoOnline** is a macOS Cocoa application (that can only be built using Xcode), performing real-time rendering with mouse interactions (scroll to zoom, drag to rotate around the scene).\n- **PtahRendererDemoOpenGL** performs the same tasks as PtahRendererDemoOnline but relies on OpenGL 3 and GLFW 3 to display the output of the renderer in real-time.\n\nApart from PtahRendererDemoOnline, everything can be compiled using the Swift Package Manager on both macOS (tested on macOS 10.12) and Linux (tested on Ubuntu 16.04). \n\n\tswift build -c release -Xlinker -L/usr/local/lib\n\t \nFor PtahRendererDemoOpenGL, GLFW 3 needs to be installed in `/usr/local` and is accessed through a thin wrapper ([macOS](https://github.com/kosua20/CGLFW3) and [Linux](https://github.com/kosua20/CGLFW3Linux) versions). OpenGL is also used through a wrapper, [SGLOpenGL](https://github.com/SwiftGL/OpenGL), that mainly provides platform independance and types simplification (because of Swift handling of GLenum among other things). If you want to compile the OpenGL demo in Xcode, do a first compilation with the Package Manager so the dependencies are downloaded and setup.\n\n### Done\n* General setup\n* Mesh loading (OBJ with vertices, normals, texture coordinates, faces)\n* Texture loading (PNG, 1-3-4 channels, supports wrapping and clamping)\n* Line drawing (using Bresenham’s line drawing algorithm)\n* Wireframe drawing for triangular faces\n* Triangles rasterization\n* Z-buffer\n* View and world matrices\n* Back faces culling\n* Projection matrix\n* Primitives clipping\n* Shaders (vertex, fragment)\n* Multi pass (for AO (SSAO or pre-computation), shadow maps, deferred shading)\n* Offline demo (both platforms)\n* Real-time demo (both platforms)\n\n### To do\n* Optimizations...\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosua20%2Fptahrenderer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkosua20%2Fptahrenderer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkosua20%2Fptahrenderer/lists"}