Effectiveness of Ptex Method in the Field of Texture Mapping and Polygon Topology
Total Page:16
File Type:pdf, Size:1020Kb
Effectiveness of Ptex method in the field of Texture Mapping and Polygon Topology Andrija Bernik Damir Vusić Robert Geček Department of Multimedia Department of Multimedia Department of Multimedia University North University North University North Varaždin, Croatia, Europe Varaždin, Croatia, Europe Varaždin, Croatia, Europe [email protected] [email protected] [email protected] Abstract — This paper presents several texturing problems that computer resources and mapping automation.[2] The last of occur in complex polygon topology where the model is based on these properties does not agree with Kim et al[9] as far as the tris and ngons. It also shows an experiment and describes the storage efficiency of textures goes. They stated that the Ptex application of the Ptex system for mapping textures onto a 3D Method uses a wasteful packing strategy that increases the model. The topology parameterization using 3D Coat and its storage cost of the textures many times over their original auto-retopology tools are shown as well. A new topology model was tested using a texture checker inside Mudbox and VRay. size. Nevertheless, we have created a 3D model where Additionally, a comparison was made between Mantra and classical UV mapping isn’t efficient and introduced a Ptex VRay rendering systems, where specific difficulties had workflow with rendering specs. occurred when applying Ptex mapping. The aim of this experiment is to present how cache memory directly interferes II. DESIGN AND PARAMETERIZATION OF with texture filtering and rendering speeds. This paper MODEL TOPOLOGY concludes with the advantages and disadvantages observed in relevant literature and through an empirical approach to this A complex model was selected for the elaboration of the technology. textures in order to test the practical flexibility of Ptex (Fig. Keywords — per-face-texturing, ngons, retopology, VRay and 1) and show possible problems that are common in the field Catmullrom filter of CG texturing. This is a part of the replica model of the Koruna Fortress (Fig. 2) which was modelled and analyzed I. INTRODUCTION entirely from scratch by Mario Kotlar (Croteam’s 3D and level artist). Even today’s state-of-the-art graphics hardware, in terms of hardware texture filtering, suffers from several aliasing artifacts that are visible in extreme conditions, such as grazing viewing angles, highly warped texture coordinates, or extreme perspectives.[1] This is one of the reasons that Ptex was initially introduced in 2008.[2] Ptex is an open source product written in C ++ which can easily store a large number of textures in a single file. This texture process is intended for industry branches that require extremely high- resolution (8k+) textures in projects. It converts traditional UV space to a specialized texel system.[3] As a result, only one Ptex file is required per channel per model, since Ptex Fig. 1. Displaying a polygon color quality inside the Meshlab program files have resolution independence across all faces.[4] The result of the above is a texturing system that doesn’t use UV In Fig. 1, the red polygons are those with the lowest maps for texturing or painting a 3D object.[5, 6] Ptex assigns quality, that is, polygons of the greatest elongation. When a separate texture per face, thus skipping the texture unwrap designing the model for 3D printing, it is important to achieve entirely. It must be kept in mind that textures must be power- the optimal number of polygons because this model is not of-two sized (though not necessarily square) and patch intended for sub-divisions but for printing on a 3D printer, so adjacency data must be provided.[6] It uses adjacency in this case it is important that it is non-manifold pointers to access neighboring tiles since it doesn’t pre-filter (waterproof). tile data. These pointers must be dereferenced when filtering on tile boundaries.[7] It is also worth mentioning that the Ptex system is designed for quad-based sub-division surfaces that do not require explicit parameterization.[8] The per-face textures of Ptex are aligned with the shading grids, which always results in horizontal or vertical directions of anisotropy.[1] It ensures four main properties, which are in turn are: photo-realistic quality, generality in terms of geometric model regardless of topology, efficiency in Fig. 2. Photographs of the Koruna fortress (Mali Ston, Dubrovnik, Croatia) 978-1-7281-2544-2/19/$31.00 ©2019 European Union 1 Fig. 3. Texture Checker on the left is shown in Mudbox and on the right in 3D Coat This led to a topology that was expected to be problematic for Ptex. Problems have been shown to be higher than expected. Significant distortions of texture appeared in Mudbox and in 3D Coat as well (Fig. 3). A possible solution to this problem suggested converting elongated trunks into ngons. The result was a complex ngon system. It is known Fig. 5. Examination of poor topology drawing abilities that ngons are quite problematic to work with. Additionally, Mudbox probably does not process them in the correct Fig. 5 shows four divisions that, in turn, represent the manner described in the Ptex standard, as can be seen from following: the distortion form. If Mudbox uses sub-faces in the way it a) A common high resolution. It is noticeable that should, they should look different in the Ptex set-up stage. distortions are still present, However, Mudbox does not process ngons in the way it b) An extremely high resolution of 52 million texels should (via sub-folders), it seems that it divides them into the (roughly a resolution of 7,400 × 7,400 pixel in means of tris system. This could be related to the fact that Mudbox still traditional texture) is localized to 4.4% of the model’s surface uses UV folders to display Ptex in the viewport, which can area, as calculated using Blender, which means that this be concluded from the way in which the polygons containing resolution would require 1.17 billion texels for the whole the minimum level of texels (they have seams) are displayed, model (similar to a traditional texture of 42,000 × 42,000 rather than from the fact that it creates temporary .tif files pixels). However, in practice with Ptex, the amount of while working which otherwise should not be needed. Also, required texels would be less than that, because the texture the fact remains that, during the opening of the .mud model resolution would be localized only in places on the model with Ptex texture, Baking UVs are written in the status line, where it is required. In spite of this, this resolution is still far which is an action that should not normally be needed unless too high for our testing (a mid-end, dual core) machine to UV maps are used.[10] work effectively, c) At extremely high resolution, the texture looks bright, even at considerable magnification, and d) When magnified, it can be seen that the topology still causes a disproportionate distribution of resolution and the occurrence of distortion in certain parts of the model. Fig. 4. Mapping under different projecting angles. From left to right: Maya, From this experiment (Fig. 5), the conclusion is that a Mudbox (frontal projection) and Mudbox (projection at an angle) model with such topology is impossible or almost impossible Another 3D object topology test was to test the results of to texture with the Ptex method using the tools available. It tris, quads and ngons of different shapes. It turned out to be would be far simpler and more optimal to texture this model an important factor in projecting the texture while looking at using traditional UV mapping. The only solution left in this the polygon as straight as possible, i.e. at the correct (90°) case is to repair the model topology (Fig. 6) so that it can be angle (Fig. 4). It can be concluded that the optimal drawing textured by the Ptex method. To avoid manually repairing the of textures in Mudbox is possible only if the model has a model’s topology, which takes a lot of time, automated relatively good topology (that the polygons are as short as methods were investigated. they are elongated) or, if the topology is poor, at a high After many unsuccessful attempts to reparameter the resolution in textile textures is projected at the correct (90°) topology using Meshlab, success was achieved using 3D angle. The next thing to examine is the efficient use of high Coat and its Auto-Retopology tool.[11] The model with the resolution in texels and projection at the correct (90°) angle new topology was opened using Blender and, once a sub- to achieve satisfactory results (Fig. 4). division was made to increase the polygon density, the shrinkwrap modifier was used in order to reposition all the points of the new model in relation to the closest matching points on the surface of the original model. This further sharpened the new model and made it even more similar to the original model.[12] 2 Fig. 6. Comparison of old and new polygon topologies The number of polygons in the process increased from 6,899 to 148,216, which is 21 times more. The number of polygons in this case is not so important, because it will not significantly increase the time required to plot. By comparing the old and new topology, seen in Fig. 6, one can notice the following: • Fig.s a) and b) represent the model before and after the change of topology. There is a visible level of change in Fig. 7. Distribution of the texel’s resolution level at a) minimum resolution x1, b) x4, c) x8 and d) x16 shape between the two models, which in this case is not only insignificant, but is already in its favor, because it is natural III.