Documentation / Node reference / mat nodes

mat/MeshNormal

Colours a mesh by its surface normal.

Mesh

Each fragment takes the world-space normal at that point and uses its absolute value as red, green and blue. A face pointing along X reads red, along Y green, along Z blue, and anything between reads as a mix. The sign is dropped, so a face and the face opposite it come out the same colour. Nothing here reacts to light and there is no colour to set: this is a material for looking at your normals, to check they point the way you expect after a deform, an extrude, a merge or an import.

Parameters

Name Type What it does
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.

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.