Overlays a procedural paper grain on a material — a neutral, achromatic texture of mottling, tooth, and fine granulation — the way to give a flat color the tactile feel of ink on real paper.
Declarative element:
<sk-paper-texture-color-source>
Not on the sk.* global — construct via the declarative element or a module import.
This is the paper-grain member of the ColorSource family: like every
color-source it gives a material a base color that varies across the surface,
but uniquely it outputs pure texture — a gray field centered on 50% neutral —
and never reads the material's own color. Because it carries no baked-in color,
it composes onto any base through a blend mode, so the same sheet of paper can
texture many different colors.
Key attributes. mottle, tooth, and fine are the strengths of the
three noise scales (broad density variation, paper tooth, pixel-scale grain);
mottle-scale / tooth-scale set their cell sizes in pixels. speck adds rare
pigment flecks. contrast shapes the grain from soft/felt-like (0) to crisp
paper (1+). seed selects an independent sheet (whole numbers). projection
is screen (the printed look, default) or triplanar (grain attached to the
surface). In the default screen projection the grain is screen-space, so every
material sharing these parameters shows one continuous sheet across the image;
triplanar instead samples the grain in a world (or, with a projection-node,
that node's local) frame, so it stays fixed to space rather than to the screen.
The blend mode carries the look. Since the source is neutral, pair it with
base-color-source-blend-mode="overlay" (the paper look — neutral leaves the
base untouched, swings modulate proportionally, flecks hit true black/white on
any base) or "soft-light" (gentler). As a layer of
sk-composite-color-source the same modes blend the paper over a sibling
source such as a ramp.
Related. A material selects it with base-color-source="#id" (see
sk-plain-material). It layers naturally under a
sk-color-map-source inside a sk-composite-color-source.
constructor(config?: { mottle?: number; mottleScale?: number; tooth?: number; toothScale?: number; fine?: number; speck?: number; contrast?: number; seed?: number; screenAnchor?: ScreenAnchorNode | null; projection?: PaperProjection; projectionNode?: ScreenAnchorNode | null; textureScale?: number; blendSharpness?: number })
Inherited from: ColorSource, VisualizableSceneNode, SceneNode, SkenraAnimatable
— see those pages for inherited members.
| Property | Type | Default | Description | Declared by |
|---|---|---|---|---|
mottleanimatable |
number |
1 |
Broad paper-density mottling strength multiplier (0 disables). Default 1. |
PaperTextureColorSource |
mottleScaleanimatable |
number |
130 |
Cell size of the mottling noise, in pixels (>= 1). Default 130. |
PaperTextureColorSource |
toothanimatable |
number |
1 |
Paper-tooth strength multiplier (0 disables). Default 1. |
PaperTextureColorSource |
toothScaleanimatable |
number |
11 |
Cell size of the tooth noise, in pixels (>= 1). Default 11. |
PaperTextureColorSource |
fineanimatable |
number |
1 |
Pixel-scale granulation strength multiplier (0 disables). Default 1. |
PaperTextureColorSource |
speckanimatable |
number |
0 |
Rare pigment-fleck strength multiplier (0 disables) — maps to fleck | PaperTextureColorSource |
contrastanimatable |
number |
1 |
Amplitude shaping of the tooth/fine grain: 0 leaves the raw noise |
PaperTextureColorSource |
seedanimatable |
number |
0 |
Selects which paper field is drawn; whole numbers only. Default 0. |
PaperTextureColorSource |
screenAnchor |
ScreenAnchorNode | null |
— | The node whose PROJECTED SCREEN POSITION re-origins the texture | PaperTextureColorSource |
projection |
PaperProjection |
"screen" |
How the texture domain is built: 'screen' (fragCoord — the printed |
PaperTextureColorSource |
projectionNode |
ScreenAnchorNode | null |
— | Tri-planar frame node: the texture samples in this node's LOCAL frame, | PaperTextureColorSource |
textureScaleanimatable |
number |
0.01 |
World units per texture pixel (tri-planar only). Default 0.01. |
PaperTextureColorSource |
blendSharpnessanimatable |
number |
4 |
Tri-planar normal-weight sharpness, [1, 16]. Default 4. |
PaperTextureColorSource |
| Property | Type | Default | Description | Declared by |
|---|---|---|---|---|
baseMottleread-only |
number |
— | — | PaperTextureColorSource |
baseMottleScaleread-only |
number |
— | — | PaperTextureColorSource |
baseToothread-only |
number |
— | — | PaperTextureColorSource |
baseToothScaleread-only |
number |
— | — | PaperTextureColorSource |
baseFineread-only |
number |
— | — | PaperTextureColorSource |
baseSpeckread-only |
number |
— | — | PaperTextureColorSource |
baseContrastread-only |
number |
— | — | PaperTextureColorSource |
baseSeedread-only |
number |
— | — | PaperTextureColorSource |
baseTextureScaleread-only |
number |
— | — | PaperTextureColorSource |
baseBlendSharpnessread-only |
number |
— | — | PaperTextureColorSource |
fieldanimatable |
Field | null |
— | Gets the optional applicability field that masks where this source | ColorSource |
visualize |
boolean |
false |
Whether the visualization is visible (wireframe splines + center marker). | VisualizableSceneNode |
xanimatable |
number |
0 |
Gets the X position component. | SceneNode |
yanimatable |
number |
0 |
Gets the Y position component. | SceneNode |
zanimatable |
number |
0 |
Gets the Z position component. | SceneNode |
hanimatable |
number |
0 |
Gets the heading (Y-axis) rotation in radians. | SceneNode |
panimatable |
number |
0 |
Gets the pitch (X-axis) rotation in radians. | SceneNode |
banimatable |
number |
0 |
Gets the bank (Z-axis) rotation in radians. | SceneNode |
quaternionanimatable |
Quaternion |
— | Gets the rotation as a quaternion. | SceneNode |
sxanimatable |
number |
1 |
Gets the X-axis scale factor. | SceneNode |
syanimatable |
number |
1 |
Gets the Y-axis scale factor. | SceneNode |
szanimatable |
number |
1 |
Gets the Z-axis scale factor. | SceneNode |
hRad |
number |
0 |
Gets the heading (Y-axis) rotation in radians. | SceneNode |
pRad |
number |
0 |
Gets the pitch (X-axis) rotation in radians. | SceneNode |
bRad |
number |
0 |
Gets the bank (Z-axis) rotation in radians. | SceneNode |
hDeg |
number |
0 |
Gets the heading (Y-axis) rotation in degrees. | SceneNode |
pDeg |
number |
0 |
Gets the pitch (X-axis) rotation in degrees. | SceneNode |
bDeg |
number |
0 |
Gets the bank (Z-axis) rotation in degrees. | SceneNode |
xBasebase value |
number |
— | Gets the base (non-animated) value of X position. | SceneNode |
yBasebase value |
number |
— | Gets the base (non-animated) value of Y position. | SceneNode |
zBasebase value |
number |
— | Gets the base (non-animated) value of Z position. | SceneNode |
hBasebase value |
number |
0 |
Gets the base (non-animated) value of heading (Y-axis rotation). | SceneNode |
pBasebase value |
number |
0 |
Gets the base (non-animated) value of pitch (X-axis rotation). | SceneNode |
bBasebase value |
number |
0 |
Gets the base (non-animated) value of bank (Z-axis rotation). | SceneNode |
quaternionBasebase value |
Quaternion |
— | Gets the base (non-animated) quaternion rotation. | SceneNode |
sxBasebase value |
number |
— | Gets the base (non-animated) value of X-axis scale. | SceneNode |
syBasebase value |
number |
— | Gets the base (non-animated) value of Y-axis scale. | SceneNode |
szBasebase value |
number |
— | Gets the base (non-animated) value of Z-axis scale. | SceneNode |
draggable |
boolean |
false |
Gets whether this node can be dragged. | SceneNode |
parentread-only |
SceneNode | null |
— | The parent node in the scene graph, or null at the root. |
SceneNode |
sceneread-only |
any |
— | Gets the Scene this node belongs to, if any. | SceneNode |
posread-only |
Point3D |
— | Gets the world-space position of this node. | SceneNode |
matrixread-only |
Float32Array<ArrayBufferLike> |
— | Gets the computed 4x4 transformation matrix. | SceneNode |
animationsread-only |
SkenraAnimation[] |
— | Public getter for the animations affecting this target. | SkenraAnimatable |
| Method | Description | Declared by |
|---|---|---|
addMaterialPaint(material: Material, paintTarget: PaintTarget, options?: any): Paint |
Applies a material to this node for a specific paint target. | SceneNode |
getPaints(): ReadonlyMap<PaintTarget, Paint> |
— | SceneNode |
getOwnPaints(): readonly Paint[] |
Gets only the paints directly applied to this node (not inherited). | SceneNode |
removePaint(paint: Paint): void |
Removes a paint from this node. | SceneNode |
getWorldPosition(): number[] |
Returns this node’s origin in world space. | SceneNode |
getWorldMatrix(): Float32Array<ArrayBufferLike> |
Returns this node’s world transform — its local transform composed with all ancestor transforms. | SceneNode |
setViewportPosition(camera: AbstractCamera, x: number, y: number, z: number = 0.5): boolean |
Sets the node's local translation so that it appears at the specified viewport position. | SceneNode |
getViewportPosition(camera?: AbstractCamera): [number, number, number] | null |
Returns the node's current world position projected to viewport CSS pixel coordinates. | SceneNode |
setNDCPosition(camera: AbstractCamera, ndcX: number, ndcY: number, ndcZ: number = 0.5): boolean |
Sets the node's local translation so that it appears at the specified NDC position in the viewport. | SceneNode |
getBoundsInSpace(targetSpaceMatrix: Float32Array): { minX: number; maxX: number; minY: number; maxY: number; minZ: number; maxZ: number; } | null |
Computes the axis-aligned bounding box (AABB) of this node and its descendants | SceneNode |
animate(firstArg: TypedKeyframe<this>[] | TypedPropertyIndexedKeyframes<this> | Record<string, any> | globalThis.Keyframe[] | globalThis.PropertyIndexedKeyframes | null, secondArg?: number | KeyframeAnimationOptions | globalThis.KeyframeAnimationOptions): SkenraAnimation & Animation |
Creates a new SkenraAnimation for this target per Web Animations API. | SkenraAnimatable |
removeAnimation(animation: SkenraAnimation): boolean |
Removes a specific animation from this object. | SkenraAnimatable |
constrain(type: K, config: ConstraintConfigMap[K]): ConstraintReturnMap[K] |
Creates a constraint on this Animatable using a fluent API. | SkenraAnimatable |