{"id":19735971,"url":"https://github.com/node-3d/3d-core-raub","last_synced_at":"2025-04-05T13:01:54.820Z","repository":{"id":16581903,"uuid":"80198999","full_name":"node-3d/3d-core-raub","owner":"node-3d","description":"An extensible Node.js 3D core for desktop applications","archived":false,"fork":false,"pushed_at":"2024-11-09T15:13:00.000Z","size":12447,"stargazers_count":73,"open_issues_count":0,"forks_count":4,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-27T09:17:39.488Z","etag":null,"topics":["3d","gl","glfw","gpu","gpu-computing","graphics","image","javascript","js","native","node-3d","opengl","pixijs","simulation","threejs","vao","vbo","webgl","window"],"latest_commit_sha":null,"homepage":"https://github.com/node-3d/node-3d","language":"JavaScript","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/node-3d.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-27T10:33:14.000Z","updated_at":"2024-11-13T03:01:40.000Z","dependencies_parsed_at":"2023-01-13T18:54:42.835Z","dependency_job_id":"a1852562-ffb0-4b64-971b-f66111047846","html_url":"https://github.com/node-3d/3d-core-raub","commit_stats":{"total_commits":179,"total_committers":5,"mean_commits":35.8,"dds":0.4860335195530726,"last_synced_commit":"19342c49cca9214eeefd9247e7c4db0efefb0904"},"previous_names":["raub/node-3d-ready"],"tags_count":21,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2F3d-core-raub","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2F3d-core-raub/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2F3d-core-raub/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/node-3d%2F3d-core-raub/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/node-3d","download_url":"https://codeload.github.com/node-3d/3d-core-raub/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247339147,"owners_count":20923013,"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","gl","glfw","gpu","gpu-computing","graphics","image","javascript","js","native","node-3d","opengl","pixijs","simulation","threejs","vao","vbo","webgl","window"],"created_at":"2024-11-12T01:04:25.069Z","updated_at":"2025-04-05T13:01:54.764Z","avatar_url":"https://github.com/node-3d.png","language":"JavaScript","readme":"# Node.js 3D Core\n\nThis is a part of [Node3D](https://github.com/node-3d) project.\n\n[![NPM](https://badge.fury.io/js/3d-core-raub.svg)](https://badge.fury.io/js/3d-core-raub)\n[![ESLint](https://github.com/node-3d/3d-core-raub/actions/workflows/eslint.yml/badge.svg)](https://github.com/node-3d/3d-core-raub/actions/workflows/eslint.yml)\n[![Test](https://github.com/node-3d/3d-core-raub/actions/workflows/test.yml/badge.svg)](https://github.com/node-3d/3d-core-raub/actions/workflows/test.yml)\n\n```console\nnpm i -s 3d-core-raub\n```\n\n\u003e This package uses pre-compiled Node.js addons. **There is no compilation** during `npm i`.\nThe addons are compiled for: Win64, Linux64, Linux ARM64, MacOS ARM64.\n\n![Example](examples/screenshot.png)\n\n* WebGL/OpenGL on **Node.js** with support for web libs, such as **three.js**.\n* Multi-window apps, low-level window control with [glfw-raub](https://github.com/node-3d/glfw-raub).\n* Modern OpenGL functions also available, see [webgl-raub](https://github.com/node-3d/webgl-raub).\n* Image loading/saving in popular formats with [image-raub](https://github.com/node-3d/image-raub).\n\nThis module exports 2 methods:\n1. `export const init: (opts?: TInitOpts) =\u003e TCore3D;`\n    \n    Initialize Node3D. Creates the first window/document and sets up the global environment.\n    This function can be called repeatedly, but will ignore further calls.\n    The return value is cached and will be returned immediately for repeating calls.\n2. `export const addThreeHelpers: (three: TUnknownObject, gl: typeof webgl) =\u003e void;`\n    \n    Teaches `three.FileLoader.load` to work with Node `fs`. Additionally implements\n    `three.Texture.fromId` static method to create THREE textures from known GL resource IDs.\n\n\nSee [TS declarations](/index.d.ts) for more details.\n\n## Example\n\n(As in [crate-lean.mjs](/examples/crate-lean.mjs)):\n\n```javascript\nimport * as THREE from 'three';\n\nimport node3d from '../index.js';\nconst { init, addThreeHelpers } = node3d;\n\nconst { gl, loop, Screen } = init({\n\tisGles3: true, vsync: true, autoEsc: true, autoFullscreen: true, title: 'Crate',\n});\naddThreeHelpers(THREE, gl);\nconst screen = new Screen({ three: THREE, fov: 70, z: 2 });\n\nconst texture = new THREE.TextureLoader().load('three/textures/crate.gif');\ntexture.colorSpace = THREE.SRGBColorSpace;\nconst geometry = new THREE.BoxGeometry();\nconst material = new THREE.MeshBasicMaterial({ map: texture });\nconst mesh = new THREE.Mesh(geometry, material);\nscreen.scene.add(mesh);\n\nloop((now) =\u003e {\n\tmesh.rotation.x = now * 0.0005;\n\tmesh.rotation.y = now * 0.001;\n\tscreen.draw();\n});\n```\n\nExample Notes:\n\n1. You can use **mjs**, **tsx** or commonjs with `require()`.\n1. `loop` is a convenience method, you can use `requestAnimationFrame` too.\n1. `autoFullscreen` option enables \"CTRL+F\", \"CTRL+SHIFT+F\", \"CTRL+ALT+F\" to switch\n\twindow modes.\n1. `Screen` helps with **three.js**-oriented resource management, but is not required.\n1. **three.js** uses VAO, so if not using `Screen`, handling the window mode changes\n\t(which creates a separate OpenGL context) is up to you.\n\tBasically, `doc.on('mode', () =\u003e {...})` -\n\there you should [re-create THREE.WebGLRenderer](/js/objects/screen.js#L127).\n\n\n## OpenGL Features\n\n1. This is real **native OpenGL**, and you have direct access to GL resource IDs. This may be\n\tuseful for resource sharing and compute interop (such as\n\t[CUDA-GL interop](https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__OPENGL.html)).\n1. The flag `isGles3` lets you use a **GL ES 3** preset, which is closest to \"real\" WebGL.\n\tIf set to `false`, WebGL stuff (such as three.js) will still work, but now with some hacks.\n\tHowever, if you are planning to use non-WebGL features (e.g. **OpenGL 4.5** features),\n\tyou might want it off, and then select a specific context version manually.\n1. The flag `isWebGL2` impacts how web libraries recognize the WebGL version.\n\tBut it doesn't really change the capabilities of the engine.\n1. **Offscreen rendering** is possible on Windows and Linux, as demonstrated by the tests\n\trunning in GitHub Actions. There are test cases that generate and compare screenshots,\n\tand they do work in headless mode.\n1. OpenGL **context sharing** is enabled. You can obtain `HDC, HWND, CTX` for Windows and whatever\n\tthose are called on Linux and MacOS. See [glfw-raub](https://github.com/node-3d/glfw-raub).\n\n\n## License\n\n**You get this for free. Have fun!**\n\nSome of the components have their separate licenses, but all of them may be used\ncommercially, without royalty.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2F3d-core-raub","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnode-3d%2F3d-core-raub","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnode-3d%2F3d-core-raub/lists"}