threepipe
Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ClearcoatTintPlugin.md 1.3KB


prev:

text: 'CustomBumpMapPlugin'
link: './CustomBumpMapPlugin'

next:

text: 'FragmentClippingExtensionPlugin'
link: './FragmentClippingExtensionPlugin'

ClearcoatTintPlugin

ExampleSource CodeAPI Reference

ClearcoatTintPlugin adds a material extension to PhysicalMaterial which adds tint and thickness to the built-in clearcoat properties. It also adds a UI to the material to edit the settings. It uses WEBGI_materials_clearcoat_tint glTF extension to save the settings in glTF/glb files.

import {ThreeViewer, ClearcoatTintPlugin} from 'threepipe'

const viewer = new ThreeViewer({...})

const clearcoatTint = viewer.addPluginSync(ClearcoatTintPlugin)

material.clearcoat = 1
// add initial properties
ClearcoatTintPlugin.AddClearcoatTint(material, {
  tintColor: '#ff0000',
  thickness: 1,
})

// Change properties with code or use the UI
material.userData._clearcoatTint!.tintColor = '#ff0000'
material.setDirty()

// Disable
material.userData._clearcoatTint.enableTint = false
material.setDirty()