Click or drag to resize

DisplayPipelineDrawMeshesShaded Method

Draws a batch of meshes with the Grasshopper 2 ("G2") shaded display: a gradient-shaded look driven by a GrasshopperDisplayMaterial — a diffuse colour plus optional striping, stippling and dark-area desaturation — rather than a full DisplayMaterial. The whole batch is uploaded as one combined GPU buffer and shares one material; for per-mesh settings, call once per mesh instead.

Namespace:  Rhino.Display
Assembly:  RhinoCommon (in RhinoCommon.dll)
Since: 9.0
Syntax
public void DrawMeshesShaded(
	IEnumerable<Mesh> meshes,
	GrasshopperDisplayMaterial material
)

Parameters

meshes
Type: System.Collections.GenericIEnumerableMesh
The meshes to draw as one batch. Each should have current single-precision vertices and vertex normals (see remarks); null entries are skipped.
material
Type: Rhino.DisplayGrasshopperDisplayMaterial
The G2 shaded settings to draw with. When null, default settings are used.
Remarks

The meshes are uploaded to the GPU on every redraw. Nothing is cached between frames, so every redraw re-uploads the whole batch. This is the dominant cost of the call and needs to be planned around: draw only the geometry you actually need, and prefer one batched call over many single-mesh calls.

Mesh requirements. Every mesh must have up-to-date single-precision vertices and vertex normals. The G2 shader reads those directly; a mesh that carries only double-precision vertices, or no normals, will render badly (missing geometry or flat/garbage shading). Compute the vertex normals and make sure the single-precision vertices are current before drawing if in doubt. Null entries in meshes are skipped.

Vertex colours. If a mesh has vertex colours, those colours are drawn in place of the material's diffuse colour, and ShadeFalseColor decides whether they are shaded or drawn flat. Meshes without vertex colours are shaded from the material's diffuse colour alone.

See Also