zalo / CascadeStudio

A Full Live-Scripted CAD Kernel in the Browser
https://zalo.github.io/CascadeStudio/
MIT License
998 stars 122 forks source link

[FEAT] Add UV Mapping #83

Closed zalo closed 3 years ago

zalo commented 3 years ago

This PR adds UV Map Calculation to the models generated by CascadeStudio.

image

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/zalo/cascade-studio/9UQf8fkLA8YcFd1XVgEMPDHPLS4A
✅ Preview: https://cascade-studio-git-feat-uv-mapping-zalo.vercel.app

zalo commented 3 years ago

Just added texture atlassing with potpack.

Model View: image

UV Space View (before Padding): image

Still costs only like 20 milliseconds. A really good deal to enable lightmapping.

zalo commented 3 years ago

Check out the lightmapping demo that this is powering: https://zalo.github.io/three.js/examples/?q=shadowmap#webgl_shadowmap_progressive