Title: GDC 2005
1Sphere Maps with the Near-Equal Solid-Angle
Property
Liang Wan Tien-Tsin Wong The Chinese
University of Hong Kong
2Spherical Maps
- Represent the surrounding environment
- Applications
- Environment mapping
- Precomputed radiance transfer (PRT)
- Image-based relighting
-
- Spherical maps
- Cubemap, longitude/latitude map, dual paraboloid
map, sphere map,
3Criteria
- Uniform distribution
- How uniformly the samples are distributed?
- Equal-area property
- Whether the texels span the same solid-angle
- Stretch
- Measure the mapping distortion of texel shapes
- Query efficiency
- Speed of querying a point in the map
- Base face number
- 6-face map fits nicely into the hardware
4Cubemap
- Properties
- 6 base faces
- Fast look-up
- Hardware cubemap
- Drawbacks
- Not uniformly distributed
- Not equal-area
- Distortion at corners
5Three Spherical Maps
Equal-area
Similar distortion
Six-face,Equal-area
6Base Faces
6
12
Cubemap
HEALPix
12
6
Rhombic dodecahedron
Isocube
7Sample Distribution
Uneven sampling
8Shape Distortion
Quadrilateral
Not equal-area
Shape distortion
Similar distortion
Isocube
9Property Summary
10Property Summary
11HEALPix Construction
- Originated in astrophysics
- Curvilinear partitioning of the sphere
12HEALPix Mapping
01 float3 hpmap(float3 dir) 02 03 float
fn, u, v, iu, iv, x, y, z, t 04 float tt, tn,
tf, za, tmp, zone, south 06 float3 res 07 08
xdir.x ydir.z zdir.y 09 t
atan2(-y, x)/1.571 10 t step(t, 0.f)
4.0 11 za 3.0 abs(z) 12 tf
modf(t, tn) 13 // Equatorial or polar zone 15
if ( za lt 2.0 ) 16 // Equatorial zone
17 tt t 0.5 18 tmp z 0.75
19 u modf(tt tmp, iu) 20 v
modf(tt - tmp, iv) 21 fn min(iu, iv) 22
fn 4 (sign(iv-iu) - floor(fn/4))4 23
res float3(fn, u, v) 24 else 25
// Polar zone 26 tmp sqrt(3.0f - za) 27
// If in south pole zone 28 south ( z lt
0 ) 29 tt tmp tf 30 tmp 1.0 -
tmp 31 tf tmp south 32 res
float3(tn8south, tmp-tftt, tftt) 33 34
return res 35
13HEALPix
- Characteristics
- Equal area
- A hierarchical structure
- Samples on parallel small circles
- Facilitate spherical harmonic transform
- Drawback
- Texels in different base faces have different
shapes
14Property Summary
15Rhombic Dodecahedron Construction
16Rhombic Dodecahedron
- Characteristics
- All texels are distorted similarly
- Identical base faces
- Geodesic property
17HEALPix Rhombic Dodecahedron
- Drawbacks
- Both consist of 12 base faces
- Tailor-made programs for texture lookup
- Difficult for mipmap construction and tri-linear
filtering - What we desire?
- 6 faces so as to fully utilize the hardware
cubemap - Retain good properties
18Property Summary
19Isocube Construction
20Isocube 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
2atan2(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 - 2ya) 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
21Isocube
- Characteristics
- Equal area
- 6 faces
- Extremely fast look-up
- Drawback
- Distortion in polar regions
22Environment Mapping
HEALPix
Rhombic Dodecahedron
23Environment Mapping
Isocube
Cubemap
24Cubemap v.s. HEALPix
Cubemap
HEALPix
25Cubemap v.s. Rhombic Dodecahedron
Cubemap
Rhombic Dodecahedron
26Cubemap v.s. Isocube
Cubemap
Isocube
27Discussions
- Performance comparison
- All three maps are resampled from a
high-resolution cubemap
The timing test context object with 106,466
vertices, Pentium IV 2.6 GHz CPU, nVidia
GeForceFX 6800 Ultra.
28Potential Applications
- Equal-area, uniform sampling
- OmniMax video
- HEALPix, isocube
- Similar distortion
- Shadow mapping
- HEALPix, rhombic dodecahedron
- Hemicube
- Cubemap, isocube
29References
- HEALPix
- GÓRSKI K. M., HIVON E., WANDELT B. D. Analysis
issues for large CMB data sets. In Proceedings of
the MPA/ESO Conference on Evolution of
Large-Scale Structure from Recombination to
Garching, 1998 - Wong T.T., Wan L., Leung C.S., and Lam P.M.,
Real-time environment mapping with equal
solid-angle spherical quad-map, Shader X4
Lighting Rendering, Edited by W. Engel, Charles
River Media, 2006 - Wan L., Wong T.T., and Leung C.S., Spherical
Q2tree for sampling dynamic environment
sequences, in Proceedings of Eurographics
Symposium on Rendering 2005 (EGSR 2005),
Konstanz, Germany, pp. 21-30, 2005 - Isocube
- Wan L., Wong T.T., and Leung C.S., Isocube
Exploiting the Cubemap Hardware, IEEE
Transactions on Visualization and Computer
Graphics, to appear
30Webpage
- The updated document can be found in the website
- http//www.cse.cuhk.edu.hk/ttwong/papers/spherem
ap/spheremap.html - The demo code is free to download from the link
- http//www.cse.cuhk.edu.hk/ttwong/demo/spheremap
/spheremap.html
31Credits Acknowledgments
- 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)
32Q A
33Discrepancy comparison
34Stretch variance comparison