pmndrs / three-stdlib

📚 Stand-alone library of threejs examples designed to run without transpilation in node & browser
https://npmjs.com/three-stdlib
MIT License
733 stars 119 forks source link

fix(USDZExporter): alpha issues in diffuse map #364

Closed Patrick-van-Halm-360Fabriek closed 6 months ago

Patrick-van-Halm-360Fabriek commented 6 months ago

Why

When applying a texture with a transparent background, the USDZ exporter doesn't export the transparency of the texture. In this PR it will fix it.

What

I changed the shader of the USDZ exporter to include the opacity as alpha and opacityThreshold. The applied changes are based of the Pull request in THREE,js USDZExporter: Support opacity materials. It looks like this change later was removed from the source code again. I reimplemented it in this code base with an additional step to always include an opacityThreshold of 0.01 when the material is transparent since it will show a white blur if not.

codesandbox-ci[bot] commented 6 months ago

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 2.30.2 :tada:

The release is available on:

Your semantic-release bot :package::rocket: