sceneview-web 3.5.2 → 3.6.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
ADDED
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
# SceneView Web
|
|
2
|
+
|
|
3
|
+
3D rendering for browsers using **Filament.js** (WebGL2/WASM) — the same rendering engine as SceneView Android.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @sceneview/sceneview-web
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```html
|
|
14
|
+
<canvas id="scene-canvas" style="width:100%;height:100vh"></canvas>
|
|
15
|
+
<script src="sceneview-web.js"></script>
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
```kotlin
|
|
19
|
+
SceneView.create(
|
|
20
|
+
canvas = document.getElementById("scene-canvas") as HTMLCanvasElement,
|
|
21
|
+
configure = {
|
|
22
|
+
camera {
|
|
23
|
+
eye(0.0, 1.5, 5.0)
|
|
24
|
+
target(0.0, 0.0, 0.0)
|
|
25
|
+
}
|
|
26
|
+
model("models/DamagedHelmet.glb")
|
|
27
|
+
},
|
|
28
|
+
onReady = { it.startRendering() }
|
|
29
|
+
)
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
## JavaScript API (sceneview.js v1.5.0)
|
|
33
|
+
|
|
34
|
+
For browser usage without Kotlin, use `sceneview.js` directly:
|
|
35
|
+
|
|
36
|
+
```html
|
|
37
|
+
<script src="https://cdn.jsdelivr.net/npm/sceneview-web@3.6.0/sceneview.js"></script>
|
|
38
|
+
<script>
|
|
39
|
+
SceneView.modelViewer("canvas", "model.glb", {
|
|
40
|
+
backgroundColor: [0.05, 0.05, 0.08, 1],
|
|
41
|
+
lightIntensity: 150000,
|
|
42
|
+
fov: 35
|
|
43
|
+
});
|
|
44
|
+
</script>
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Full API
|
|
48
|
+
|
|
49
|
+
| Method | Description |
|
|
50
|
+
|---|---|
|
|
51
|
+
| `SceneView.modelViewer(canvas, url, options?)` | One-line 3D model viewer |
|
|
52
|
+
| `SceneView.create(canvas, options?)` | Create instance for full API |
|
|
53
|
+
| `instance.loadModel(url)` | Load glTF/GLB model |
|
|
54
|
+
| `instance.setAutoRotate(enabled)` | Toggle auto-rotation |
|
|
55
|
+
| `instance.setCameraDistance(d)` | Set orbit camera distance |
|
|
56
|
+
| `instance.setBackgroundColor(r, g, b, a?)` | Set clear color |
|
|
57
|
+
| `instance.setQuality('low'\|'medium'\|'high')` | AO + anti-aliasing quality |
|
|
58
|
+
| `instance.setBloom(true\|false\|options)` | Bloom post-processing |
|
|
59
|
+
| `instance.addLight(options)` | Add directional/point/spot light |
|
|
60
|
+
| `instance.createText(options)` | Render text as 3D quad |
|
|
61
|
+
| `instance.createImage(options)` | Render image as 3D quad |
|
|
62
|
+
| `instance.createVideo(options)` | Stream video to 3D quad |
|
|
63
|
+
| `instance.removeNode(entity)` | Remove node from scene |
|
|
64
|
+
| `instance.dispose()` | Clean up resources |
|
|
65
|
+
|
|
66
|
+
## Features
|
|
67
|
+
|
|
68
|
+
- Same Filament PBR renderer as Android (compiled to WASM)
|
|
69
|
+
- glTF 2.0 / GLB model loading
|
|
70
|
+
- IBL environment lighting (KTX)
|
|
71
|
+
- Camera configuration (FOV, position, exposure)
|
|
72
|
+
- Directional, point, and spot lights
|
|
73
|
+
- Animation playback
|
|
74
|
+
- Quality presets (low/medium/high)
|
|
75
|
+
- Bloom post-processing
|
|
76
|
+
- Text, image, and video nodes
|
|
77
|
+
- Billboard mode (always face camera)
|
|
78
|
+
- Kotlin/JS DSL API + vanilla JavaScript API
|
|
79
|
+
|
|
80
|
+
## Requirements
|
|
81
|
+
|
|
82
|
+
- WebGL2 browser (~95% coverage)
|
|
83
|
+
- No AR support (requires native sensors)
|
|
84
|
+
|
|
85
|
+
## Part of SceneView
|
|
86
|
+
|
|
87
|
+
SceneView is a declarative 3D/AR SDK for Android, iOS, macOS, visionOS, Web, and Desktop.
|
|
88
|
+
|
|
89
|
+
- [GitHub](https://github.com/sceneview/sceneview)
|
|
90
|
+
- [Documentation](https://sceneview.github.io)
|
package/package.json
CHANGED
|
@@ -1,14 +1,31 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sceneview-web",
|
|
3
|
-
"version": "3.
|
|
4
|
-
"description": "SceneView for Web
|
|
5
|
-
"main": "sceneview-web.js",
|
|
6
|
-
"
|
|
3
|
+
"version": "3.6.0",
|
|
4
|
+
"description": "SceneView for Web \u2014 3D rendering with Filament.js (WebGL2/WASM). Same engine as SceneView Android.",
|
|
5
|
+
"main": "build/dist/js/productionExecutable/sceneview-web.js",
|
|
6
|
+
"files": [
|
|
7
|
+
"build/dist/js/productionExecutable/sceneview-web.js",
|
|
8
|
+
"build/dist/js/productionExecutable/sceneview-web.js.map"
|
|
9
|
+
],
|
|
10
|
+
"keywords": [
|
|
11
|
+
"3d",
|
|
12
|
+
"webgl",
|
|
13
|
+
"filament",
|
|
14
|
+
"sceneview",
|
|
15
|
+
"gltf",
|
|
16
|
+
"wasm",
|
|
17
|
+
"pbr",
|
|
18
|
+
"rendering",
|
|
19
|
+
"kotlin"
|
|
20
|
+
],
|
|
7
21
|
"homepage": "https://github.com/sceneview/sceneview",
|
|
8
22
|
"repository": {
|
|
9
23
|
"type": "git",
|
|
10
24
|
"url": "https://github.com/sceneview/sceneview.git",
|
|
11
25
|
"directory": "sceneview-web"
|
|
12
26
|
},
|
|
13
|
-
"license": "Apache-2.0"
|
|
27
|
+
"license": "Apache-2.0",
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"filament": ">=1.52.0"
|
|
30
|
+
}
|
|
14
31
|
}
|
|
File without changes
|
|
File without changes
|