Documentation / Node reference / mat nodes

mat/MeshBasic

A simple, unlit-style mesh material with a flat colour.

Mesh

Assigns a solid colour to a mesh. Create it inside a geo/MaterialNetwork, then point a geo/Material node at it (by path) to shade objects. Use the group on geo/Material to give different objects different materials.

Parameters

Name Type What it does
color Color4 The flat colour every fragment is shaded with. The alpha channel decides transparency while transparencyMode is AUTO: below 1 the material moves to the transparent pass.
useVertexColor Float How much of the geometry's own Cd point attribute is multiplied into the colour above. 0 leaves the colour alone, 1 multiplies the attribute in fully, and values between fade the attribute toward white, which is the multiply's identity. Geometry carrying no Cd is unaffected: a missing attribute is read as white.
transparencyMode UInt8 AUTO · OPAQUE · MASK · BLEND Whether this material is drawn in the opaque pass or through order-independent transparency. AUTO decides from the material itself, which for most materials means its colour alpha below 1. OPAQUE always draws in the opaque pass and ignores alpha entirely, which is what you want for a material whose alpha is incidental. MASK draws in the opaque pass but throws away fragments below alphaCutoff, which is what hard-edged cutouts want: they still write depth, so they occlude each other correctly. BLEND always goes through transparency, which is the only way to get soft texture alpha to show, since nothing on the CPU side can inspect the texels.
alphaCutoff Float In MASK mode, the alpha below which a fragment is thrown away entirely. It applies to the shadow the object casts as well as to the object, so a cutout leaf casts a leaf-shaped shadow rather than a rectangle. Only used when transparencyMode is MASK.
sides UInt8 FRONT · BACK · BOTH Which side of each triangle is drawn. FRONT draws the outward-facing side only, which is what a closed mesh wants: its inner surface is hidden anyway, so drawing it is wasted work. BACK draws the inward-facing side, for a surface seen from the inside such as a skydome or a box the camera sits in. BOTH draws either side, which is what an open single surface needs: a cutout leaf, a sheet of cloth, or a plane the camera can walk around, all of which disappear from one side under FRONT. The shadow pass follows BOTH so an open surface still casts a shadow whichever way it faces the light, and draws FRONT otherwise.

Examples

Scenes you can open in the editor that teach this node.

One box, copied three times, each copy a different colour. It shows how a material node picks which objects it applies to, using the object index as its group, and how it points at a material by relative path.

mat/MeshBasic geo/Material

Materials Getting started

This example creates a series of objects in a line. If you observe them from either ends of the line, you will see the objects behind the first one are tinted by the ones before them. Their materials' alpha is what makes them see-through. The last one also goes through a geo/ObjectProperties, which sets a transparency mode on that object alone. It is left on AUTO, so the material still decides and the sphere renders like the others. Set it to OPAQUE and that one sphere draws solid, with no change to its material.

geo/ObjectProperties mat/MeshBasic

Rendering Materials

This page is generated from the engine, so it describes the release you can download. The same text is in the editor's Help panel next to the node itself.