aframevr component for auto baking ambient occlusion to the vertex colors
npm install aframe-aobake-componentThe AO bake is a component created for A-Frame. It will automatically bake the ambient occlusion to the vertex colors to geometry of meshes.
* Because the AO is baked to the vertex colors the more geometry the better the effect.
* Can be quite slow, so once backed, it is advised to export the colors to a gltf model using aframes export feature.
* If polygons overlap without verts along the intersection then the results will be off.
| Method | Description |
|--------|-------------|
| applyAO | Manually apply AO when auto-apply is false |
| Name | Event Type | Description |
|------|-------|-------------|
| children-ready | N/A | Dispatched when all models in child elements have finshed loading |
| ao-baked | N/A | Dispatched when the AO has been baked |
To use the component you just add the component to the A-Frame entity containing the html. For example:
``html`
Install and use by directly including the browser files:
`html`
Install via npm:
npm install aframe-aobake-component
Then register and use.
`js`
require('aframe');
require('aframe-aobake-component');
- Install Node.js.
- Clone the project to your file system:
``
git clone https://github.com/supereggbert/aframe-aobake-component.git
* enter the aframe-aobake-component directory.
`cd ./aframe-aobake-component`
* Install build dependencies
`npm install`
* Run the build script.
`npm run build`
The compiled file is at aframe-aobake-component/dist/build.js`