DisplayPipelineDrawMeshesShaded Method |
Namespace: Rhino.Display
public void DrawMeshesShaded( IEnumerable<Mesh> meshes, GrasshopperDisplayMaterial material )
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.