Documentation / Node reference / mat nodes

mat/MeshBasicDepthTexture

Draws a DEPTH texture onto a mesh, as greyscale.

Mesh

Points at a TEX node holding a depth texture, such as a shadow map, and shows it on the surface. A depth texture cannot be read like an ordinary one: it is sampled through a comparison sampler, and what lands on screen is the result of that comparison in grey rather than the raw distance. This is a material for inspecting a depth pass while you build it, not for shading a finished scene. Use mat/MeshBasicTexture for an ordinary colour texture.

Parameters

Name Type What it does
color Color4 The opacity dial for the whole material. Only the alpha channel is used, as the blend opacity once the material is drawn in the transparent pass, which lets you fade the depth view over the scene behind it. The red, green and blue channels do nothing, since the depth sample alone decides the grey.
path NodePath The TEX node holding the depth texture to display. It is required: with nothing to sample, the node errors rather than drawing.
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.
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.