Ptex

Ptex (Per-face Texturing) is a texture mapping system developed by Walt Disney Animation Studios as an alternative to traditional methods of texture mapping. Ptex addresses various issues associated with traditional texture mapping by eliminating the need for artists to manually create UV maps.

With Ptex, each face of a geometry has its own unique texture. This allows for the possibility of dynamically changing the resolution of textures on individual groups of faces.

Ptex files contain the per-face texture and face/edge adjacency data along with the geometry metadata, which can be useful for previewing textures and checking whether they are valid for a given geometry.

Video:  Have a quick look at the Working with Ptex Projects video to learn how to create and work with Ptex projects in Mari.
This video shows the workflow using Mari 3. Even though the Mari 4 workspace is different, the workflow remains the same. To have a look at the main UI differences, see Mari 3.3 vs 4.0.

Ptex Support

UV patches are 2D textures mapped onto regions of 3D geometry according to UV maps created by the artist. In addition to working with traditional UV maps, Mari also supports Ptex. With Ptex, UV patches are no longer a valid concept since there are no explicit UVs associated with the model. As a result, UV patches have been replaced with a UV atlas of Ptex faces.

When a new Mari project loads a UV-less .obj file, or a .ptx (Ptex) file containing geometry, every face of the geometry has a texture assigned to it, and in turn, every texture is assigned to an unused region of a UV atlas.

The packing of these face textures occurs in order of descending size, and because of this, adjacent faces with differing texture resolutions may not be spatially coherent in the UV atlas. Therefore, painting in the UV view does not make logical sense.

Currently, Ptex support in Mari includes:

starting a new project with either a UV-less .obj, or a .ptx file (containing geometry metadata)

optionally assigning each surface defined in the .obj file its own Ptex layout

polygons of arbitrary size and shape in .obj files

specifying uniform, or worldspace texel density texture resolutions of faces

painting onto Ptex geometry in 3D views

resizing selected Ptex face textures from 1x1 (2x2 for triangles) all the way up to 8192x8192

creating new channels that share Ptex face texture resolutions

exporting a channel to a .ptx file, with the option to include geometry metadata and face/edge adjacency
information

importing .ptx files into channels that are topologically equivalent

preserving paint in multiple Ptex geometries, when creating new geometry versions from .obj files, provided they are topologically equivalent

Python bindings for Ptex project creation, per face operations, and import/export functionality. Refer to the Python HTML documentation within Python > API for further information

allowing face texture resizing and data format conversion on import.

Limitations of Mari’s GPU Previews with Ptex

Mari’s implementation of Ptex face texture storage is targeted at the flexibility of face resizing and the rendering preview performance of the GPU. Unlike UV maps, the locality of faces in 3D space is not necessarily maintained in the Ptex texture storage. As a result of this implementation, when GPU operations require sampling across faces and adjacent faces reside in texture memory, preview artifacts may be observed.

For example, shaders that use a relatively large sample kernel may encounter some preview rendering artifacts when unexpected face textures are sampled.

Artifacts may also be observed when navigating a scene due to the blending of face textures in generated mip-mapped textures that are used to improve GPU performance. This may be more apparent when lots of small face textures are used.

Note:  These artifacts only affect GPU accelerated previews, and do not appear in exported texture data files.