{"id":14981290,"url":"https://github.com/guyettinger/gle-gs3d","last_synced_at":"2025-10-09T01:16:51.083Z","repository":{"id":204176186,"uuid":"711260639","full_name":"guyettinger/gle-gs3d","owner":"guyettinger","description":"Gaussian Splat 3D loader for ThreeJS, converted and adapted to Typescript.","archived":false,"fork":false,"pushed_at":"2023-12-01T00:35:54.000Z","size":1418,"stargazers_count":24,"open_issues_count":1,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-10-09T01:16:49.565Z","etag":null,"topics":["guassian-splatting","threejs","typescript"],"latest_commit_sha":null,"homepage":"https://gle-scene-components.vercel.app/?path=/story/gle-scene-components-scene--gaussian-splat-clouds","language":"TypeScript","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/guyettinger.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":"2023-10-28T17:35:23.000Z","updated_at":"2025-09-22T14:19:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"1b7d56b0-6b17-41d1-93c0-20ff07465471","html_url":"https://github.com/guyettinger/gle-gs3d","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"5f524ef493ba9e0855126d3d4ec9d1a682454685"},"previous_names":["guyettinger/gle-gs3d"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/guyettinger/gle-gs3d","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyettinger%2Fgle-gs3d","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyettinger%2Fgle-gs3d/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyettinger%2Fgle-gs3d/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyettinger%2Fgle-gs3d/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/guyettinger","download_url":"https://codeload.github.com/guyettinger/gle-gs3d/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/guyettinger%2Fgle-gs3d/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279000722,"owners_count":26082894,"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","status":"online","status_checked_at":"2025-10-08T02:00:06.501Z","response_time":56,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["guassian-splatting","threejs","typescript"],"created_at":"2024-09-24T14:03:16.134Z","updated_at":"2025-10-09T01:16:51.068Z","avatar_url":"https://github.com/guyettinger.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ca href=\"/\"\u003e\n    \u003cimg alt=\"logo\" src=\"public/images/logo-flipped.png\" align=\"right\" width=\"120\" height=\"120\"/\u003e\n\u003c/a\u003e\n\n# GLE GS3D\nA typescript port of Mark Kellogg's excellent [GaussianSplats3D](https://github.com/mkkellogg/GaussianSplats3D) project.\n\n[![Version](https://img.shields.io/npm/v/gle-gs3d?style=flat\u0026colorA=000000\u0026colorB=000000)](https://www.npmjs.com/package/gle-gs3d)\n[![Downloads](https://img.shields.io/npm/dt/gle-gs3d.svg?style=flat\u0026colorA=000000\u0026colorB=000000)](https://www.npmjs.com/package/gle-gs3d)\n\n## Demo\n- [Storybook Demo](https://gle-scene-components.vercel.app/?path=/story/gle-scene-components-scene--gaussian-splat-clouds)\n\n## Installation\n```shell\nnpm install gle-gs3d\n```\n\n## Usage\n\nTo run the built-in viewer:\n\n```typescript\nimport { Viewer } from 'gle-gs3d'\nconst viewer = new Viewer({\n  'cameraUp': [0, -1, -0.6],\n  'initialCameraPosition': [-1, -4, 6],\n  'initialCameraLookAt': [0, 4, 0]\n});\nviewer.init();\nviewer.loadFile('\u003cpath to .ply or .splat file\u003e', {\n    'splatAlphaRemovalThreshold': 5, // out of 255\n    'halfPrecisionCovariancesOnGPU': true\n})\n.then(() =\u003e {\n    viewer.start();\n});\n```\nAs an alternative to using `cameraUp` to adjust to the scene's natural orientation, you can pass an orientation (and/or position) to the `loadFile()` method to transform the entire scene:\n```typescript\nimport { Viewer } from 'gle-gs3d'\nimport { Quaternion, Vector3 } from 'three'\nconst viewer = new Viewer({\n    'initialCameraPosition': [-1, -4, 6],\n    'initialCameraLookAt': [0, 4, 0]\n});\nconst orientation = new Quaternion();\norientation.setFromUnitVectors(new Vector3(0, 1, 0), new Vector3(0, -1, 0.6).normalize());\nviewer.init();\nviewer.loadFile('\u003cpath to .ply or .splat file\u003e', {\n    'splatAlphaRemovalThreshold': 5, // out of 255\n    'halfPrecisionCovariancesOnGPU': true,\n    'position': [0, 0, 0],\n    'orientation': orientation.toArray(),\n})\n.then(() =\u003e {\n    viewer.start();\n});\n```\n\nThe `loadFile()` method will accept the original `.ply` files as well as my custom `.splat` files.\n\u003cbr\u003e\n\u003cbr\u003e\n### Creating SPLAT files\nTo convert a `.ply` file into the stripped-down `.splat` format (currently only compatible with this viewer):\n\n```typescript\nimport { PlyLoader, SplatLoader } from 'gle-gs3d'\nconst compressionLevel = 1;\nconst splatAlphaRemovalThreshold = 10;\nconst plyLoader = new PlyLoader();\nplyLoader.loadFromFile('\u003cpath to .ply file\u003e', compressionLevel, splatAlphaRemovalThreshold)\n.then((splatBuffer) =\u003e {\n    new SplatLoader(splatBuffer).saveToFile('converted_file.splat');\n});\n```\nThis code will prompt your browser to automatically start downloading the converted `.splat` file. Currently supported values for `compressionLevel` are `0` or `1`. `0` means no compression, `1` means compression of scale, rotation, and position values from 32-bit to 16-bit.\n\u003cbr\u003e\n\u003cbr\u003e\n### Integrating THREE.js scenes\nIt is now possible to integrate your own Three.js scene into the viewer (still somewhat experimental). The `Viewer` class now accepts two parameters by which you can pass in any 'normal' Three.js objects you want to be rendered along with the splats: `scene` and/or `simpleScene`. Rendering the splats correctly with external objects requires a special sequence of steps so the viewer needs to be aware of them:\n```typescript\nimport { Viewer } from 'gle-gs3d'\nimport { Scene, Box, Mesh, MeshBasicMaterial } from 'three'\nconst scene = new Scene();\n\nconst boxColor = 0xBBBBBB;\nconst boxGeometry = new BoxGeometry(2, 2, 2);\nconst boxMesh = new Mesh(boxGeometry, new MeshBasicMaterial({'color': boxColor}));\nscene.add(boxMesh);\nboxMesh.position.set(3, 2, 2);\n\nconst viewer = new Viewer({\n  'scene': scene,\n  'cameraUp': [0, -1, -0.6],\n  'initialCameraPosition': [-1, -4, 6],\n  'initialCameraLookAt': [0, 4, -0]\n});\nviewer.init();\nviewer.loadFile('\u003cpath to .ply or .splat file\u003e')\n.then(() =\u003e {\n    viewer.start();\n});\n```\nThe difference between the `scene` and `simpleScene` parameters is a matter of optimization. Objects contained in `scene` will have their depths rendered using their standard shader, but objects contained in `simpleScene` will have their depths rendered using a very simple override shader.\n\nThe viewer allows for various levels of customization via constructor parameters. You can control when its `update()` and `render()` methods are called by passing `false` for the `selfDrivenMode` parameter and then calling those methods whenever/wherever you decide is appropriate. You can tell the viewer to not use its built-in camera controls by passing `false` for the `useBuiltInControls` parameter. You can also use your own Three.js renderer and camera by passing those values to the viewer's constructor. The sample below shows all of these options:\n\n```typescript\nimport { Viewer } from 'gle-gs3d'\nimport { WebGLRenderer, PerspectiveCamera, Vector3 } from 'three'\nconst renderWidth = 800;\nconst renderHeight = 600;\n\nconst rootElement = document.createElement('div');\nrootElement.style.width = renderWidth + 'px';\nrootElement.style.height = renderHeight + 'px';\ndocument.body.appendChild(rootElement);\n\nconst renderer = new WebGLRenderer({\n    antialias: false\n});\nrenderer.setSize(renderWidth, renderHeight);\nrootElement.appendChild(renderer.domElement);\n\nconst camera = new PerspectiveCamera(65, renderWidth / renderHeight, 0.1, 500);\ncamera.position.copy(new Vector3().fromArray([-1, -4, 6]));\ncamera.lookAt(new Vector3().fromArray([0, 4, -0]));\ncamera.up = new Vector3().fromArray([0, -1, -0.6]).normalize();\n\nconst viewer = new Viewer({\n    'selfDrivenMode': false,\n    'renderer': renderer,\n    'camera': camera,\n    'useBuiltInControls': false\n});\nviewer.init();\nviewer.loadFile('\u003cpath to .ply or .splat file\u003e')\n.then(() =\u003e {\n    requestAnimationFrame(update);\n});\n```\nSince `selfDrivenMode` is false, it is up to the developer to call the `update()` and `render()` methods on the `Viewer` class:\n```typescript\nfunction update() {\n    requestAnimationFrame(update);\n    viewer.update();\n    viewer.render();\n}\n```\n\n## Building and running locally\nInstall\n```\nnpm install\n```\nBuild Library\n```\nnpm run build\n```\nBuild Demo\n```\nnpm run build-demo\n```\nRun Demo\n```\nnpm run demo\n```\nThe demo will be accessible locally at [http://127.0.0.1:8080/index.html](http://127.0.0.1:8080/index.html). You will need to download the data for the demo scenes and extract them into \n```\n\u003ccode directory\u003e/public/demo/assets/data\n```\nThe demo scene data is available here: [https://projects.markkellogg.org/downloads/gaussian_splat_data.zip](https://projects.markkellogg.org/downloads/gaussian_splat_data.zip)\n\u003cbr\u003e\n\u003cbr\u003e\n\n## Controls\nMouse\n- Left click and drag to orbit around the focal point\n- Right click and drag to pan the camera and focal point\n  \nKeyboard\n- `C` Toggles the mesh cursor, which shows where a ray projected from the mouse cursor intersects the splat mesh\n\n- `I` Toggles an info panel that displays the mesh cursor position, current FPS, and current window size\n## Deploy\nShared Memory requires [Cross-origin Isolation to be configured](https://web.dev/articles/coop-coep) in deployment.  \n\nThis can be achieved by setting response headers on your server:\n```\nresponse.setHeader('Cross-Origin-Opener-Policy', 'same-origin');\nresponse.setHeader('Cross-Origin-Embedder-Policy', 'require-corp');\n```\n... or deploying [coi-serviceworker](https://github.com/gzuidhof/coi-serviceworker) in your webpage:\n```html\n\u003cscript src=\"coi-serviceworker.js\"\u003e\u003c/script\u003e\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguyettinger%2Fgle-gs3d","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fguyettinger%2Fgle-gs3d","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fguyettinger%2Fgle-gs3d/lists"}