Presentation is loading. Please wait.

Presentation is loading. Please wait.

Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani PolyCube-Maps seamless texture mapping Visual Computing Lab · ISTI · CNR · Pisa, Italy.

Similar presentations


Presentation on theme: "Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani PolyCube-Maps seamless texture mapping Visual Computing Lab · ISTI · CNR · Pisa, Italy."— Presentation transcript:

1 Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani PolyCube-Maps seamless texture mapping Visual Computing Lab · ISTI · CNR · Pisa, Italy

2 Our Goal Texture mapping –seamless –hardware supported –low distortion –general object

3 Texture Atlas (multi-chart approach to parameterization) += 2D texture imagetextured bunny3D mesh images courtesy of Lévy, Sylvain, Ray and Maillot, SIGGRAPH 02 disk-like patches texture charts u v

4 Cube-Maps Typically used for environment mapping images from Bubble demonstration program, nVidia environment texturemesh

5 Abusing Cube-Maps What if we store surface color in a cube-map? += mesh with per-vertex 3D texture coord. (u,v,w) cube-maptextured apple u v w object spacetexture spaceobject space

6 the cube map samples... each texel is... texture coordinates are... Cube-maps used for......env. mapping...the unity sphere...a color in a direction...computed on the fly (reflected ray)...texture mapping...the object...a color of a point on the object...backed on the object

7 texture from chart A texture from chart B 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

8 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 texture from chart A texture from chart B

9 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

10 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

11 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

12 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!) 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)

13 interpolated coordinates in 3D texture space … from rasterizer What we Keep from CubeMaps FRAGMENT SHADER coordinates in 3D texture domain (a 2-manifold similar to the mesh) coordinates in 2D texture domain projection 2D texture fetch… mapping Per-fragment Hardware implemented Texture defined in 3D BUT stored in 2D

14 Going Beyond Apples Cube-Maps work well only for sphere-like objects  sphere-like meshcubic texture domain texture spaceworld space

15 ? Going Beyond Apples  But for more general objects? texture spaceworld space arbitrary meshescubic texture domain

16 ? Going Beyond Apples  But for more general objects? texture spaceworld space arbitrary meshescubic texture domain [Praun Hoppe SIGGGRAPH 2003]...huge distortions, incompatible topology

17 Going Beyond Apples But for more general objects?  texture spaceworld space arbitrary meshcoarse mesh far too complex (GPU)

18 Space & Domain R 3 -Object space T 3 - 3D texture space R3R3 T3T3 T3T3 T2T2 T 3 - 3D texture domain T 2 -2D texture domain

19 Introducing Polycubes Po·ly·cube: n. (Geom.) A solid composed by multiple unit cubes attached face to face surface of a polycube as 3D texture domain T3T3

20 meshpolycube Choosing a Polycube Polycube should roughly resemble the mesh texture spaceworld space

21 Process 1.Assign each vertex v of the mesh a unique 3D texture position 2.At rendering time Vertices, 3D texture positions → Graphics pipeline → Rasterizer (interpolates 3D texture position f I3 for every produced fragment f ) → Pass f I3 into fragment shader v T3 = (v r, v s, v t ) ∈ T 3

22 T3T3 T3T3 Process Problem: Even if all 3D texture positions v T3 line on T 3, this is not necessarily the case for the interpolated 3D texture position f I3 Fragment shader –Projection P: T 3 → T 3 –Mapping M: T 3 → T 2 R3R3 T2T2

23 Projection & Mapping 3D texture space T 3 3D texture domain T 3 Most important feature of PolyCube-Maps: Continuously → seamless texture mapping (texture information itself is stored as a collection of square images) 2D analogue texture stored in 1D values defined in a 2D space

24 How PolyCube-Maps Work? Dual partition – cubic cells Cell configurations -- facelets PThe projection P MThe mapping M

25 dual grid Partition of Texture Space polycube 2D analogue case A case B cell

26 P Partition of the Parameter Space Cell Configurations and The Projection P back to 3D case 3case 4-acase 4-bcase 5case 6-acase 6-b facelet squarelet texture patch S

27 M 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 ∈ T 3 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 T 2 is added

28 A Simple PolyCube-Map example Subdivide into 8 cells of type 3 Each cell contains three facelets that sotred as a set of three texture squarelets

29 partition of the parameter space back to 3D dual cells case 3 case 4-a case 4-b case 5

30 partition of the parameter space case 3 case 4-a case 4-b case 5 dual cells

31 3D Look-up Table T 3 T 3 LUT T 3 LUTStore cell-structure of T 3 in 3D look-up table T 3 LUT ( define each cell through a set of parameters in the corresponding entry of T 3 LUT ) fProcessing a fragment f (fragment shader) f I3 –determine the cell that contains the f I3 T 3 LUT PM f T2 T 2 –access to T 3 LUT at the corresponding entry returns all the parameters needed to compute P and M (use to find the final 2D texture position f T2 ∈ T 2 )

32 3D Look-up Table – Parameter T 3 LUTEach entry of T 3 LUT is packed in one (r, g, b)-texel An entry e is composed of 3 parts –e.C –e.C – cell configurations (index) –e.R –e.R – axis-to-axis rotation (index) –e.O T 2 –e.O – global offset of the patch (in T 2 ) T 3 LUTT 3 LUT is always smaller than on Kilo texel T 2T 2 can be several Mega texels Construction of the look-up table !!

33 stored in texture RAM as: a packed texture image texture space (3D!) the polycube polycube-maps in a nutshell object space plus a tiny structure to store polycube layout the mesh (with per-vertex text. coord) u v w not necessarily on the polycube surface: project map to 2D a fragment with interpolated texture coord final texel value for the fragment

34 Fragment shader Input: current texture position (u,v,z) Find cell (in dual graph) Access information for that cell –case –orientation –offset in global texture Apply axis-to-axis rotation inside cell –according to orientation Apply projection –according to case Add global offset Fetch final texel at resulting position stored in a texel in the tiny 3D lookup table

35 Examples of poly-cubic parameterizations texture space polycube-map world space in texture RAM u v w object

36 Examples of poly-cubic parameterizations texture space polycube-map world space u v w object

37 Examples of poly-cubic parameterizations texture space polycube-map world space u v w object

38 Examples of poly-cubic parameterizations texture space polycube-map world space object u v w

39 An example application: same texture for different LOD Geometry 2 Geometry 1 Geometry 3 + + + = = = u v w the same polycube-map texture

40 How to build a Polycube-Map (for a given mesh) Not automatic, to this point –get a suitable polycube –warp it around the mesh –project mesh over it –unwarp –global optimization M T3T3 project warp -1 optimize warp

41 Global optimization projection (not optimized) mean value MIPSext. MIPS

42 Most Isometric ParametrizationS the horse head model parameterized using different angle/area preservation tradeoffs θ = 0.3θ = 1.0θ = 3.0

43 Experimental Results distortionStretch efficiency areaangle T 3 → MM → T 3 [Gu][Praun] 3-holes1.0031.0110.986 Laurana1.1411.1010.7950.745 Bunny1.0341.0690.8920.9130.6390.703 armadillo1.2241.3180.6160.5770.6070.465 Frame Rate 30 fps (mip-mapping) 10 fps (mip-mapping + bilinear interpolation) nVIDIA GeForce FX 5600 ATI Radeon 9800 Proo Pentium 4 2.4 Ghz

44 Discussion 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

45 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

46 Q: Aren’t cubemaps just another atlas? texture charts? chart boundaries? A: true, but such chart borders are: transparent for triangles invisible for mipmapping... hidden from the user u v w

47 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

48 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...)


Download ppt "Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani PolyCube-Maps seamless texture mapping Visual Computing Lab · ISTI · CNR · Pisa, Italy."

Similar presentations


Ads by Google