Skip to content

Building a scene

What the Pathtracer renders

The Pathtracer renders the geometry named in its Geometry parameter and lights it with the lights named in Lights, both looked up in the network it sits in. The default * takes everything beside it; a pattern such as floor* table takes only those. Geometry is PT GEOs, PT T3Ds (see Smoke, fire and surfaces), and also TouchDesigner's own Geometry COMPs, glTF In and FBX COMPs and POPs (see TouchDesigner's geometry); lights are PT LIGHTs and TouchDesigner's Light COMPs (see TouchDesigner's lights).

A PT GEO whose Render flag is off is left out. That makes it easy to switch objects on and off without rewiring.

The camera is the Camera COMP in Camera, cam1 by default. When it names no camera, the Pathtracer uses the first Camera COMP beside it, and without one, a default view from 5 units back along Z.

Placing geometry with PT GEO

Wire any POP into a PT GEO, or name one in its Geometry parameter; with neither, the PT GEO shows a torus, as a Geometry COMP does. The PT GEO places it in the scene with its Xform page, exactly like a Geometry COMP: translate, rotate and scale it, parent it to another object, or make it look at something. Its Material parameter picks the PT MAT to render it with.

Use one PT GEO per object that moves on its own, or that needs a material of its own. To render many copies of something, build them in POPs first (for example with a Copy POP) and wire the result into one PT GEO.

Points and lines

A PT GEO renders every kind of POP primitive:

  • Triangles and quads as surfaces.
  • Point primitives as spheres, with the material's Point Radius.
  • Lines as round tubes, with the material's Line Width.

A PointScale attribute sets the size point by point: the radius of each sphere, and the radius of a tube at each point along a line. A tube and a sphere with the same PointScale meet flush, so lines and points can be joined into one smooth shape, such as a branching tree or a molecule.

glTF models

A PT GEO renders a glTF file as it is. Load the file into a glTF In COMP and drop that COMP on the PT GEO's Geometry parameter. Every mesh renders where the file places it, with its own material: there is nothing to convert, and nothing to press when the file changes.

  • Move, rotate or scale the glTF In COMP or any object inside it, and the model follows. The PT GEO's Xform page moves the whole model on top of that.
  • Turn off the Render flag of a mesh inside the glTF In COMP to leave it out.
  • Name a PT MAT in the PT GEO's Material to render the whole model with that material instead.

From each glTF material the Pathtracer reads the base colour, metallic, roughness, emission and normal map with their textures, the alpha (Blend as Opacity, Mask as a Cutout), and transmission, IOR, volume absorption, clear coat, sheen, iridescence (as Thin Film) and dispersion. It does not read texture transforms, specular or anisotropy, or textures the glTF In COMP does not import. A transmissive material without a volume renders as solid glass.

Edit the PBR MATs inside the glTF In COMP and the render follows. Their Alpha Front and Alpha Map multiply the file's alpha, so Alpha Front 0 hides a mesh, and their Alpha Test, which holds a Mask material's cutoff, sets the Cutout. The base colour texture's alpha counts only where the file's alpha mode is Blend or Mask.

FBX models

An FBX file renders the same way. Load it into an FBX COMP and drop that COMP on the PT GEO's Geometry. Moving the COMP or the objects inside it, the Render flags and Material work as for a glTF model, and an animated or skinned model renders as it moves. Lights and cameras in the file are left out: light the scene with PT LIGHTs and look through the Pathtracer's camera.

FBX materials arrive as Phong MATs, which the Pathtracer translates:

  • Diffuse and its Diffuse Map give the base colour. Without a Diffuse Map, the Color Map does.
  • Shininess gives the roughness: the higher it is, the glossier the surface. A black Specular makes the surface fully rough.
  • Emit and the Emit Map give the emission.
  • Alpha Front and the Alpha Map give the Opacity, together with the Color Map's alpha when the Color Map gives the colour. Blending need not be on.
  • An Alpha Test that keeps alpha greater than its threshold gives a Cutout at that threshold.
  • The Normal Map (Bump) gives the surface detail, as strong as Bump Scale says.

Every FBX material renders as a non-metal that lets no light through: for metal or glass, name a PT MAT in Material. Ambient, Constant, the Rim page and Multi-Texturing are not read. A Color attribute on a mesh multiplies its colour, as on any PT GEO, whether or not the Phong MAT's Apply Point Color is on.

In a glTF or an FBX model, a mesh whose MAT is neither a PBR nor a Phong MAT (a Constant MAT, say) renders with the Pathtracer's default material.

TouchDesigner's geometry

The Pathtracer also renders what a Render TOP would, without a PT GEO. A network built for a Render TOP renders as it is.

  • Geometry COMPs, glTF In COMPs and FBX COMPs beside the Pathtracer render with the Geometry COMPs inside them: those whose Render flag and Render parameter are on, each showing the POP that has the Render flag.
  • POPs beside the Pathtracer render while their Render flag is on, where they are, as a Render TOP draws a POP outside a Geometry COMP.
  • A PBR or Phong MAT on a Geometry COMP becomes its material, read as for glTF and FBX models. Any other MAT, a POP outside a Geometry COMP, or none gives the Pathtracer's default material.
  • A PBR MAT's alpha works as a Phong MAT's: Alpha Front, the Alpha Map and the alpha of the Base Color Map give the Opacity, without Blending, and an Alpha Test gives a Cutout.
  • Instancing and SOPs are not rendered. For those, and for everything a PT MAT can do, use a PT GEO.

What a PT GEO already renders is left to it, so nothing renders twice: a glTF In or FBX COMP or a POP named in a PT GEO's Geometry, a POP wired into a PT GEO, and a Mesh light's Mesh render once, with that PT GEO's Material and transform.

Attributes

The Pathtracer reads these attributes when the geometry has them, on its points or vertices:

Attribute Used for
N Normals: smooth shading of curved surfaces.
Tex Texture coordinates, for the material's maps.
Color Multiplies the material's Base Color: point colours from a simulation, or a different colour for each copy.
Roughness, Metallic, Transmission, Emit Replace the material's values.
PointScale The radius of spheres and tubes (see above).

Moving objects

Anything can move: PT GEOs, animated POPs, lights, the camera. The Pathtracer notices changes on its own. With the DLSS method the image follows the movement; with Accumulate each change starts the image over (see Denoising).

Geometry that is rebuilt every frame, such as a surface meshed from a fluid, has no points that stay the same from one frame to the next, so DLSS can't tell how it moved and smears it. Give its points a velocity attribute, in units per second, and name it in the PT GEO's Velocity (PartVel by default).

Heavy scenes that don't change

Lock Input freezes the scene as it is. Changes to the geometry and to the PT T3Ds' textures no longer reach the render until you turn it off again. Saving the project takes the scene as it is then and starts the image over.