
Projective texture mapping provides a quick and dirty way to use images as 3D textures by projecting them onto 3D scenes and objects as if by a slide projector. It is important to have an offline, software-based, general purpose algorithm that’s efficient enough to run on the CPU, portable and pluggable into a variety of applications. We present an offline algorithm that rasterizes a texture map directly for saving and retrieval to support applications that use UV mapped texture maps. Processing time is reduced with pixel bucketing. Pixel buckets is a data structure that reduces ray intersection calculations. A scan line algorithm is applied per polygon for each polygon in the texture map by projecting them onto the camera’s view projection window. The end result is a portable offline CPU bound algorithm for projective texture mapping.
Projective texture mapping is found in graphics packages such as OpenGL , WebGL, DirectX and Metal. In contrast to 2D/3D digital painting applications where high levels of skill are employed, image projections can be applied quickly for rapid prototyping and are suitable for automated geometric processing.
In traditional graphics packages, projective texture mapping is done as part of the graphics pipeline and renders displays in realtime. However, an application that creates texture maps directly without necessarily displaying it can be done offline without needing to lever- age a GPU-backed rendering pipeline. This is useful, for example, for automated procedures that rasterize texture maps and save them for later use.
Offline projective mapping can be broken down into two phases. The first phase is to generate a mapping from the camera’s projection window pixels to a list of polygon faces, a.k.a. pixel bucketing. In the second phase, the texture map is rasterized and saved to disk. We assume that the parameterization and UV mapping of the 3D object have already been done. In the pixel bucketing phase, a data structure is created that stores for each projection window pixel a list of faces that are intersected when a ray is cast from the camera through that pixel. In the projection phase, the faces are iterated over. A scan line algorithm traverses each face’s pixels in the texture map and a check is made against the other faces in the relevant pixel bucket. If the texture map pixel is visible, it is painted with colors from the texture.