{"id":183,"date":"2020-09-16T16:43:42","date_gmt":"2020-09-16T16:43:42","guid":{"rendered":"http:\/\/lilvic.com\/me\/?p=183"},"modified":"2020-09-16T17:00:43","modified_gmt":"2020-09-16T17:00:43","slug":"offline-projective-texture-mapping","status":"publish","type":"post","link":"http:\/\/lilvic.com\/me\/offline-projective-texture-mapping\/","title":{"rendered":"OFFLINE PROJECTIVE TEXTURE MAPPING"},"content":{"rendered":"<div class=\"page\" title=\"Page 88\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p><img loading=\"lazy\" class=\"alignnone size-full wp-image-172\" src=\"http:\/\/lilvic.com\/me\/wp-content\/uploads\/2020\/09\/125.png\" alt=\"\" width=\"1920\" height=\"1080\"><\/p>\n<p>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\u2019s 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\u2019s view projection window. The end result is a portable offline CPU bound algorithm for projective texture mapping.<\/p>\n<p>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.<\/p>\n<p>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.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"page\" title=\"Page 89\">\n<div class=\"layoutArea\">\n<div class=\"column\">\n<p>Offline projective mapping can be broken down into two phases. The first phase is to generate a mapping from the camera\u2019s 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\u2019s 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.<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>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\u2019s efficient enough to run on the CPU, portable and pluggable into a variety of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[30],"tags":[],"_links":{"self":[{"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/posts\/183"}],"collection":[{"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/comments?post=183"}],"version-history":[{"count":2,"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/posts\/183\/revisions"}],"predecessor-version":[{"id":187,"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/posts\/183\/revisions\/187"}],"wp:attachment":[{"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/media?parent=183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/categories?post=183"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/lilvic.com\/me\/wp-json\/wp\/v2\/tags?post=183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}