https://github.com/madjin/lightmap-tests
testing glTF lightmaps for web
https://github.com/madjin/lightmap-tests
babylonjs gltf playcanvas threejs webgl
Last synced: 6 months ago
JSON representation
testing glTF lightmaps for web
- Host: GitHub
- URL: https://github.com/madjin/lightmap-tests
- Owner: madjin
- Created: 2023-01-28T07:05:50.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-01-28T07:35:34.000Z (over 2 years ago)
- Last Synced: 2025-02-12T17:19:36.643Z (8 months ago)
- Topics: babylonjs, gltf, playcanvas, threejs, webgl
- Language: JavaScript
- Homepage: https://madjin.github.io/lightmap-tests/
- Size: 44.6 MB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# lightmap-tests
testing glTF lightmaps- https://engine.needle.tools/docs/export.html#exporting-lightmaps
- https://github.com/needle-tools/needle-engine-support/blob/main/documentation/technical-overview.md#needle_lightmaps### NEEDLE_lightmaps
This is a root extension defining a set of lightmaps for the glTF file.
```json
"NEEDLE_lightmaps": {
"textures": [
{
"pointer": "textures/20",
"type": 1,
"index": 0
}
]
}
```> **Note**: At the moment this extension also contains environment texture references. We're planning to change that in a future release.
| Texture Type | Value |
| -- | -- |
| Lightmap | 0 |
| Environment Map | 1 |
| Reflection Map | 2 |How lightmaps are applied is defined in the `MeshRenderer` component inside the [`NEEDLE_components`](#needle_components) extension per node:
```json
"NEEDLE_components": {
"builtin_components": [
{
"name": "MeshRenderer",
...
"lightmapIndex": 0,
"lightmapScaleOffset": {
"x": 1.00579774,
"y": 1.00579774,
"z": -0.00392889744,
"w": -0.00392889744
},
...
}
]
}
```> **Note**: We may change that in a future release and move lightmap-related data to a `NEEDLE_lightmap` extension entry per node.
How it looks in Unity
How it looks with Needle Engine (threejs)
How it looks in [gltf-viewer](https://gltf-viewer.donmccurdy.com/)
How it looks in [hyperfy.io](https://hyperfy.io/uq9p8o1qjq)
