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ů.

NoiseBumpMaterialPlugin.md 1.4KB


prev:

text: 'FilmicGrainPlugin'
link: './FilmicGrainPlugin'

next:

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

NoiseBumpMaterialPlugin

ExampleSource CodeAPI Reference

NoiseBumpMaterialPlugin adds a material extension to PhysicalMaterial to add support for sparkle bump / noise bump by creating procedural bump map from noise to simulate sparkle flakes. It uses voronoise function from blender along with several additions to generate the noise for the generation. It also adds a UI to the material to edit the settings. It uses WEBGI_materials_noise_bump glTF extension to save the settings in glTF/glb files.

import {ThreeViewer, NoiseBumpMaterialPlugin} from 'threepipe'

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

const noiseBump = viewer.addPluginSync(NoiseBumpMaterialPlugin)

// Add noise bump to a material
NoiseBumpMaterialPlugin.AddNoiseBumpMaterial(material, {
  flakeScale: 300,
})

// Change properties with code or use the UI
material.userData._noiseBumpMat!.bumpNoiseParams = [1, 1]
material.setDirty()

// Disable
material.userData._noiseBumpMat!.hasBump = false
material.setDirty()