Title: Transformation of Rendering Algorithms for Hardware Implementation
1Transformation of Rendering Algorithms for
Hardware Implementation
- Ph.D. Thesis by
- Ali Mohamed Ali Abbas
- Scientific Supervisor
- Professor Dr. Szirmay-Kalos László
- Department of Control Engineering and Information
Technology - Faculty of Electrical Engineering and Informatics
- Budapest University of Technology and Economics
- Budapest, 2003.
2The outlines of this talk
- General rendering schemes.
- Problems of current rendering approaches - low
quality, simple, hardware supported. - high
quality, complex, not hardware supported.
The main aim of this thesis is to convert high
quality complex algorithms to make them
appropriate for hardware realization.
3The proposed solutions
- general framework
(Thesis 1)- filtered line drawing
(Thesis 2)- spherical interpolation for
Phong shading
(Thesis 3)- quadratic
interpolation for Phong shading and texturing
(Thesis 4)-
hardware support for global illumination
(Thesis 5)
4Incremental rendering
L
V
y
N
z
x
5Gouraud shading
R(X,Y) a X bY c
R,G,B
Y
R(X,Y)
a
R(X1,Y) R(X,Y)
X
Ambient
Diffuse
6System outline of Gouraud shader
Gouraud shading Phong
exponent 20
Tessellation level
374 triangles
168 triangles
690 triangles
7Phong shading
- vector interpolation
- vector normalization
- rendering equation
V
N
L
R,G,B
Y
N(X,Y)
N(X,Y) a X bY c L(X,Y) V(X,Y)
X
8System outline of Phong shader
Phong
Gouraud
9General framework (Thesis 1)
- Surface tessellation, to triangles and line
segments - Transformation, projection and shading
- Incremental concept, I(X1,Y) I(X,Y)
?I(X,Y)- reducing algorithms complexity-
recursive computation - The accuracy of the fixed-point representation
was investigated, and the number of fractional
bits was computed
10Incremental concept for quadratic and linear
functions
I(X,Y) T5 X 2 T4 X Y T3 Y 2 T2 XT1YT0
. I(X1,Y) I(X,Y) (2T5 X T4 Y T5 T2
) .
? I (X,Y)
11Publications
1. A. M. Abbas. Photorealistic Images in
Real-Time, No 20, 2003, in the Journal of
Industrial Researches. 2. A. M. Abbas, L.
Szirmay-Kalos, and T. Horváth. Hardware
Implementation of Phong Shading using Spherical
Interpolation. Periodica Polytechnica,
44(3-4) 283-301, 2000. 3. A. M. Abbas, L.
Szirmay-Kalos, T. Horváth, and T. Fóris.
Quadratic Shading and its Hardware
Interpolation, Machine GRAPHICS VISION
, 9(4)625-839, 2000. 4. A. M. Abbas, L.
Szirmay-Kalos, T. Horváth, T. Fóris, and G.
Szijártó, Quadratic Interpolation in
Hardware Rendering, In Spring Conference
on Computer Graphics, Budmerice, Slovakia,
April 2001. (Best paper award).
12Filtered Line Drawing (Thesis 2)
Incremental cone-filtering
Box-filtering
Bresenhams
(Stair-like jaggies)
13Cone filtering of lines
?X
D d . cos F
d .
(?X)2 (?Y) 2
d . ?D
DH (1 - d) . cos F - D ?D
DL (1 d) . cos F D ?D
?Y
D(X1) D(X)
(?X)2 (?Y) 2
D(X) ?D-
?X - ?Y
D(X1) - D(X)
(?X)2 (?Y) 2
- D(X) ?D
14Block scheme of incremental cone-filtering
Publications 1. A. M. Abbas. On 2D Line Scan
Conversion.In Conference on The Latest Results
in Information Technology. IIT, Technical
University of Budapest, Hungary, 1998. 2. A. M.
Abbas. Photorealistic Images in Real-Time. No
20, 2003, in the Journal of Industrial
Researches.
15Spherical Interpolation for Phong shading
(Thesis 3)
- vector interpolation
- vector normalization
- rendering equation
V
N
L
R,G,B
Y
N(X,Y)
N(X,Y) a X bY c L(X,Y) V(X,Y)
X
16Linear interpolation Normalization ? Spherical
Interpolation
sin t?
sin (1-t)?
u1
u2
u(t)
sin ?
sin ?
u1 u2 cos ?
For uniform interpolation the following equations
must be proven for u(t)
u(t)2 1 u1 u(t) cos t? u2 u(t)
cos (1 - t)?
17Simultaneous spherical interpolation of a pair of
vectors
cos ?(t) u'(t) v1 u'2 expressed by
quaternion multiplication. rotating u2
by composition its own transformation and
inverse transformation of v1 to v2
18Calculation of specular reflection for Blinn BRDF
and single light-source
sin t?
sin (1-t)?
(u1 v1 )
(u'2 v1)
cos ?(t) u'(t) v1
sin ?
sin ?
cos ?(t) A cos (t? - a)
Iout Ie ka Ia Iin(L) kd cos ?L
Iin(L) ks cosn d
Iin(L)ks (N H) Iin(L) ks
An cosn (t? - a)
C
19Elimination of the exponentiation
cosn (t? - a) exponentiation with a
non-constant n Solution cosn x ?
cos2 ax
cos2 ax, for a 1.45,1.98,2.76
cosn x, for n 5,10,50,100,500
20Correspondence of n and a
?
?
?
?
cosn x sin x dx ?
2
cos2 ax sin x dx
2a
0
0
Table of correspondence between n and a
n500, a13.5535
n5, a1.4502
21Evaluation of the visual accuracy of the
functions cosn x ? cos2 ax
cosn x for n 5,10,20
cos2 ax for a 1.4502, 1.9845, 2.7582
?
22Quantization errors of address/data bits by cos2
ax
cos2 x
cos2 x
4 bits
6 bits
cos2 ax
cos2 ax
6 bits
4 bits
cos2 ax
cos2 ax
23Block scheme of spherical interpolation
Publications
1. A. M. Abbas, L. Szirmay-Kalos, and T. Horváth.
Hardware Implementation of Phong Shading
using Spherical Interpolation. Periodica
Polytechnica, 44(3-4)283--301, 2000.
24Quadratic Interpolation for Phong shading
(Thesis 4)
V
N
- vector interpolation
- vector normalization
- rendering equation
L
R,G,B
Y
N(X,Y)
N(X,Y) a X bY c L(X,Y) V(X,Y)
X
25Quadratic interpolation
- The interpolation is done in image space.
- The interpolation is not linear, but rather
quadratic. - Quadratic form has 6 degrees of freedom.
I(X,Y) T5 X 2 T4 X Y T3 Y 2 T2 XT1YT0 .
26Hardware implementation
I(X,Y)
X
Clk
Register
X Counter
Xstart
S
? I (X,Y)
Register
S
2T5
27Quadratic interpolation in texturing (Thesis 4.2)
v
Texture space
Screen space
Y
y
z
Real world
u
x
X
The corresponding between pixel and texel
coordinates is obtained by a homogeneous
linear transformation.
auXbuYcu
u
,
dXeYf
avXbvYcv
v
.
dXeYf
28Linear and quadratic texturing
Quadratic
Linear
System outline of quadratic interpolation
29Simulation results of quadratic interpolation
30Publications
- 1. A. M. Abbas, L. Szirmay-Kalos, T. Horváth, and
T. Fóris. - Quadratic Shading and its Hardware
Interpolation. - Machine GRAPHICS VISION , 9(4)625--839,
2000. - 2. A. M. Abbas, L. Szirmay-Kalos, T. Horváth, T.
Fóris, and G. Szijártó. - Quadratic Interpolation in Hardware
Rendering. - In Spring Conference on Computer Graphics,
- Budmerice, Slovakia, April 2001, (Best paper
award). - 3. A. M. Abbas, L. Szirmay-Kalos, T. Horváth, T.
Fóris, and G. Szijártó. - Quadratic Interpolation in Hardware Phong
Shading and Texture Mapping. - In IEEE Computer Society Press in the
Post-Proceedings of The 17th. - Spring Conference on Computer Graphics,
Budmerice, Slovakia, April 2001.
31Hardware support for global illumination (Thesis
5)
Local illumination
Local illumination ambient term
Global illumination
32Radiance transfer by transillumination buffer
Random, global direction
3
3
1
3
1
3
1
2
2
2
Transillumination image buffer
- identifying the patches that are visible from a
given patch - solution of global visibility
problem, transillumination direction - store in
visibility map, extended (or modified ) z-buffer
33Block scheme of global illumination
Publications 1. L. Kovács, L. Szirmay-Kalos,
and A. M. Abbas. Testing Global
Illumination Methods with Analytically Computable
Scenes. In Winter School of Computer
Graphics, II419--426, Plzen, Cz., February
2001. 2. R. Martinez, L. Szirmay-Kalos, M.
Sbert, and A. M. Abbas. Parallel
implementation of Stochastic Iteration
Algorithms. In Winter School of
Computer Graphics, II344--351, Plzen, Cz.,
February 2001.
34Summary
- Thesis 1 - general methodology based on
incremental concept. - Thesis 2- anti-aliased line drawing algorithm
with simple operations - Thesis 3- single cosine function (reduced
number of dot-products) - no normalization or
scalar exponentiation are required - Thesis 4- approximates non-linear functions
(Phong shading or texturing). - simple for
hardware implementation. - arbitrary BRDF
models.- independent of the number of light
sources. - Thesis 5- speedup global illumination.
35Simulation, application
- Simulation environments
- the proposed algorithms first simulated in
software using C, then transformed to
hardware design, specified in VHDL and
simulated in Model-Technology environments
assuming the delay times of a real FPGA device. - the results demonstrate that, these hardware
schemes could provide appropriate pixel
drawing time, enough for real-time rendering - These hardware schemes have not been build yet
- Possible applications of the results
- Development of new hardware,
- Efficient CPU level and vertex/pixel shader level
program development. - Thank you very much for your attention