• Nie Znaleziono Wyników

Metoda energetyczna (Radiosity)

N/A
N/A
Protected

Academic year: 2021

Share "Metoda energetyczna (Radiosity)"

Copied!
26
0
0

Pełen tekst

(1)

Grafika Komputerowa

Radiosity (Metoda Energetyczna)

Alexander Denisjuk

denisjuk@pjwstk.edu.pl

Polsko-Japo ´nska Wy˙zsza Szkoła Technik Komputerowych

zamiejscowy o´srodek dydaktyczny w Gda ´nsku

ul. Brzegi 55

80-045 Gda ´nsk

(2)

Radiosity (Metoda Energetyczna)

Najnowsza wersja tego dokumentu dost ˛epna jest pod

adresem

(3)

Radiosity

(4)

Podział na płaty

Figure XI.1: The pat hes used to render the radiosity s ene of gures XI.2 and XI.3. See olor plate C.13.

(5)

Cieniowanie płaskie

Figure XI.2: A radiosity rendered gure, with at shading. It is evident that this image is based on the pat hes shown in gure XI.1. See olor plate C.14.

(6)

Cieniowanie z interpolacj ˛

a

Figure XI.3: A radiosity rendered gure, with smooth shading of illumination. The red olorof the boxis re e tedontothe nearbywalls, givingthema slight reddish hue. This is based on the pat hes shown in gure XI.1. See olor plate C.15.

(7)

Podział na płaty

1. równomiernie o´swietlone

2. wystarczaj ˛

aco małe

3. zu˙zycie pami ˛eci, obliczalna skompikowalno´s´c:

O(n

2

)

(8)

Rownanie energetyczne

Wybrano płaty

P

1

, . . . , P

n

o polach

poweirzchni

A

1

, . . . , A

n

.

B

i

jest ´srednim ´swiatłem promieniowanym przez

płat

P

i

.

(9)

Współczynnik sprz ˛e˙zenia

optycznego

F

i,j

— ilo´s´c ´swiatła, przekazywanego z płata

P

i

.

F

i,i

= 0

.

(10)

Rownanie energetyczne

Całkowite ´swiatło emitowane z

P

j

:

A

j

B

j

.

Całkowite ´swiatło padaj ˛

ace na

P

i

:

A

i

B

i

in

.

A

i

B

i

in

=

P

n

j=1

F

j,i

A

j

B

j

.

Równanie wzajemno´sci:

A

i

F

i,j

= A

j

F

j,i

.

B

i

in

=

P

n

j=1

F

i,j

B

j

.

Równanie radiosity:

B

i

= E

i

+ R

i

P

n

(11)

Radiosity equation

B = E + M B

.

B =

B

1

..

.

B

n

,

E =

E

1

..

.

E

n

.

M = R

i

F

i,j



.

(I − M )B = E ⇒ B = (I − M )

−1

E

.

Grafika Komputerowa – p. 11

(12)

Algorytm radiosity

Mesh s ene as pat hes Compute form fa tors Solve radiosity equations for B Render with smooth shading

(13)

Obliczenie współczynników

sprz ˛e˙zenia optycznego

F

i,j

[0, 1]

,

P

n

j=1

F

i,j

= 1

.

F

1,2

0

,

F

2,1

1

.

Pat h P 1 , area A 1 . Pat h P 2 , area A 2 .

Figure XI.5: A large pat h and small pat h.

(14)

Obliczenie współczynników

sprz ˛e˙zenia optycznego

ϕ

i

, ϕ

j

< 90

.

pole zrzutu

P

j

na sfer ˛e jednostkow ˛

a w

P

i

:

cos ϕ

j

A

j

/d

2

.

cz ˛e´s´c pola zrzutu

P

j

:

(cos ϕ

2πd

j

2

)A

j

.

P j A j n i n j ' i ' j d

(15)

Obliczenie współczynników

sprz ˛e˙zenia optycznego

F

i,j

cos ϕ

i

(cos ϕ

j

)A

j

2πd

2

.

Całkowita ilo´s´c emitowanego ´swiatła jest 1.

R

S

i

+

cos ϕ dA =

R

π/2

0

cos ϕ(2π sin ϕ) dϕ = π

.

F

i,j

= cos ϕ

i

(cos ϕ

πd

j

2

)A

j

F

i,j

A

i

= F

j,i

A

j

.

P i A i P j A j n i n j ' i ' j d

Figure XI.6: Two in nitesimally small pat hes P i

and P j

with areas A i and A . The normals to the pat hesare n and n .

(16)

Ograniczenia

Płaty s ˛

a małe w porównaniu do

g

.

Nie uwzgl ˛ednia si ˛e widoczno´s´c płat.

(17)

Widoczno ´s ´c płat. Ray tracing

F

i,j

= V

i,j

cos ϕ

i

(cos ϕ

j

)A

j

πd

2

.

V

i,j

— współczynnik widoczno´sci.

V

i,j

= V

j,i

.

jittering (fluktacje).

(18)

Współczynniki sprz ˛e˙zenia

optycznego. Hemicube method

P i

P j

FigureXI.7: Proje tiononto ahemi ube.

P

j

zast ˛epiony przez projekcj ˛e.

(19)

Hemicube method

0 x;y z d = p x 2 +y 2 +1 ' i ' j Pixels on top fa e: z=1. Shows P j

Figure XI.8: A row of pixels along the top of the hemi ube. One pixel shows pat h P

j

. The origin is pla ed at the enter of pat h P i

. The top of the ube is the z =1 plane.

cos ϕ

i

= cos ϕ

j

= 1/d

.

F

i,j

=

P

pixele

P

j

(1/d)(1/d)h

Pole pixeli

i

πd

2

.

F

i,j

=

P

pixele

P

j

h

Pole pixeli

i

πd

4

.

Grafika Komputerowa – p. 19

(20)

Hemicube method

os' i = z=d os' j = 1=d 0 x;y z d = p 1+ y 2 + z 2 ' i x = 1 ' j Shows P j

Figure XI.9: A row of pixels along the x = 1 side of the hemi ube.

F

i,j

=

P

pixele

P

j

zh

Pole pixeli

i

πd

4

.

(21)

Równanie radiosity. Metody

iteracyjne

(I − M )B = E

.

B = (I − M )

−1

E

, metody bezpo´srednie

O(n

3

)

.

Lemat 1. Niech

M

b ˛edzie macierz ˛

a równania radiosity. Wtedy

1.

m

i,j

>

0

,

2.

0 6 MaxRowSum(M ) < 1

,

3.

MaxRowSum(M

k

) < (MaxRowSum(M ))

k

,

k = 1, 2, . . .

,

gdzie

MaxRowSum(M ) = max

i

P

j

m

i,j

.

(22)

Równanie radiosity

Wniosek 2. Niech

M

b ˛edzie macierz ˛

a równania radiosity. Wtedy

1.

I − M

jest macierz ˛

a odwracaln ˛

a,

2.

(I − M )

−1

= I + M + M

2

+ . . .

.

(23)

Metoda Jacobiego

/ / Bnew , B , E s ˛

a wektorami

/ / m j e s t macierz ˛

a

B=E ;

while ( not o s i ˛

a g n i ˛e t a dokładno ´s ´c ) {

f o r ( i = 1 ; i <=n ; i + + ) {

Bnew [ i ] =E [ i ] +

P

n

j=1

m[ i , j ]

B [ j ] ;

}

B=Bnew ;

}

Grafika Komputerowa – p. 23

(24)

Metoda Gaussa-Seidla

/ / Bnew , B , E s ˛

a wektorami

/ / m j e s t macierz ˛

a

B=E ;

while ( not o s i ˛

a g n i ˛e t a dokładno ´s ´c ) {

f o r ( i = 1 ; i <=n ; i + + ) {

B [ i ] =E [ i ] +

P

n

j=1

m[ i , j ]

B [ j ] ;

}

(25)

Metoda Strzałów

/ / B ,

B , E s ˛

a wektorami , m j e s t macierz ˛

a

B= 0 ;

B=E ;

while ( not o s i ˛

a g n i ˛e t a dokładno ´s ´c ) {

w y b i e r ˙z j ta k , ˙zeby maksymalizowa ´c

B [ j ]

A_j ;

B [ j ]+=

B [ j ] ;

f o r ( i = 1 ; i <=n ; i + + ) {

B [ i ] =

B [ i ] +

P

n

j=1

m[ i , j ]

B [ j ] ;

}

B [ j ] = 0 ;

B+=

B ;

}

Grafika Komputerowa – p. 25

(26)

RRV - Radiosity Renderer and

Visualizer

Obraz

Figure XI.1: The pat
hes used to render the radiosity s
ene of gures XI.2
Figure XI.2: A radiosity rendered gure, with 
at shading. It is evident that
Figure XI.3: A radiosity rendered gure, with smooth shading of illumination.
Figure XI.4: The four stages of the radiosity algorithm
+6

Cytaty

Powiązane dokumenty

In the historical development of art, the human figure presents the deepest insight into the social-cultural concepts of art, from aboriginal tribal culture to the most

S a j k a, M.: 2006c, From research on using problems related to functional equations as multifunctional tools for revealing subject matter knowledge of functions in future

The second part of the XVI-th Hilbert problem asks for the number and posi- tion of limit cycles of system (1).. In particular, one wants to get the bound N (n) for the number of

For the triangle in Problem 4 compute the length of the altitude through the vertex A.. For the tetrahedron in Problem 7 compute the lenght of the altitude through the

[r]

.], whose entries are almost all zero;... Find eigenvalues and eigenvectors

4. Lower bounds for some linear forms with algebraic coeffi- cients. The bounds obtained in [14], [10], [22] for the solutions of norm form equations implied lower bounds for

(The Frey curves arising in their proof for Theorem 1 have semistable reduction at 3 and 5, and the Shimura–Taniyama conjecture for such elliptic curves had already been settled