Mesh Materials
9 nodes
On this page 9
Bake Mesh Maps
FunctionBakes a model's maps into its texture coordinates: ambient occlusion and thickness by tracing rays against the model, curvature from how its surface bends, and its position, world-space normal and parts.
BakeMeshMaps -> Mesh Maps
mesh: MaterialMesh
size: Integer
samples: Integer
occlusionDistance: NumberMeshMapSet BakeMeshMaps(
MaterialMesh mesh,
int size = 512,
int samples = 48,
double occlusionDistance = 0.25)Parameters
| name | type | default | description |
|---|---|---|---|
| mesh | MaterialMesh | — | The model, unwrapped. |
| size | Integer | 512 | The maps' width and height in pixels. |
| samples | Integer | 48 | Rays per pixel for occlusion and thickness; more is smoother and slower. |
| occlusionDistance | Number | 0.25 | How far occlusion looks, as a share of the model's size. |
Returns
| result | Mesh Maps |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Load Mesh
FunctionA model read from an OBJ, glTF or GLB file: its triangles, normals and first texture coordinates. It must already be unwrapped.
LoadMesh(path: Text) -> MaterialMesh
MaterialMesh LoadMesh(string path)
Parameters
| name | type | default | description |
|---|---|---|---|
| path | Text | — | The model file. |
Returns
| result | MaterialMesh |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Mask From Direction
FunctionA mask from which way the model's surface faces: white where it faces the direction, falling off over the spread. Moss and snow on upward faces, drips under overhangs.
MaskFromDirection -> Texture
maps: Mesh Maps
direction: Facing Direction
spread: Number
contrast: NumberTexture MaskFromDirection(
MeshMapSet maps,
FacingDirection direction = FacingDirection.Up,
double spread = 0.5,
double contrast = 0.5)Parameters
| name | type | default | description |
|---|---|---|---|
| maps | Mesh Maps | — | The baked maps. |
| direction | Facing Direction | Up | The direction that is white. |
| spread | Number | 0.5 | How far round from the direction the mask reaches, 0 to 1. |
| contrast | Number | 0.5 | How hard its edge is, 0 to 1. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Mask From Height
FunctionA mask from height on the model: white below a level, black above, softened - rising damp, mud splashed at a base, a tide line.
MaskFromHeight -> Texture
maps: Mesh Maps
level: Number
softness: Number
invert: TruthTexture MaskFromHeight(
MeshMapSet maps,
double level = 0.25,
double softness = 0.1,
bool invert = false)Parameters
| name | type | default | description |
|---|---|---|---|
| maps | Mesh Maps | — | The baked maps. |
| level | Number | 0.25 | The level as a share of the model's height, 0 at its bottom. |
| softness | Number | 0.1 | How gradual the change is. |
| invert | Truth | False | White above the level instead. |
Returns
| result | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Mesh Map Channels
FunctionThe individual baked maps.
MeshMapChannels(maps: Mesh Maps) -> (result: Texture, curvature: Texture, position: Texture, worldNormal: Texture, thickness: Texture, partId: Texture)
Texture MeshMapChannels(
MeshMapSet maps,
out Texture curvature,
out Texture position,
out Texture worldNormal,
out Texture thickness,
out Texture partId)Parameters
| name | type | default | description |
|---|---|---|---|
| maps | Mesh Maps | — | The baked maps. |
Returns
| result | Texture |
| curvature | Texture |
| position | Texture |
| worldNormal | Texture |
| thickness | Texture |
| partId | Texture |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Preview On Mesh
FunctionA material rendered on a model, the camera placed to fit the model.
PreviewOnMesh -> Pixel Image
mesh: MaterialMesh
material: PBR Material
environment: PreviewEnvironment
size: Integer
rotation: Number
relief: PreviewReliefPixelImage PreviewOnMesh(
MaterialMesh mesh,
PbrMaterial material,
PreviewEnvironment environment = PreviewEnvironment.Studio,
int size = 512,
double rotation = 30,
PreviewRelief relief = PreviewRelief.Parallax)Parameters
| name | type | default | description |
|---|---|---|---|
| mesh | MaterialMesh | — | The model. |
| material | PBR Material | — | The material, in the model's texture coordinates (from a layer stack or a triplanar projection). |
| environment | PreviewEnvironment | Studio | The lighting. |
| size | Integer | 512 | The picture's width and height in pixels. |
| rotation | Number | 30 | Turns the model, in degrees. |
| relief | PreviewRelief | Parallax | How the material's height shows. Parallax works on any model; displacement moves the model's own vertices, so it needs a finely divided one. |
Returns
| result | Pixel Image |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Sample Mesh
FunctionOne of the sample shapes, unwrapped so that every point of its surface has its own texture coordinates: a model to bake and texture without leaving the graph.
SampleMesh(shape: PreviewShape, detail: Integer) -> MaterialMesh
MaterialMesh SampleMesh(
PreviewShape shape = PreviewShape.RoundedBox,
int detail = 64)Parameters
| name | type | default | description |
|---|---|---|---|
| shape | PreviewShape | Rounded box | The shape. |
| detail | Integer | 64 | How finely it is divided. |
Returns
| result | MaterialMesh |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Triangle Count
FunctionHow many triangles a mesh has.
TriangleCount(mesh: MaterialMesh) -> Integer
int TriangleCount(MaterialMesh mesh)
Parameters
| name | type | default | description |
|---|---|---|---|
| mesh | MaterialMesh | — | The mesh. |
Returns
| result | Integer |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing
Triplanar Project
FunctionProjects a tiling material onto a model from three sides (triplanar), so it needs no seams in the model's own layout: each side of the model takes the projection facing it, blended where they meet. The result is laid out in the model's texture coordinates, ready for a layer stack.
TriplanarProject -> PBR Material
material: PBR Material
maps: Mesh Maps
tileMetres: Number
sharpness: NumberPbrMaterial TriplanarProject(
PbrMaterial material,
MeshMapSet maps,
double tileMetres = 0.5,
double sharpness = 4)Parameters
| name | type | default | description |
|---|---|---|---|
| material | PBR Material | — | The tiling material. |
| maps | Mesh Maps | — | The model's baked maps. |
| tileMetres | Number | 0.5 | The width one tile covers on the model, in metres. |
| sharpness | Number | 4 | How narrow the blend between sides is: 1 soft, 8 nearly hard. |
Returns
| result | PBR Material |
- Ships with
- Divooka ExploreDivooka Compute
- Graph kinds
- Flows Function Events Routine Constructs StateMachineState
- Declared by
- Mesh Materials
- Package
- Image Processing