Presentation is loading. Please wait.

Presentation is loading. Please wait.

PolyCube-Maps seamless texture mapping

Similar presentations


Presentation on theme: "PolyCube-Maps seamless texture mapping"— Presentation transcript:

1 PolyCube-Maps seamless texture mapping
Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani 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)
disk-like patches texture charts v + = Let me start this talk with two concepts that we are all familiar with. u 3D mesh 2D texture image textured bunny images courtesy of Lévy, Sylvain, Ray and Maillot , SIGGRAPH 02

4 Cube-Maps Typically used for environment mapping mesh environment
per-fragment projection over the cube per-fragment texture fetch from the appropriate face mesh environment texture images from Bubble demonstration program, nVidia

5 with per-vertex 3D texture coord. (u,v,w)
Abusing Cube-Maps What if we store surface color in a cube-map? object space texture space object space u v w + = “But we can also think of an ABuse of cubemaps. Take a spherical objact, say, an apple. We could then use a cubemap to color it, rather than the env around it.” We would assign a 3D texture coord to each vertex. Color info defined on a 3D texture domain <click> BUT stored in a 2D domain. The hw would then project, for each produced frgment, the interpolated t.c. on that cube, and mesh with per-vertex 3D texture coord. (u,v,w) cube-map textured apple

6 texture atlas cube-map seams a triangle cannot span multiple charts
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

7 texture atlas cube-map seams a triangle cannot span multiple charts
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

8 texture atlas cube-map 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

9 texture atlas cube-map 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

10 texture atlas cube-map 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

11 texture atlas cube-map works (is general) does not (~spheres only!)
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!) so, why don’t we use cubemaps instead of standard texture? Obvoiusly, it is because what we are showing in the right part of this slide is a TOY exsample, that can work only because the texture object is similar to a sphere (actually, to a cube). Our objective is to have the same set of advantages for a GENERAL MESH. For that, we will extend the Cubemap mechanism. Before we do that, let see more closely what ingredient, which secret souce, make cubemap so ideal to texture an apple.

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

13  Going Beyond Apples Cube-Maps work well only for sphere-like objects
world space texture space Let us try to go beyond our toy example. sphere-like mesh cubic texture domain

14  Going Beyond Apples But for more general objects? ? world space
texture space ? arbitrary meshes cubic texture domain

15 incompatible topology
Going Beyond Apples But for more general objects? world space ? texture space ...huge distortions, incompatible topology arbitrary meshes cubic texture domain [Praun Hoppe SIGGGRAPH 2003]

16  Going Beyond Apples But for more general objects? world space
texture space far too complex (GPU) arbitrary mesh coarse mesh

17 Introducing Polycubes
Po·ly·cube: n. (Geom.) A solid composed by multiple unit cubes attached face to face

18 Choosing a Polycube Polycube should roughly resemble the mesh
world space texture space Why polycubes? 1st, polycubes give us enough flexibility to choose one that roughly resembles the given mesh and captures its large-scale features -> important to keep parametric distortion under bearable levels THEN, it is easy to define, and implement, the projection and the mapping to 2D that, as we have seen, we need. How do we do that? We will not go into detail here, but <click> mesh polycube

19 Partition of Texture Space
2D analogue case A case B dual grid a key ingredient here is polycube

20 partition of the parameter space
back to 3D case 3 case 4-a case 4-b case 5 case 6-a case 6-b

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

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

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

24 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

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

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

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

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

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

30 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

31 Global optimization mean value MIPS ext. MIPS projection
(not optimized)

32 Discussion Pros Cons Limits 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

33 Thank you! Questions? or, just Google for “polycube-map” Marco Tarini · Kai Hormann · Paolo Cignoni · Claudio Montani Visual Computing Lab · ISTI · CNR · Pisa, Italy

34 Q: why only 6 cases? MC has 15... A: only polycubes with two-manifold surfaces are considered... no no

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

36 Q: Similarities with volumetric textures
Yes, a cube map can be seen as a compressed 3D texture… …which works only for a 2D surface in 3D texture space (and around it) texture stored in 1D values defined in a 2D space 2D analogue

37 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

38 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 "PolyCube-Maps seamless texture mapping"

Similar presentations


Ads by Google