Material
Defined in: radiance/src/materials/Material.ts:19
How a surface scatters and gives off light. Each material is one 128-byte record of the path
tracer’s material table (design record 0004, “The record”), and the kernel’s shading functions
(kernels/materials.shade.ts) read it. A subclass says which scattering it asks for by its
type. What the kernel does for each type lives in TypeShade, as three.js keeps its shading in
TSL nodes.
The setter of every parameter adds 1 to version. The renderer also compares each material’s
record with the last frame’s, so an edit in place, such as material.color.setHex(0xff0000),
reaches the next frame too.
Extended by
Section titled “Extended by”Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new Material(
color,emissive):Material
Defined in: radiance/src/materials/Material.ts:39
Parameters
Section titled “Parameters”emissive
Section titled “emissive”Returns
Section titled “Returns”Material
Properties
Section titled “Properties”
readonlyid:number
Defined in: radiance/src/materials/Material.ts:20
name:
string=''
Defined in: radiance/src/materials/Material.ts:22
A name for the author. The renderer does not read it.
abstractreadonlytype:number
Defined in: radiance/src/materials/Material.ts:26
The scattering the kernel applies: 0 diffuse, 1 mirror, 2 physical.
version
Section titled “version”version:
number=0
Defined in: radiance/src/materials/Material.ts:24
Incremented by the setter of every parameter.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get color():
Color
Defined in: radiance/src/materials/Material.ts:45
The fraction of light reflected, per channel.
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set color(
value):void
Defined in: radiance/src/materials/Material.ts:48
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
doubleSided
Section titled “doubleSided”Get Signature
Section titled “Get Signature”get doubleSided():
boolean
Defined in: radiance/src/materials/Material.ts:63
Whether the surface gives off light from its back face too. Default false.
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set doubleSided(
value):void
Defined in: radiance/src/materials/Material.ts:66
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void
emissive
Section titled “emissive”Get Signature
Section titled “Get Signature”get emissive():
Color
Defined in: radiance/src/materials/Material.ts:54
The light the surface gives off from its front face, as radiance.
Returns
Section titled “Returns”Set Signature
Section titled “Set Signature”set emissive(
value):void
Defined in: radiance/src/materials/Material.ts:57
Parameters
Section titled “Parameters”Returns
Section titled “Returns”void
flatShading
Section titled “flatShading”Get Signature
Section titled “Get Signature”get flatShading():
boolean
Defined in: radiance/src/materials/Material.ts:76
Whether the kernel shades with the geometric normal in place of the interpolated vertex
normals, as three.js’s material.flatShading does. Default false. The geometry and the hits
do not change (design record 0004, “Flat shading”).
Returns
Section titled “Returns”boolean
Set Signature
Section titled “Set Signature”set flatShading(
value):void
Defined in: radiance/src/materials/Material.ts:79
Parameters
Section titled “Parameters”boolean
Returns
Section titled “Returns”void