MeshTransmissionNodeMaterial
new MeshTransmissionNodeMaterial(parameters : Object)Constructs a new transmission node material.
Use setValues(parameters) to override properties; see property docs below.
Constructor Parameters
parametersoptionalObjectDefault is
{}.chromaticAberrationoptionalnumberStrength of per-channel IOR dispersion.
Default is0.4.anisotropicBluroptionalnumberMinimum smear in the thickness direction for rough surfaces.
Default is0.38.timeoptionalnumberTime uniform used by temporal distortion.
Default is0.distortionoptionalnumberDistortion amount applied to the refraction normal via noise; scales amplitude, 0 disables.
Default is0.distortionScaleoptionalnumberDistortion noise scale in world units.
Default is0.temporalDistortionoptionalnumberStrength of time-based distortion animation.
Default is0.ditherStrengthoptionalnumberBlue-noise jitter strength for sampling stability.
Default is0.5.ditherScaleoptionalnumberBlue-noise tiling frequency (higher values tile smaller).
Default is128.coloroptionalTHREE.Color|string|numberBase albedo color.
Default is0xffffff.viewportBufferoptional*Optional TSL sampler/texture node used to sample the scene; defaults to renderer viewport mip texture.
Default isnull.
Example
import { MeshTransmissionNodeMaterial } from '@three-blocks/core';
import * as THREE from 'three/webgpu';
// Create transmission material
const mat = new MeshTransmissionNodeMaterial({
color: new THREE.Color('#ffffff'),
roughness: 0.2,
thickness: 0.5,
ior: 1.5,
chromaticAberration: 0.4,
anisotropicBlur: 0.1,
distortion: 0.0,
attenuationDistance: 0.5,
attenuationColor: new THREE.Color('#ffffff')
});
const geometry = new THREE.TorusKnotGeometry(1, 0.4, 128, 32);
const mesh = new THREE.Mesh(geometry, mat);
scene.add(mesh);
Properties
# .isMeshTransmissionNodeMaterial : boolean
This flag can be used for type testing.
Default is true.
# .forceSinglePass : boolean
Render in a single pass. Yield better visual and performance results when sampling the backdrop texture.
Default is true.
# .chromaticAberration : number
Strength of per-channel IOR dispersion. Higher values increase color fringing.
Default is 0.4.
# .transmissionMap : THREE.Texture|null
Optional map kept for API parity with other materials. Not sampled by this material.
Default is null.
# .attenuationDistance : number
Beer–Lambert attenuation distance; set to Infinity to disable attenuation.
Default is Infinity.
# .anisotropicBlur : number
Minimum smear in the thickness direction for rough surfaces.
Default is 0.38.
# .time : number
Time value used for temporal distortion animation.
Default is 0.
# .distortion : number
Distortion amount applied to the perturbed refraction normal via noise. Values scale the noise amplitude; 0 disables the effect.
Default is 0.
# .distortionScale : number
Distortion noise scale in world units.
Default is 0.
# .temporalDistortion : number
Strength of time-based distortion animation.
Default is 0.
# .ditherStrength : number
Blue-noise jitter strength for sampling stability.
Default is 0.5.
# .ditherScale : number
Blue-noise tiling frequency (higher values tile smaller).
Default is 128.
# .viewportBuffer : *
Optional TSL sampler/texture node used to sample the scene/backdrop.
If null, the renderer's viewport mip texture is used.
Default is null.
# .backdropNode : *
Backdrop refraction node injected into the physical transmission pipeline.
Methods
attachGUI#
attachGUI(gui : *) : voidAttaches a debug UI for tuning transmission parameters. Compatible with lil-gui, dat.gui, and Three.js Inspector.
Parameters
gui*Returns
voiddisposeGUI#
disposeGUI() : thisDestroys and clears the debug folder if attached.
Returns
thisdispose#
dispose()Disposes material resources and detaches any debug UI.