Skip to content

Interface: SurfaceShadingOptions ​

Defined in: surface/SurfaceShading.ts:23

Fragment-level surface shading shared by CPU-composited surfaces.

  • Threshold edges: the top thresholded data layer is not baked into vertex colours. Its colour and a per-vertex visibility sign (+1 shown, -1 hidden; see writeThresholdEdgeSigns) travel as vertex attributes. Interpolated across triangles, the sign crosses zero midway between a shown and a hidden vertex, so the shader draws the threshold as a smooth contour there rather than a per-vertex staircase. The anti-aliasing ramp is one-sided: fragments on the hidden side get no colour (no faint "ghost rings" around sub-threshold patches), fragments on the shown side get at least half colour and full colour within one pixel of the contour.
  • Threshold outline: an optional darker band just inside that isoline.
  • Silhouette darkening: grazing-angle darkening that separates overlapping hemispheres and gives the cortex a solid, drawn edge.
  • Colour management: vertex and overlay colours are display (sRGB) values, as colormaps and hex colours are written; the patch decodes them to linear per vertex so lighting happens in linear light and the renderer's sRGB output encoding is applied exactly once.

Properties ​

thresholdEdges? ​

ts
optional thresholdEdges?: boolean;

Defined in: surface/SurfaceShading.ts:25

Draw thresholded data layers with per-fragment isolines. Default true.


thresholdOutline? ​

ts
optional thresholdOutline?: number;

Defined in: surface/SurfaceShading.ts:27

Outline band width in screen-space derivative units (0 disables). Default 0.


thresholdOutlineShade? ​

ts
optional thresholdOutlineShade?: number;

Defined in: surface/SurfaceShading.ts:29

Colour multiplier inside the outline band (0 black, 1 invisible). Default 0.55.


silhouetteDarkening? ​

ts
optional silhouetteDarkening?: number;

Defined in: surface/SurfaceShading.ts:31

Darkening at grazing angles (0 none, 1 black silhouette). Default 0.


overlayEmission? ​

ts
optional overlayEmission?: number;

Defined in: surface/SurfaceShading.ts:37

Share of the overlay colour emitted rather than lit (0-1). Full diffuse shading muddies bright colormap ends (yellow reads olive on shadowed slopes); a partial emissive term keeps overlay hues true. Default 0.

Released under the MIT License.