Related to #32. Something like the following:
const uvGenerator = new UVGenerator();
uvGenerator.attributeName = 'uv2';
uvGenerator.generate( targetMeshes );
const aoGenerator = new AOMapGenerator();
aoGenerator.samples = 1000;
aoGenerator.attributeName = 'uv2';
const targetMeshes = [ ... ];
const texture = await aoGenerator.generate( renderer, targetMeshes, aoBvh );
Untested UV unwrapping logic using xatlas is here:
https://github.com/gkjohnson/three-gpu-pathtracer/blob/main/src/utils/UVUnwrapper.js
Originally from this Mozilla Spoke commit:
Hubs-Foundation/Spoke@9701d64
TODO
- Write uv generator and ao map generator utilities
- AO map must be flooded between triangles to avoid seams
- Update example to show mesh with unwrapped UVs and live generating ao map
- Update example to show 2d projection of ao map
- Update example to take target map resolution
Related to #32. Something like the following:
Untested UV unwrapping logic using xatlas is here:
https://github.com/gkjohnson/three-gpu-pathtracer/blob/main/src/utils/UVUnwrapper.js
Originally from this Mozilla Spoke commit:
Hubs-Foundation/Spoke@9701d64
TODO