{"id":31684482,"url":"https://github.com/sbobyn/three-pathtracer","last_synced_at":"2026-05-18T06:03:17.911Z","repository":{"id":318545975,"uuid":"1063630425","full_name":"sbobyn/three-pathtracer","owner":"sbobyn","description":"Realtime interactive WebGL based pathtracer implemented with Three.js","archived":false,"fork":false,"pushed_at":"2025-10-07T20:46:23.000Z","size":39490,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-07T21:13:27.034Z","etag":null,"topics":["pathtracing","raytracing","raytracing-","threejs","webgl"],"latest_commit_sha":null,"homepage":"https://sbobyn.github.io/three-pathtracer/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sbobyn.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2025-09-24T22:39:10.000Z","updated_at":"2025-10-07T20:46:27.000Z","dependencies_parsed_at":"2025-10-07T21:25:48.843Z","dependency_job_id":null,"html_url":"https://github.com/sbobyn/three-pathtracer","commit_stats":null,"previous_names":["sbobyn/three-pathtracer"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/sbobyn/three-pathtracer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbobyn%2Fthree-pathtracer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbobyn%2Fthree-pathtracer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbobyn%2Fthree-pathtracer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbobyn%2Fthree-pathtracer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sbobyn","download_url":"https://codeload.github.com/sbobyn/three-pathtracer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sbobyn%2Fthree-pathtracer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33167430,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T05:43:36.989Z","status":"ssl_error","status_checked_at":"2026-05-18T05:43:19.133Z","response_time":71,"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":["pathtracing","raytracing","raytracing-","threejs","webgl"],"created_at":"2025-10-08T08:09:01.047Z","updated_at":"2026-05-18T06:03:17.906Z","avatar_url":"https://github.com/sbobyn.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Three.js WebGL Pathtracer\n\nToy/demo Realtime WebGL-based Pathtracer integrated with Three.js, for educaitonal purposes.\n\nLive demo is available here: https://sbobyn.github.io/three-pathtracer/\n\nSo far, the Pathtracer closely follows Peter Shirely's [Ray Tracing in One Weekend](https://raytracing.github.io/) (part 1). See the todos below for what's planned next.\n\n![gif demo](three-pathtracer.gif)\n\n## Detail\n\nThe pathtracer itself is contained in `main.fs`. So far, it closely follows RTIOW,\nexcept that it's written in GLSL so there's some changes to the data structures,\nno recursion, etc. and the random number generation is based off of the hash functionsa\nfrom this ShaderToy: https://www.shadertoy.com/view/4djSRW\n\nRight now it supports:\n\n- ray-sphere intersection\n- diffuse, metal, dielectric materials\n- depth-of-field / defocus blur\n\nAdditionally progressive pathtracing is `ShaderCanvas.ts`:\n\n- two render targets are used, swapped each frame\n- the previous render target is uploaded as a texture to the current redner target\n  to accumulate to\n- accumulation is reset when the camera moves\n\nThe Three.js integration includes:a\n\n- `THREE.Scene` scene graph used to manage scenes (spheres, camera)\n  - a Three.js renderer is used as a debug renderer (can be toggled in the gui)\n- camera orbit controls via `THREE.OrbitControls`\n- object picking via `THREE.Raycaster`\n- transform controls on selected object via `THREE.TransformControls`\n- outline on selected object via postprocessing [OutlinePass](https://threejs.org/examples/webgl_postprocessing_outline.html)\n\nIn `PtApp`, a debug gui is implemented via `lil-gui` which can be used to change the pathtracer settings and edit selected object's transform and material properties.\n\n# Running locally\n\nWith pnpm:\n\n```sh\n$pnpm i\n$pnpm dev\n```\n\n## To Do Next\n\n- [ ] skybox/environent map\n- [ ] integrate threejs [sky example](https://threejs.org/examples/?q=sun#webgl_shaders_sky) for environment map using [THREE.CubeCamera](https://threejs.org/docs/#api/en/cameras/CubeCamera)\n\nFrom [RTIOW Part 2](https://raytracing.github.io/books/RayTracingTheNextWeek.html), add:\n\n- [ ] Textures\n- [ ] Quads\n- [ ] Area lights\n\nThen\n\n- [ ] Add ray-triangle intersection\n- [ ] Add mesh-loading\n- [ ] Convert to compute shader + replace hittable-related uniforms (spheres, tris) with textures\n- [ ] Add bvh to accelerate hit testing using https://github.com/gkjohnson/three-mesh-bvh\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbobyn%2Fthree-pathtracer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsbobyn%2Fthree-pathtracer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsbobyn%2Fthree-pathtracer/lists"}