6 - The Chinese University of Hong Kong

Download Report

Transcript 6 - The Chinese University of Hong Kong

Spherical Maps with the NearEqual Solid-Angle Property
Liang Wan
Tien-Tsin Wong
The Chinese University of Hong Kong
Spherical Maps
Represent the surrounding environment
 Applications

Environment mapping
 Precomputed radiance transfer (PRT)
 Image-based relighting
…


Spherical maps

2
Cubemap, longitude/latitude map, dual
paraboloid map, sphere map, …
Criteria

Uniform distribution


Equal-area property


Speed of querying a point in the map
Base face number

3
Measure the mapping distortion of texel shapes
Query efficiency


Whether the texels span the same solid-angle
Stretch


How uniformly the samples are distributed?
6-face map fits nicely into the hardware
Cubemap

Properties




Drawbacks



4
6 base faces
Fast look-up
Hardware cubemap
Not uniformly distributed
Not equal-area
Distortion at corners
Three Spherical Maps
HEALPix
Equal-area
5
Rhombic
dodecahedron
Similar
distortion
Isocube
Six-face,
Equal-area
Base Faces
6
Cubemap
12
HEALPix
12
Rhombic
dodecahedron
6
6
Isocube
Sample Distribution
Uneven
samplin
g
Cubemap
Rhombic
dodecahedron
7
HEALPix
Isocube
Shape Distortion
Not
equalarea
Cubemap
Similar
distortion
Rhombic
dodecahedron
8
Quadrilatera
l
HEALPix
Shape
distortio
n
Isocube
Property Summary
9
Cubemap
HEALPix
Rhombic
Dodecahedron
Isocube
Base face
number
6
12
12
6
Uniform
Distribution
Uneven
Even
Fair
Even
Equal-area
property
Not equal
Equal
Near
Equal
Texel
shape
Quad.
Quad.
Quad.
Quad./ Tri.
Base
Polyhedron
Spherical
partitioning
Polyhedron
Spherical
partitioning
Property Summary
10
Cubemap
HEALPix
Rhombic
Dodecahedron
Isocube
Base face
number
6
12
12
6
Uniform
Distribution
Uneven
Even
Fair
Even
Equal-area
property
Not equal
Equal
Near
Equal
Texel
shape
Quad.
Quad.
Quad.
Quad./ Tri.
Base
Polyhedron
Spherical
partitioning
Polyhedron
Spherical
partitioning
HEALPix Construction

Originated in astrophysics

Curvilinear partitioning of the sphere
1 
3
 z 
 2/ 3z  k
2 2
4
1 
3
   z l
2 2
4

2
31 k,zl   t  k
31  z   1  t   l
11
HEALPix Mapping
01
02
03
04
06
07
08
09
10
11
12
13
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
12
float3 hpmap(float3 dir)
{
float fn, u, v, iu, iv, x, y, z, t;
float tt, tn, tf, za, tmp, zone, south;
float3 res;
x=dir.x; y=dir.z; z=dir.y;
t = atan2(-y, x)/1.571;
t += step(t, 0.f) * 4.0;
za = 3.0 * abs(z);
tf = modf(t, tn);
// Equatorial or polar zone
if ( za < 2.0 ) {
// Equatorial zone
tt = t + 0.5;
tmp= z * 0.75;
u = modf(tt + tmp, iu);
v = modf(tt - tmp, iv);
fn = min(iu, iv);
fn+= 4 + (sign(iv-iu) - floor(fn/4))*4;
res= float3(fn, u, v);
} else {
// Polar zone
tmp= sqrt(3.0f - za);
// If in south pole zone
south = ( z < 0 );
tt = tmp * tf;
tmp= 1.0 - tmp;
tf = tmp * south;
res= float3(tn+8*south, tmp-tf+tt, tf+tt);
}
return res;
}
HEALPix

Characteristics





Drawback

13
Equal area
A hierarchical structure
Samples on parallel small circles
Facilitate spherical harmonic transform
Texels in different base faces have different shapes
Property Summary
14
Cubemap
HEALPix
Rhombic
Dodecahedron
Isocube
Base face
number
6
12
12
6
Uniform
Distribution
Uneven
Even
Fair
Even
Equal-area
property
Not equal
Equal
Near
Equal
Texel
shape
Quad.
Quad.
Quad.
Quad./ Tri.
Base
Polyhedron
Spherical
partitioning
Polyhedron
Spherical
partitioning
Rhombic Dodecahedron Construction

Great circle subdivision
1
0
15
6
2
5 9 10 7 3
8
11
4
Rhombic Dodecahedron

Characteristics
All texels are distorted similarly
 Identical base faces
 Geodesic property

16
HEALPix & Rhombic Dodecahedron

Drawbacks




What we desire?


17
Both consist of 12 base faces
Tailor-made programs for texture lookup
Difficult for mipmap construction and tri-linear filtering
6 faces so as to fully utilize the hardware cubemap
Retain good properties
Property Summary
18
Cubemap
HEALPix
Rhombic
Dodecahedron
Isocube
Base face
number
6
12
12
6
Uniform
Distribution
Uneven
Even
Fair
Even
Equal-area
property
Not equal
Equal
Near
Equal
Texel
shape
Quad.
Quad.
Quad.
Quad./ Tri.
Base
Polyhedron
Spherical
partitioning
Polyhedron
Spherical
partitioning
Isocube Construction

Spherical partitioning

 z k
21/ /32
2
2
z  (2l  1)
3

  k / 31  z 
2
4
z  1 l2
3
19
Isocube Mapping
01 float3 R2Q( float3 R )
02 {
03 float2 I;
04 float3 Q;
05 float4 coef;
06 float phi, y, ya, bequ,quar;
07
08 // Compute azimuth angle and convert it in the range [0,4)
09 phi = 2*atan2(R.z, R.x)/PI;
10 phi+= step(phi, -0.5) * 4;
11
12 // Decide whether the pixel is in the equatorial region
13 y
= R.y * 1.5;
14 ya = abs(y);
15 bequ= step(ya, 1.);
16
17 // Convert R → I
18 I.x = sqrt(3 - 2*ya);
19 I.x = lerp(I.x, 1, bequ);
20 I.y = phi * I.x;
21
22 // Map I → Q
23 quar= floor(phi + 0.5);
24 coef= texRECT(signTBL, float2(quar, 0));
25 Q.x = dot(coef.xy, I);
26 Q.y = lerp(sign(y), y, bequ);
27 Q.z = dot(coef.zw, I);
28
29 return Q;
30 }
20
R
Q
Isocube

Characteristics
Equal area
 6 faces
 Extremely fast look-up


Drawback

21
Distortion in polar regions
Environment Mapping
HEALPix
Rhombic
Dodecahedron
22
Environment Mapping
Cubemap
23
Isocube
Rendering Comparison
Demo
Cubemap
24
Discussions

Performance comparison
Timing (fps)
Cubemap
HEALPix
Rhombic
Dodecahedron
Isocube
232.6
65.9
56.5
168.2
Discrepancy
Figure. Discrepancy Comparison
Stretch
Figure. Stretch Variance Comparison
The timing test context: object with 106,466 vertices, Pentium IV 2.6 GHz CPU,
nVidia GeForceFX 6800 Ultra.

25
All three maps are resampled from a
high-resolution cubemap
Potential Applications

Equal-area, uniform sampling


Similar distortion


OmniMax video
HEALPix, isocube
Shadow mapping
HEALPix, rhombic dodecahedron
Hemicube
Cubemap, isocube
26
References

HEALPix
1.
2.
3.

Isocube
1.
27
K. M. Górski, E. Hivon, and B. D. Wandelt, Analysis issues for large CMB data sets. In
Proc. of the MPA/ESO Conference on Evolution of Large-Scale Structure: from
Recombination to Garching, 1998
T.T. Wong, L. Wan, C.S. Leung, and P.M. Lam, Real-time environment mapping with
equal solid-angle spherical quad-map, Shader X4: Lighting & Rendering, Edited by W.
Engel, Charles River Media, 2006
L. Wan, T.T. Wong, and C.S. Leung, Spherical Q2tree for sampling dynamic
environment sequences, in Proc. of Eurographics Symposium on Rendering 2005
(EGSR 2005), Konstanz, Germany, pp. 21-30, 2005
L. Wan, T.T. Wong, and C.S. Leung, Isocube: Exploiting the Cubemap Hardware, IEEE
Transactions on Visualization and Computer Graphics, to appear
Webpage
28

The updated document can be found in the website
http://www.cse.cuhk.edu.hk/~ttwong/papers/spheremap/s
pheremap.html

The demo code is free to download from the link
http://www.cse.cuhk.edu.hk/~ttwong/demo/spheremap/sp
heremap.html
Credits & Acknowledgments





29
Rhombic dodecahedron is a joint work with Chi-Wing Fu (HKUST) and
Chi-Sing Leung (CityU)
Isocube is a joint work with Chi-Sing Leung (CityU)
Thanks to Lai-Sze Ng and Ping-Man Lam for implementing part of the
codes
Thanks to Xuemiao Xu for capturing some of the panoramas
This work is supported by Research Grants Council of the Hong Kong
Special Administrative Region, under RGC Earmarked Grants (Project
No. CUHK416806)
Q&A
30
Discrepancy comparison
31
Stretch variance comparison
32