GrasshopperDisplayMaterial

ReferencesSince v9.0
Remarks: The G2 shader produces a gradient-shaded look from a compact set of inputs rather than from the full lighting model of a DisplayMaterial: a diffuse colour, plus optional striping, stippling and dark-area desaturation. Unlike DisplayMaterial this is a plain settings object with no unmanaged resources, so it does not need to be disposed.

Constructors

GrasshopperDisplayMaterial

#Since v9.0
Constructs a default material with an opaque white diffuse colour.
public GrasshopperDisplayMaterial()

GrasshopperDisplayMaterial

#Since v9.0
Constructs a material with a specific diffuse colour.
public GrasshopperDisplayMaterial(
diffuse
The diffuse colour. Unlike DisplayMaterial, the alpha channel is not ignored — it is the opacity. See Diffuse.
)

Properties

Desaturation

#Since v9.0
Gets or sets how far the shaded colour is blended towards greyscale, as a fraction from 0 to 1: 0 leaves the colour untouched, 1 is fully greyscale, and values in between blend linearly. Default: 0.
public double Desaturation { get; set; }
Remarks: The blend is applied uniformly to the final colour of the whole surface, including flat (unshaded) vertex colours — see ShadeFalseColor. It holds luminosity constant, so the colour drains towards grey without the surface appearing to get lighter or darker.

Diffuse

#Since v9.0
Gets or sets the diffuse colour — the colour reached in the brightest areas of the shading. The alpha channel is opacity, following the usual Color convention: A=255 is fully opaque and A=0 fully transparent. Note this differs from DisplayMaterial.Diffuse, which ignores alpha. Default: opaque white.
public Color Diffuse { get; set; }

ShadeFalseColor

#Since v9.0
Gets or sets whether a mesh's vertex colours are shaded. Has no effect on a mesh that has no vertex colours. Default: false.
public bool ShadeFalseColor { get; set; }
Remarks: When a mesh carries vertex colours, those colours — its "false colours" — are always what gets drawn, in place of Diffuse. This property decides only how they are drawn: true lights and shades them like any other surface colour, while false draws them flat, with no lighting or shading applied at all. Striping, stippling and Desaturation still apply either way.

Stippling

#Since v9.0
Gets or sets whether an 8x8 Bayer stipple (dither) mask is applied. Default: false.
public bool Stippling { get; set; }

StipplingAmount

#Since v9.0
Gets or sets how much of the stipple pattern is turned off, as a fraction from 0 to 1 (used only when Stippling is true). Default: 0.
public double StipplingAmount { get; set; }
Remarks: The pattern is an 8x8 Bayer mask — 64 cells — and this is the fraction of those cells that stop drawing: 0 turns none off (nothing is stippled away), 0.5 turns off about half of them (32 of 64), and 1 is clamped to 63 of 64, so a trace of the mesh always remains rather than disappearing entirely. Values outside 0 to 1 are clamped.

StripeContrast

#Since v9.0
Gets or sets the stripe contrast (used only when Striping is true). The effective range is 0..0.9; higher values are clamped, and 0 means no visible striping. Default: 1.0.
public double StripeContrast { get; set; }

StripeWidth

#Since v9.0
Gets or sets the width of one stripe band in screen-space pixels (used only when Striping is true). Stripes run along the screen diagonal and the light/dark pattern repeats every 2 × StripeWidth pixels; values below 1 are treated as 1. This is a pixel-space overlay — it does not scale with zoom or model units. Default: 0.
public double StripeWidth { get; set; }

Striping

#Since v9.0
Gets or sets whether the G2 striping overlay is applied. Default: false.
public bool Striping { get; set; }