threepipe
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ClearcoatTintPlugin.md 1.3KB

пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---
  2. prev:
  3. text: 'CustomBumpMapPlugin'
  4. link: './CustomBumpMapPlugin'
  5. next:
  6. text: 'FragmentClippingExtensionPlugin'
  7. link: './FragmentClippingExtensionPlugin'
  8. ---
  9. # ClearcoatTintPlugin
  10. [//]: # (todo: image)
  11. [Example](https://threepipe.org/examples/#clearcoat-tint-plugin/) —
  12. [Source Code](https://github.com/repalash/threepipe/blob/master/src/plugins/material/ClearcoatTintPlugin.ts) —
  13. [API Reference](https://threepipe.org/docs/classes/ClearcoatTintPlugin.html)
  14. ClearcoatTintPlugin adds a material extension to PhysicalMaterial which adds tint and thickness to the built-in clearcoat properties.
  15. It also adds a UI to the material to edit the settings.
  16. It uses `WEBGI_materials_clearcoat_tint` glTF extension to save the settings in glTF/glb files.
  17. ```typescript
  18. import {ThreeViewer, ClearcoatTintPlugin} from 'threepipe'
  19. const viewer = new ThreeViewer({...})
  20. const clearcoatTint = viewer.addPluginSync(ClearcoatTintPlugin)
  21. material.clearcoat = 1
  22. // add initial properties
  23. ClearcoatTintPlugin.AddClearcoatTint(material, {
  24. tintColor: '#ff0000',
  25. thickness: 1,
  26. })
  27. // Change properties with code or use the UI
  28. material.userData._clearcoatTint!.tintColor = '#ff0000'
  29. material.setDirty()
  30. // Disable
  31. material.userData._clearcoatTint.enableTint = false
  32. material.setDirty()
  33. ```