450 likes | 653 Views
Our Goal. Texture mapping seamless hardware supported low distortion general object. Texture Atlas (multi-chart approach to parameterization). disk-like patches. texture charts. v. +. =. u. 3D mesh. 2D texture image. textured bunny.
E N D
Our Goal • Texture mapping • seamless • hardware supported • low distortion • general object
Texture Atlas(multi-chart approach to parameterization) disk-like patches texture charts v + = u 3D mesh 2D texture image textured bunny images courtesy of Lévy, Sylvain, Ray and Maillot , SIGGRAPH 02
Cube-Maps • Typically used for environment mapping mesh environment texture images from Bubble demonstration program, nVidia
w u v Abusing Cube-Maps • What if we store surface color in a cube-map? object space texture space object space + = mesh with per-vertex 3D texture coord. (u,v,w) cube-map textured apple
texture from chart B texture from chart A • texture atlas • seams • a triangle cannot span multiple charts • mesh dependency • mipmapping difficult • chart packing: wasted texels • artifacts at boundaries • no defined neighbors for boundary texels • cube-map • seamless • a triangle can span multiple faces • mesh independent • mipmapping ok • no packing: no wasted texels • no boundaries, no artifacts • texel neighbors always defined
texture from chart B texture from chart A • texture atlas • seams • a triangle cannot span multiple charts • mesh dependency • mipmapping difficult • chart packing: wasted texels • artifacts at boundaries • no defined neighbors for boundary texels • cube-map • seamless • a triangle can span multiple faces • mesh independent • mipmapping ok • no packing: no wasted texels • no boundaries, no artifacts • texel neighbors always defined
texture atlas • seams • a triangle cannot span multiple charts • mesh dependency • mipmapping difficult • chart packing: wasted texels • artifacts at boundaries • no defined neighbors for boundary texels • cube-map • seamless • a triangle can span multiple faces • mesh independent • mipmapping ok • no packing: no wasted texels • no boundaries, no artifacts • texel neighbors always defined
texture atlas • seams • a triangle cannot span multiple charts • mesh dependency • mipmapping difficult • chart packing: wasted texels • artifacts at boundaries • no defined neighbors for boundary texels • cube-map • seamless • a triangle can span multiple faces • mesh independent • mipmapping ok • no packing: no wasted texels • no boundaries, no artifacts • texel neighbors always defined
texture atlas • seams • a triangle cannot span multiple charts • mesh dependency • mipmapping difficult • chart packing: wasted texels • artifacts at boundaries • no defined neighbors for boundary texels • cube-map • seamless • a triangle can span multiple faces • mesh independent • mipmapping ok • no packing: no wasted texels • no boundaries, no artifacts • texel neighbors always defined
texture atlas • seams • a triangle cannot span multiple charts • mesh dependency • mipmapping difficult • chart packing: wasted texels • artifacts at boundaries • no defined neighbors for boundary texels • works (is general) • cube-map • seamless • a triangle can span multiple faces • mesh independent • mipmapping ok • no packing: no wasted texels • no boundaries, no artifacts • texel neighbors always defined • does not (~spheres only!)
What we Keep from CubeMaps … from rasterizer interpolated coordinates in 3D texture space • Per-fragment • Hardware implemented • Texture defined in 3D BUTstored in 2D projection coordinates in 3D texture domain (a 2-manifold similar to the mesh) FRAGMENT SHADER mapping coordinates in 2D texture domain 2D texture fetch…
Going Beyond Apples • Cube-Maps work well only for sphere-like objects world space texture space sphere-like mesh cubic texture domain
Going Beyond Apples • But for more general objects? world space ? texture space arbitrary meshes cubic texture domain
...huge distortions, incompatible topology Going Beyond Apples • But for more general objects? world space ? texture space arbitrary meshes cubic texture domain [Praun Hoppe SIGGGRAPH 2003]
far too complex (GPU) Going Beyond Apples • But for more general objects? world space texture space arbitrary mesh coarse mesh
Space & Domain • R3-Object space • T3-3D texture space R3 T3 T3 T2 • T3-3D texture domain • T2-2D texture domain
surface of a polycube as 3D texture domain T3 Introducing Polycubes Po·ly·cube: n. (Geom.) A solid composed by multiple unit cubes attached face to face
Choosing a Polycube • Polycube should roughly resemble the mesh world space texture space mesh polycube
Process • Assign each vertex v of the mesha unique 3D texture position • At rendering time • Vertices, 3D texture positions → Graphics pipeline → Rasterizer(interpolates 3D texture position fI3 for every produced fragmentf) → Pass fI3 into fragment shader vT3= (vr, vs, vt) ∈T3
T3 T2 Process R3 • Problem: Even if all 3D texture positions vT3line on T3 , this is not necessarily the case for the interpolated 3D texture position fI3 • Fragment shader • Projection P: T3 → T3 • Mapping M: T3 → T2 T3
Projection & Mapping 3D texture domainT3 texture stored in 1D values defined in a 2D space • 2D analogue 3D texture space T3 Most important feature of PolyCube-Maps:Continuously → seamless texture mapping(texture information itself is stored as a collection of square images)
How PolyCube-Maps Work? • Dual partition – cubic cells • Cell configurations -- facelets • The projection P • The mapping M
cell case A case B dual grid Partition of Texture Space • 2D analogue polycube
facelet texture patch squarelet S Partition of the Parameter SpaceCell Configurations and The Projection P • back to 3D case 3 case 4-a case 4-b case 5 case 6-a case 6-b
The Mapping M • The upper left corner can be stored as a global 2D offset for each particular cell • Local offsets don’t need to be stored • A point p∈T3 inside a cell (3 steps) • relative position of p inside the containing facelet is determined → multiplied with S to give the relative position in the corresponding squarelet • offset the result according to the fixed packing of the squarelets inside the texture patch • global offset of that patch in T2 is added
A Simple PolyCube-Map example Subdivide into 8 cells of type 3 Each cell contains three facelets thatsotred as a set of three texture squarelets
partition of theparameter space • back to 3D dual cells case 4-a case 5 case 4-b case 3
partition of theparameter space dual cells case 4-a case 5 case 4-b case 3
3D Look-up Table • Store cell-structure of T3 in 3D look-up tableT3LUT(define each cell through a set of parameters in the corresponding entry of T3LUT) • Processing a fragment f (fragment shader) • determine the cell that contains the fI3 • access to T3LUT at the corresponding entry returns all the parameters needed to compute P and M (use to find the final 2D texture position fT2 ∈T2 )
3D Look-up Table – Parameter • Each entry of T3LUT is packed in one (r, g, b)-texel • An entry e is composed of 3 parts • e.C – cell configurations (index) • e.R – axis-to-axis rotation (index) • e.O – global offset of the patch (in T2) • T3LUT is always smaller than on Kilo texel • T2 can be several Mega texels • Construction of the look-up table !!
not necessarily on the polycube surface: project texture space (3D!) stored in texture RAM as: a fragment with interpolated texture coord final texel value for the fragment w map to 2D v u a packed texture image plus a tiny structure to store polycube layout the polycube polycube-maps in a nutshell object space the mesh (with per-vertex text. coord)
Examples of poly-cubic parameterizations in texture RAM object polycube-map w u v world space texture space
Examples of poly-cubic parameterizations object polycube-map w v u world space texture space
Examples of poly-cubic parameterizations object polycube-map w u v world space texture space
Examples of poly-cubic parameterizations object polycube-map w v u world space texture space
An example application: same texture for different LOD w + = Geometry 3 u v + = Geometry 2 • the same polycube-map • texture + = Geometry 1
T3 warp project optimize warp-1 How to build aPolycube-Map(for a given mesh) • Not automatic, to this point • get a suitable polycube • warp it aroundthe mesh • project mesh over it • unwarp • global optimization M
MIPS ext. MIPS mean value Global optimization projection (not optimized)
Most Isometric ParametrizationS θ = 0.3 θ = 1.0 θ = 3.0 the horse head model parameterized using different angle/area preservation tradeoffs
Experimental Results Frame Rate 30 fps (mip-mapping) 10 fps (mip-mapping + bilinear interpolation) nVIDIA GeForce FX 5600 ATI Radeon 9800 ProoPentium 4 2.4 Ghz
Pros truly seamless texture mapping no patch boundaries no color bleeding very low distortion nearly optimal texture packing bilinear filtering possible mipmapping possible mesh independency Cons long fragment program ~60 GPU instruction long could be improved, with little branching support 3 t-coords per vertex instead of 2 Limits cannot handle arbitrary shape/topology complexity e.g. a tree Discussion
Thank you! Questions? http://vcg.isti.cnr.it/~polycubemaps/or, just Google for “polycube-map” Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani Visual Computing Lab · ISTI · CNR · Pisa, Italy
w v u Q: Aren’t cubemaps just another atlas? • A: true, but such chart borders are: • transparent for triangles • invisible for mipmapping... • hidden from the user texture charts? chart boundaries?
Q: isn’t it a lot of work to build a polycube map? • Polycube-maps • Get a fitting polycube • Warp it around mesh • Project mesh over it • Unwarp back • Global optimization • Atlases • Find a good division into disk-like patches • Pack charts togheter • Global optimization
Q: isn’t it a lot of work to build a polycube map? • Polycube-maps • New. Not studied at all. • Future work: design tools to make task a lot easier (but still user guided) • In any case, final result will be clean (seamless...) • Atlases • Very much studied problem • Automatic results inferior w.r.t. manual results • In any case, final parameterization bound to have drawbacks (seams...)