Skip to content

editor › Globals › MaterialDefinition

Class: MaterialDefinition

This class serves as the base material for all physical materials of plates (e.g. wood, metal). It defines the visual and physical properties of the material. Visuals are described by several textures for different parts of a plate (surface/side).

The full workflow for creating seamless textures: - Make a photo of the material - smooth lighting to avoid any gradients or reflections - head-on to avoid distortion - place a size reference in the image - use a good camera - ideally have a color calibration strip in the image - Adjust colors, exposure, perspective and lens distortion in Photoshop (e.g. in the Camera Raw import dialog) - Crop a square portion of the image of at least 2048px, note the physical size of the image - Save to PNG - Open it in GIMP and apply Filter -> Map -> Tile Seamless - Save and go back to Photoshop - Manually tile the image 2x2 and zoom out. If any features stand out, try to remove them - adjust brightness using a Brightness/Contrast layer with a very fuzzy layer mask - remove spots (e.g. with the Spot Healing Brush tool) - Save as PNG with 2048px resolution --> texture.png - Optimize the texture with e.g. guetzli (https://github.com/google/guetzli) - guetzli --quality 84 texture.png texture.jpg

If you want to use mix mapping (@see http://www.neilblevins.com/cg_education/tiling_trick/tiling_trick.htm), you should use different parts of the same image in order to make sure that there are no major differences between the textures.

(You can of course do all steps in GIMP if you are familiar with it.)

Hierarchy

  • MaterialDefinition

↳ PBRMaterialDefinition

↳ AssetPlaceholderPlywood

↳ BackgroundMaterial

↳ DeletionMaterial

↳ ExternalObjectMaterial

↳ Foamcore

↳ MDF

↳ Poplar

↳ PreviewPlywood

Index

Constructors

Properties

Constructors

constructor

+ new MaterialDefinition(colorizeColor?: number | null): MaterialDefinition

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:122

creates a new instance of this material definition.

Parameters:

Name Type Description
colorizeColor? number | null ignored by non-colorable materials

Returns: MaterialDefinition

Properties

collisionSounds

• collisionSounds: string[] = []

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:91

An array of file names (without file type), that should be played when this material collides with something.


density

• density: number = 500

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:86

The density of the material in kg/m^3


displayName

• displayName: string

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:64

name of the material that can be displayed to the user


emissive

• emissive: number = 0

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:100


engravedLightnessesSamples

• engravedLightnessesSamples: DataPoint[] = [ [1.0, 1.0], [0.9, 0.9], [0.8, 0.8], [0.7, 0.7], [0.6, 0.6], [0.5, 0.5], [0.4, 0.4], [0.3, 0.3], [0.2, 0.2], [0.1, 0.1], [0.0, 0.0], ]

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:104


engravingColor

• engravingColor: number = 0

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:102


envMapUrls

• envMapUrls: string[] = []

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:96

Paths to images for cube map (when using physically based rendering).


friction

• friction: number = 0.1

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:77


isOverlay

• isOverlay: boolean = false

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:122

Whether this material should always be visible above if there are multiple materials at the same position. Only works for one at a time.


opacity

• opacity: number = 1

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:74


restitution

• restitution: number = 0.3

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:78


shininess

• shininess: number = 10

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:98


stiffness

• stiffness: number = 35

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:81


textureDefinitions

• textureDefinitions: Map‹TextureKey, ITextureDefinition› = new Map()

Defined in src/model/visualization/materials/materialDefinitions/MaterialDefinition.ts:72

String <-> String|String[] dictionary to map texture keys to URLs of tiled textures.

see http://www.neilblevins.com/cg_education/tiling_trick/tiling_trick.htm

see MixMapEngravingMaterial