@gjsify/example-dom-three-geometry-teapot 0.34.0 → 0.35.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,16 +4,35 @@ A three.js Utah Teapot showcase running on GJS/GTK (via `@gjsify/webgl`'s `WebGL
4
4
 
5
5
  Part of the [gjsify](https://github.com/gjsify/gjsify) project — Node.js and Web APIs for GJS (GNOME JavaScript).
6
6
 
7
+ ## Targets
8
+
9
+ | Target | Bundle | Platform glue |
10
+ |---|---|---|
11
+ | GJS / GTK 4 | `dist/gjs.js` (`--app gjs`) | `@gjsify/webgl` `WebGLBridge` → `Gtk.GLArea` + libepoxy |
12
+ | Node · Bun · Deno | `dist/gjs.node.mjs` (`--app node`) | the same GTK window through the `@gjsify/node-gi` reverse bridge |
13
+ | Browser | `dist/browser.js` (`--app browser`) | a real `<canvas>` + `@gjsify/adwaita-web` |
14
+ | Android | [`three-geometry-teapot-nativescript`](../three-geometry-teapot-nativescript) | `@nativescript/canvas` (native GL) |
15
+
16
+ Every target enters the same `start(canvas)` seam in `src/three-demo.ts` — only the shell around the canvas differs.
17
+
18
+ ## Prerequisites
19
+
20
+ GJS ≥ 1.86 with GTK 4 and a working GL/GLES driver. `gjsify system-check` reports what is missing.
21
+
7
22
  ## Run
8
23
 
9
24
  ```bash
10
- # Build first
25
+ # Build first (gjs + node + browser bundles and the assets)
11
26
  gjsify run build
12
27
 
13
28
  # GJS / GTK4 native window (WebGL via Gtk.GLArea)
14
29
  gjsify showcase three-geometry-teapot
15
30
  # or: gjsify run start
16
31
 
32
+ # The same --app node bundle on Node.js / Bun / Deno
33
+ gjsify showcase three-geometry-teapot --runtime node # or: bun | deno
34
+ # or: gjsify run start:node
35
+
17
36
  # Browser (serves dist/ on localhost:8080)
18
37
  gjsify run start:browser
19
38
  ```
@@ -21,10 +40,28 @@ gjsify run start:browser
21
40
  ## What it demonstrates
22
41
 
23
42
  - WebGL rendering on GJS via `@gjsify/webgl` (Vala bridge over `Gtk.GLArea` + libepoxy)
24
- - three.js (`THREE.WebGLRenderer`) running unmodified on GJS
25
- - Shared `start(canvas)` pattern — identical entry for GJS and browser
26
- - Adwaita design language in both variants
27
- - `gjsify build --app gjs` and `--app browser` dual-target build
43
+ - three.js (`THREE.WebGLRenderer`) running unmodified on GJS — `TeapotGeometry`, `OrbitControls` and a pisa cube-map environment straight from `three/addons`
44
+ - Shared `start(canvas)` pattern — identical entry for GJS, Node and browser
45
+ - Adwaita design language in both variants (native `Adw.*` widgets on GJS, `@gjsify/adwaita-web` in the browser)
46
+ - Live two-way controls over the running scene: tessellation level, lid/body/bottom visibility, snug lid, shading and material — `Adw.ComboRow` / `Adw.SwitchRow` in a sidebar on GJS, the same set as web components in the browser
47
+ - `gjsify build --app gjs`, `--app node` and `--app browser` from one source tree
48
+
49
+ ## Layout
50
+
51
+ ```
52
+ src/
53
+ three-demo.ts shared start(canvas) — the whole demo, platform-agnostic
54
+ gjs/ Adw.Application + teapot-window.blp (Blueprint UI)
55
+ browser/ adwaita-web shell + index.html + webgl.css
56
+ assets/ uv_grid_opengl.jpg + pisa/ cube map
57
+ ```
58
+
59
+ ## Related
60
+
61
+ - [`@gjsify/webgl`](../../../packages/framework/webgl) — the `WebGLBridge` implementation this exercises
62
+ - [`@gjsify/adwaita-web`](../../../packages/web/adwaita-web) — the Adwaita web components of the browser variant
63
+ - [`three-postprocessing-pixel`](../three-postprocessing-pixel) — the same seam driving a three.js `EffectComposer` chain
64
+ - [`three-geometry-teapot-nativescript`](../three-geometry-teapot-nativescript) — the Android/NativeScript target of this teapot
28
65
 
29
66
  ## License
30
67