This presentation is the property of its rightful owner.
Sponsored Links
1 / 73

真实感图形显示基础 PowerPoint PPT Presentation


  • 59 Views
  • Uploaded on
  • Presentation posted in: General

真实感图形显示基础. 《 计算机图形学 》 教案. 孙正兴 博士. 真实感图形显示问题. 真实感图形是一种计算机图形生成技术,它首先在计算机中构造出所需场景的几何模型,然后根据假定的光照条件,计算画面上可见的各景物表面的光亮度,使观者身临其境,如见其物的视觉效果。基于这项技术, 设计人员可以在设计图纸时就可以浏览产品的形状和结构; 考古工作者可以跨越时空隧道,在古代宫殿中漫游; 探险家不必乘坐宇宙飞船就可以领略太空的美景。

Download Presentation

真实感图形显示基础

An Image/Link below is provided (as is) to download presentation

Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author.While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server.


- - - - - - - - - - - - - - - - - - - - - - - - - - E N D - - - - - - - - - - - - - - - - - - - - - - - - - -

Presentation Transcript


6108118


6108118


6108118

    • ()

    • ,


6108118

BSP

A


6108118

    • ABAB


6108118

V

N

N=(A,B,C)

V

N=(A,B,C)

Yv

Xv

V

Zv

ZVC<0

  • N(A,B,C)

    • VVN>0

  • ZVV=(0,0,Vz)VN=VzCNZCZVC<0ZC=0()ZC0

    • C


Z buffer

S3

(x,y)

S

S2

S1

Yv

(x,y)

Xv

Zv

(Z-buffer)

  • ZZ-buffer

    • (x,y,z)(x,y)(x,y)Z

    • (XVYV)(x,y)S1(x,y)

Z0ZmaxZmax1()


6108118

  • . (x,y)depth(x,y)=0refresh(x,y)=Ibackgnd

  • .

    • (x,y)z,

    • zdepth(x,y)depth(x,y)=zrefresh(x,y)=Isurf(x,y)

    • IbackgndIsurf(x,y)(x,y)

    • (x,y)

    • 0()

(x,y)

depth(x,y)=0refresh(x,y)=Ibackgnd

(x,y)z,

zdepth(x,y)depth(x,y)=z

refresh(x,y)=Isurf(x,y)


6108118

  • (x,y)z= (-Ax-By-DC)

  • (x,y)z(x+1,y)z=(-A(x+1)-By-D)/Cz=z-(A/C)

    • -(A/C)

    • yxx=x-(1/m)mz=z+((A/m)+B)/C)z=z+(B/C)

    • 10241024100


A a buffer

A(A-buffer)

  • AA(Antialiased)(Area averaged)(Accumulation buffer)

    • A

  • A

    • RGB

    • RGB()


A a buffer1

  • RGB

  • ()

A

A

  • RGB

D>0

i

D<0

Surf 1

Surf 2

A(A-buffer)

  • A


6108118

    • x

    • onoff


6108118

B

E

Yv

F

1

S1

S2

A

2

3

H

C

G

D

Xv

S1S2

    • 1ABBCEHFGABBCS1onS1EHFGS2on1

  • 23ADEHBCFG2ADEHS1onEHBConS1S2S1ADBCS1off,S2BCFG


6108118

  • 323EHBCS1


6108118

Zmax

s

Zmin

Zmax

s

Zmin

Xv

Zv

()

  • ZzSSxy


6108118

  • S

    • xy

    • S

    • S

  • SS

  • xySSSSSSSSSxySS


6108118

P2

P1

P1

C

A

D

P2

P2

B

A

D

C

B

(a)

BSP

  • BSPBSP

  • BSP(binary space-partitioning)

  • P1P1()P1P1ABACP1BDP1

  • P2(b)

(b)


6108118

  • 1024102410


6108118

  • xy,


6108118

Yv

S

A

A2

A1

AS

A1A2

Xv

Zv

  • SA1A2SA1


6108118

6

2

4

1

0

2

3

5

7

0,1,2,3

  • ()0,1,2,3(4,5,6,7)

  • 0,1,2,3,4,5,6,70,1,2,34,5,6,7044


6108118

6

2

4

1

0

2

3

5

7

1

2

3

  • 0,1,2,3

  • 041


6108118

  • ()


6108118

  • xyminymaxyyminymaxyminyymaxyyyxzyz

  • xyuxuyzxy


6108118

(a)

(b)

  • (a)(b)


6108118

phong

  • Ia

  • ()

Warn


6108118


6108118

N

N

N

dA

  • ()

  • NdAcosNNdAcosN

  • kd (kd)0kd1kdkd1kd0I=kdIa


6108118

N

A

Acos

N

L

LN

  • ()()cos()cosIlIl,diff= kd Il cos090(cos01)cos

  • NL()cos=NLIL,diff=kdIl(N.L)


6108118

ka=0.0

kd=

0.0

0.2

0.4

0.6

0.8

1.0

kd01

kakd01

  • kd01

  • kIaIdiff=kaIa+kdIL(N-L)kakd01


Phong

N

N

N

L

R

L

L

R

R

V

ns

ns

ns()

phong

  • R

  • Phongcos090nsns(1)nsns1

  • RLVRVR(=0)


Phong1

L

N

L

N-L

R

phong

  • VRVRcosIspec=ksIc(VR)nsRLNNLLR+L=(2NL)NR=(2NL)N-L

  • W()W()=90W()=1

  • FresnelPhongW()Ispec=W()ILccosnsILR

  • 90ksW()ks01


Phong2

N

H

R

L

V

HLV

phong

  • LVHphongNHphongVRcoscos

    H=(L+V)/(|L+V|)

  • VLHNHVRRN

  • HHVLR(N)/2VLN/2


6108118

  • I=Idiff+Ispec=kaIa+kdIl(NL)+ksIl(NH)ns

  • I=kaIa+Ili[kd(NLi)+ks(NHi)ns](i=1,2,,n)


6108118

Warn

  • Warn

  • WarnPhongPhongWarn(flap)xyz2

  • WarnPHIGS+


6108118

  • (kdRkdGkdB)

    IB=kaBIaB+fi(d)IlBi[kdB(NLi)+ksB(NHi)ns](i=1,2,,n)

    ()

  • RGB(SdRSdGSdB)(SsRSsGSsB)

    IB=kaSdBIaB+fi(d)IlBi[kdSdB(NLi)+ksSsB(NHi)ns](i=1,2,,n)

  • I=kaSdIa+fi(d)Ili[kdSd(NLi)+ksSs(NHi ns](i=1,2,,n)


6108118

  • 1/d2(d)

  • 1/d2d1/d2d()

  • df(d)=1/(a0+a1d+a2d2)a0a1a2a0df(d)

  • 1

    f(d)=min[1,1/(a0+a1d+a2d2)]

  • I=kaIa+f(di)Ili[kd(NLi)+ks(NHi)ns (i=1,2,,n)

    dii


6108118

Gouraud

Phong


6108118

  • ()

  • (interpolated shading)GouraudPhong

  • LNHN()

  • LNHN


Gouraud

Gouraud

  • Gouraud Gouraud()

  • Gouraud

    .

    .

    .

    . ()

  • NV=Ni/|Ni|


Gouraud1

P1

y

A

P

B

P2

P3

x

Gouraud

  • P1P2P3P4(xi,yi)i=1,2,3A(xA,yA),B(xB,yB)P(xA,yB)AB((y=yA=yB)AIAP1,P2I1,I

    IA=[(yA-y2)/(y1-y2)]I1+[(y1-yA)/(y1-y2)]I2

    IB=[(yB-y3)/(y1-y3)]I1+[(y1-yB)/(y1-y3)]I2

    IP=[(xB-x)/(xB-xA)]IA+[(x-xA)/(xA-xB)]IB

  • yy+1IA, IBIA,IBIA,y+1=IA,y+IAIB,y+1=IB,y+IB

    IA=[1/(y1-y2)](I1-I2)IB=[1/(y1-y3)](I1-I3)

    x(P)IPIP

    IP,x+1=IP,x+IPIP=[1/(xB-xA)](IB-IA)


Phong3

Phong

  • GouraudPhong. . .().

  • PhongGouraudPhong()

  • .n(R)()GouraudnnPhong

  • .PhongGouraud


Phong4

Phong

  • NAN1,N

    NA=[(yA-y2)/(y1-y2)]N1+[(y1-yA)/(y1-y2)]N2

    NB=[(yB-y3)/(y1-y3)]N1+[(y1-yB)/(y1-y3)]N2

    NP=[(xB-x)/(xB-xA)]NA+[(x-xA)/(xA-xB)]NB

  • yy+1NA,NBNA,NB

    NA,y+1=NA,y+NANB,y+1=NB,y+NB

    NA=[1/(y1-y2)](N1-N2)

    NB=[1/(y1-y3)](N1-N3)

    x(P)NPNP

    NP,x+1=NP,x+NP

    NP=[1/(xB-xA)](NB-NA)

N1

y

NA

P1

NB

NP

A

P

B

N2

N3

P2

P3

x


6108118

.

.

IAP1P2Z1Z2(Z)Z1Z2y=(y1+y2)/2IA=(I1-I2)/2A(Z1+Z2)/2P

.

PADB P

.

.


6108118

A

B

AAB

N

R

L

V

-N

  • VRVT

T


6108118

  • CSG()


6108118

y

x

z

  • xy

  • ()(Secondary rays)


6108118

S1

R4

T1

R1

S3

R3

S2

T3

S4

R3

R2

S3

R2

R1

T3

S4

T1

S1

R4

S2

b

a

  • ()

  • ()()


6108118

R

L

T

r

N

N

i

H

U

u

T

  • uNRLHV(u)LLKaIa,Kd(NL)Ks(HN)nsRR=u-(2uN)N

  • TuNT=[(i/r)u-(cosr-(i/r)cosi]Nirrcosr=sqrt{[1-(i/r)2](1-cos2i)}


6108118

P

Y

U

P0

r

Pc

X

Z

rPc

  • rP0P|P-Pc|2-r2=0P=P0+su

  • |P0+su-Pc|2-r2=0P=Pc-P,

  • s2-2(uP)s+(|p|2-r2)=0

  • s=up(up)2-|p|2+r2P=P0+su

  • r2<<|P|2|P|2r2s

  • s=up(r2-|P-(up)u|2)

  • PouP0sPP=P0+suP0u

    u=(Ppix-Pprp)/|Ppix-Pprp|

    P0uuRT


6108118

u

N

  • uN0N

  • uN0P=P0+suPNP=-DN=(A,B,C),DN(P+su)=-DPs=-(D+NP)/Nu

  • uN0Ss=up(r2-|P-(up)u|2)

  • s


6108118

  • 95%

  • ()()


6108118

1

  • ()


6108118

N2

u

Pin

N1

Pout

N3

2

  • uPinuNk0

    Nk={(1,0,0),(0,1,0),(0,0,1)}

    uPout,k=Pin+skuskPinPout,k

    Nk Pout,k=-D

  • sk=(-D-NkPin)/(Nku)

    skNk(1,0,0)sk=(xk-x0)/uxu=(ux,uy,uz)xk


6108118

6

1

5

2

0

4

7

3

8

3

  • uk()Pout,kPout,k013425,6,7,82


6108118

  • ()

    • ()

  • 169

9


6108118

  • 4


6108118

16

  • ()16()(xy(-0.5,0.5))(x+x,y+y)(x,y)

16116)16


6108118

f

f

N

R

u

T

RT

  • f1616f

  • R()R16PhongCosnsT


6108118

Lmax

N

Lmin


6108118


6108118

  • 0~1


6108118

y

t

x

s

y

dS

v

u

o

x

z

dA

o

e

  • ()(texel)(s,t)(u,v)(x,y)

  • s,t

o


6108118

-1

  • ()

  • (Diffuse Mapping)100%

  • (Bump Mapping)


6108118

-2

  • (Reflection Mapping)

  • (Opacity Mapping)

  • (Shininess Mapping)

  • (Specularity Mapping)


6108118

-3

  • (Luminosity Mapping)

  • (Refraction Mapping)

  • (Displacement Mapping)

  • ()


6108118


6108118

L

B

A

  • PhongALBALB


6108118


6108118

2

B

1

A

  • 12IABI1I2

    I=(1-Kt1)I1+Kt1 I20 Kt11 Kt1=01

  • I=I1+Kt1 CtI22CtCt=01

  • 1


6108118

N

R

L

rRT

  • ()rrii()r

    Sinr=(i/r)Sini


6108118

P

P()

  • ()rTT=[(i/r)cosi-cosi]N-(i/r)LNLT

  • ktItransIreflkt01I=(1-kt)Irefl+ktItrans(1-kt)

  • kt1kt0(1)ktkt


6108118

  • (Z-buffer)

  • A-buffer


  • Login