{"id":21190223,"url":"https://github.com/minecraftts/seraph","last_synced_at":"2025-09-12T12:36:17.812Z","repository":{"id":60024331,"uuid":"536396521","full_name":"minecraftts/seraph","owner":"minecraftts","description":"3D engine for TypeScript using Node.js, OpenGL and GLFW","archived":false,"fork":false,"pushed_at":"2023-07-12T10:08:41.000Z","size":219,"stargazers_count":6,"open_issues_count":1,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-05T10:11:12.366Z","etag":null,"topics":["3d","3d-graphics","desktop","desktop-environment","drawing","glsl","graphics","hacktoberfest","nodejs","opengl","shaders","typescript"],"latest_commit_sha":null,"homepage":"","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/minecraftts.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}},"created_at":"2022-09-14T03:18:52.000Z","updated_at":"2024-01-16T17:46:06.000Z","dependencies_parsed_at":"2023-01-31T08:30:38.023Z","dependency_job_id":null,"html_url":"https://github.com/minecraftts/seraph","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/minecraftts/seraph","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minecraftts%2Fseraph","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minecraftts%2Fseraph/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minecraftts%2Fseraph/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minecraftts%2Fseraph/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/minecraftts","download_url":"https://codeload.github.com/minecraftts/seraph/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/minecraftts%2Fseraph/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274814492,"owners_count":25355080,"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-09-12T02:00:09.324Z","response_time":60,"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":["3d","3d-graphics","desktop","desktop-environment","drawing","glsl","graphics","hacktoberfest","nodejs","opengl","shaders","typescript"],"created_at":"2024-11-20T18:59:49.346Z","updated_at":"2025-09-12T12:36:17.743Z","avatar_url":"https://github.com/minecraftts.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Seraph\n\nSeraph is a simple and small OpenGL renderer for Node.js.\n\n### Notice\nSeraph is currently not stable, API will change without a major version bump. Deprecations may or may not be present before a class/method/namespace/type undergoes breaking changes.\n\n## Installation\n\nYou will CMake as well as any other C++ build tools installed as Seraph uses native modules which must be built.\n\nAfter installing C++ build tools you can go ahead and run\n```sh\nnpm install @minecraftts/seraph --save\n```\n\n## Quick Start\n\nWhile Seraph is somewhat more verbose than other 3D libraries for JavaScript it gives you a ton of control, including adding your own OpenGL code during rendering.\n\n### Canvas\n\nCanvas is the easiest to use, but also quite a bit slower than OpenGL as it is software rendered\n\n**Example:**\n\n```ts\nimport { Seraph, CanvasDisplay } from \"@minecraftts/seraph\";\n\n// initialize the engine, this must be done before anything else\nSeraph.initialize();\n\n// create a canvas display, this is our canvas/window\nconst display = new CanvasDisplay();\n\n// get the window context\nlet context = display.getGraphics();\n\n// we need to get a new context everytime the window resizes due to the old one being deleted\ndisplay.on(\"resize\", () =\u003e { context = display.getGraphics() });\n\n// finally show our window and start our game loop\ndisplay.show();\n\nwhile (!display.shouldClose()) {\n    // poll events (keyboard input, window events, etc)\n    display.pollEvents();\n\n    // set the fill color to white\n    context.fillStyle = \"white\";\n    // fill our background\n    context.fillRect(0, 0, display.getWidth(), display.getHeight());\n    // set the fill color to black\n    context.fillStyle = \"black\";\n    // set the font\n    context.font = \"48px serif\";\n    // finally draw text\n    context.fillText(\"Hello Seraph\", 10, 50);\n\n    // swap buffers so what we just drew is visible on the screen\n    display.swapBuffers();\n}\n```\n\n### OpenGL\n\n```ts\nimport { Seraph, Display, Plane, Renderer, Scene, UnlitMaterial, PerspectiveCamera, MathUtil } from \"@minecraftts/seraph\";\n\n// initialize the engine, this must be done before anything else\nSeraph.initialize();\n\n// create a display, this is our window\nconst display = new Display();\n// create a renderer, this will draw into our window\nconst renderer = new Renderer();\n// create a scene, the renderer will draw all objects added to the scene\nconst scene = new Scene();\n// create a camera\nconst camera = new PerspectiveCamera();\n\n// create a mesh\nconst floor = new Plane();\n\n// assign a new unlit material to the mesh\nfloor.setMaterial(new UnlitMaterial());\n\n// move the camera up by 2 units\ncamera.setPosition(0, 2, 0);\n// set the aspect ratio\ncamera.setAspectRatio(display.getWidth() / display.getHeight());\n// finally rotate the camera downwards\ncamera.rotate(-MathUtil.degreesToRad(90), 0, 0);\n\n// if the display resizes we need to set the aspect ratio again or else the projection will be messed up\ndisplay.on(\"resize\", (width, height, aspect) =\u003e { camera.setAspectRatio(aspect) });\n\n// add the floor mesh to the scene\nscene.add(floor);\n\n// set the background color\nrenderer.setClearColor(0.2, 0.3, 0.7);\n\n// finally show the window and start our game loop\ndisplay.show();\n\nwhile (!display.shouldClose()) {\n    // poll events (keyboard input, window events, etc)\n    display.pollEvents();\n\n    // draw our scene\n    renderer.draw(scene, camera);\n\n    // finally swap the front and back buffer so it's visible on the screen\n    display.swapBuffers();\n}\n```\n\n## License\n\nSeraph is licensed under the MIT license.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminecraftts%2Fseraph","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fminecraftts%2Fseraph","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fminecraftts%2Fseraph/lists"}