@@ -10,23 +10,15 @@ This is a part of [Node3D](https://github.com/node-3d) project.
1010npm i -s 3d-core-raub
1111```
1212
13- Run ** WebGL** code on ** Node.js** .
13+ > This package uses pre-compiled Node.js addons. ** There is no compilation** during the ` npm install ` .
14+ The addons are compiled for: Win64, Linux64, Linux ARM64, MacOS ARM64.
1415
1516![ Example] ( examples/screenshot.png )
1617
17- > Note: Since version 4.0.0, [ three.js] ( https://github.com/mrdoob/three.js ) is a peer dependency.
18- Please install your version of choise and call ` addThreeHelpers ` before drawing frames.
19-
20- * Multiple windows are supported, using [ GLFW] ( http://www.glfw.org/ ) for window management.
21- * WebGL implementation is not 100% accurate, but good enough to run three.js examples.
22- * The C++ bindings use [ GLEW] ( http://glew.sourceforge.net/ ) to access all the OpenGL functions.
23- * Image loading uses [ FreeImage] ( http://freeimage.sourceforge.net/ ) encoder/decoder.
24- * Window icons are supported and both JS- and Image-friendly.
25-
26- > Note: this package uses a bunch of ** N-API addons** , which are ABI-compatible across
27- different Node.js versions. Addon binaries are precompiled and ** there is no compilation**
28- step during the ` npm i ` command.
29-
18+ * WebGL/OpenGL on ** Node.js** with support for web libs, such as ** three.js** .
19+ * Multi-window apps, low-level window control with [ glfw-raub] ( https://github.com/node-3d/glfw-raub ) .
20+ * Modern OpenGL functions also available, see [ webgl-raub] ( https://github.com/node-3d/webgl-raub ) .
21+ * Image loading/saving in popular formats with [ image-raub] ( https://github.com/node-3d/image-raub ) .
3022
3123This module exports 2 methods:
32241 . ` export const init: (opts?: TInitOpts) => TCore3D; `
@@ -40,9 +32,11 @@ This module exports 2 methods:
4032 ` three.Texture.fromId ` static method to create THREE textures from known GL resource IDs.
4133
4234
43- See [ TypeScript defenitions ] ( /index.d.ts ) for more details.
35+ See [ TS declarations ] ( /index.d.ts ) for more details.
4436
45- Example (as in [ crate-lean.mjs] ( /examples/crate-lean.mjs ) ):
37+ ## Example
38+
39+ (As in [ crate-lean.mjs] ( /examples/crate-lean.mjs ) ):
4640
4741``` javascript
4842import * as THREE from ' three' ;
@@ -78,5 +72,32 @@ Example Notes:
7872 window modes.
79731 . ` Screen ` helps with ** three.js** -oriented resource management, but is not required.
80741 . ** three.js** uses VAO, so if not using ` Screen ` , handling the window mode changes
81- (creates a separate OpenGL context) is up to you. Basically, `doc.on('mode', () => {...})` -
75+ (which creates a separate OpenGL context) is up to you.
76+ Basically, `doc.on('mode', () => {...})` -
8277 here you should [re-create THREE.WebGLRenderer](/js/objects/screen.js#L127).
78+
79+
80+ ## OpenGL Features
81+
82+ 1 . This is real native OpenGL, and you have direct access to GL resource IDs. This may be
83+ useful for resource sharing and compute interop (such as
84+ [CUDA-GL interop](https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__OPENGL.html)).
85+ 1 . The flag ` isGles3 ` let's you use a GL ES 3 preset, which is closest to "real" WebGL.
86+ If set to `false`, WebGL stuff (such as three.js) will still work, but now with some hacks.
87+ However, if you are planning to use non-WebGL features (e.g. OpenGL 4.5 features),
88+ you might want it off, and then select a specific context version manually.
89+ 1 . The flag ` isWebGL2 ` impacts how web libraries recognize the WebGL version.
90+ But it doesn't really change the capabilities of the engine.
91+ 1 . Offscreen rendering is possible on Windows and Linux, as demonstrated by the tests
92+ running in GitHub Actions. There are test cases that generate and compare screenshots,
93+ and they do work in headless mode.
94+ 1 . OpenGL context sharing is enabled. You can obtain ` HDC, HWND, CTX ` for Windows and whatever
95+ those are called on Linux and MacOS. See [glfw-raub](https://github.com/node-3d/glfw-raub).
96+
97+
98+ ## License
99+
100+ You get this for free. Have fun!
101+
102+ Some of the components have their separate licenses, but all of them may be used
103+ commercially, without royalty.
0 commit comments