

Most common image formats are accepted (anything stb_image can read). If other image formats are given, the input is assumed to be non-linear and will be inverse-tonemapped with intensity=1 and gamma=2.2 before use. hdr images for best results, but any image will work.

For blendable matcaps, if the single filename mat.hdr is given, Polyscope will try to load mat_r.hdr, mat_g.hdr, etc. Loading can be performed with the UI from -> ->, or programatically using the function below. Polyscope supports the following built-in materials: NameĬustom matcaps can be loaded at runtime from image files and used anywhere materials are used.

Ordinary static matcaps consisting of a single image can still be used as materials, but will ignore any color maps or other options. Materials which which support this blending are denoted by (rgb) in the options menu.

Crucially, Polyscope uses a linear lighting workflow and performs this blending on linear matcaps before tone-mapping, which is necessary for the results to look reasonable across the full color space. Intuitively, this strategy presumes the underlying material has a light response which is a linear function of the color, plus another component which is independent of the color. OutputColor = r * basis_r + g * basis_g + b * basis_b + (1. Instead of just using a single material image, we take four images of the material, representing basis red, green, blue, and black components.Īt runtime, to generate a color from a triple of rgb values each in the range, we sample the images like: Traditionally, matcaps don’t really support setting an albedo color like this, but we achieve the effect in Polyscope by blending between basis matcaps. This can be a constant color for the object (to distinguish structures in a scene), or a varying color across a surface (when color-mapping scalar quantities). In Polyscope, we often want to adjust set custom colors for rendered objects. Additionally, materials can generally be set in the UI from ->. Most objects in Polyscope (surface meshes, point clouds, vectors, etc) expose a setMaterial ( std :: string ) option to choose a material for the object’s appearance. Scene information like lighting is implicitly baked in to the matcap image. A matcap is a small image of a material, which is sampled by the renderer to query the materials’ appearance from a some angle. Polyscope uses matcaps to render the appearance of objects in the scene, as opposed to more traditional configurations of lights and shading models, etc.
