高級(jí)計(jì)算機(jī)圖形學(xué)ACG_第1頁(yè)
高級(jí)計(jì)算機(jī)圖形學(xué)ACG_第2頁(yè)
高級(jí)計(jì)算機(jī)圖形學(xué)ACG_第3頁(yè)
高級(jí)計(jì)算機(jī)圖形學(xué)ACG_第4頁(yè)
高級(jí)計(jì)算機(jī)圖形學(xué)ACG_第5頁(yè)
已閱讀5頁(yè),還剩95頁(yè)未讀 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說(shuō)明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)

文檔簡(jiǎn)介

Spheremapping

alightprobe

http:〃/HDRShop/tutorial/tutorial5.html

Frameofreference

?Accessthespheremap&hyhz0、

U

"xy"z°

fXfyfy0

(0001,

?Transformthesurfacenormalnandvectorefromthe

currenteyepositionusingthismatrix

?nand/inthespheremap5space

r-ey-2(〃

Spheremapping

n/

(QA1)t

rhy/h\toeye加="+-;+(「+1)2

G「+1)

n——,—,---

、mmm

^rigin_________________________y

Spheremapping

?Ifthesphereisatoriginanditsradiusis1

-theunitnormal'scoordinates=the

locationh

-Noneedforhz

?也,4)describeapointonasphere

image,intherange[-1,1].

?Mapthecoordinateto[0,1]

u=-^-+0.5;v=—^-+0.5

2m2m

Spheremapping

?SpheremappingisanimprovementoverBlinnand

NewelPsmethodinanumberofways

-Notextureseamtointerpolateacross

-canbeimplementedonanygraphicshardwarethatsupports

texturemapping

?DisadvantagestotheSpheremapping

-movingbetweentwopointsonthespheremapisnotlinear

-Sphereisvalidforonlyasingleviewdirection.

Paraboloidmapping

?Paraboloidmapping

-ByHeidrichandSeidel

-usingtwoenvironmenttextures

-Eachparaboloidcreatesacirculartexture

similartoaspheremap

?coveranenvironmenthemisphere

Dualparaboloidapproach

Parabolicbasis

Requirestwotextureimages

DualParaboloidMap

Whichofthetwotexturetoaccess?

Signoftherz

Paraboloidmapping

?Paraboloidmapping

-Hardwareshouldsupport

?properprojectivetexturecoordinatetransformation

yA

?interpolation011fX

0111ry

u=——-----F0.5;v=-----------b0.500001

2(1+h2(1+c)

<0022八'z/

?Themaindrawbackofparaboloidmapping

-makingthemapsthemselvesisdifficult

?bywarpingimages

?byusingraytracing

LightingUsingEnvironmentMapping

?Animportantuseofenvironmentmappingtechniquesis

generatingspecularreflectionsandrefractions.

?Environmentsmappingcansolvethehighlightingbyrepresenting

thelightsinthetexture.

Per-pixelspecularLightingusingEnvironmentmappingof

highlightenvironmentmappingentiresurroundingscene

Recursivereflections

?Recursivereflectionsdonewithenvironmentmapping

StumblingblockofEM

?Flatsurfaceusuallydonotworkwell

-raysreflectedoffofitusuallydonotvarybymorethanafew

degrees

-SmallpartofEMtexture'sbeingmappedontoarelativelylarge

surface

-Asmallpartoftextureismagnified

Diffuse,GlossandReflectionMapping

?TousereflectionmappingwithGlossandDiffuse

colortexturing

?TheLightingmodel

o=t1

diff?diff+gloss「spec

RGBtextureMonochrome

glosstexture

Pearexample

Multi-textureexample

RGBdiffuseRGBreflection

texturemaptexture

?Thelightingmodelcanbe

computedusingtwotexture

「specstages

-2RGBcolorinputs

-upto2alphainputs

RGBRGB

StageI"Stage2v?Stage1

diffuselightARGB-Theinterpolateddiffusecolor

'diff------reflectionmap

Xtextureresult

RGBRGBXglossandthepearskin'sRGB

+diffuseRGBtexturearethetwocolorinputs

retrievegloss

alphataffXidiff

alpha-Glossmaptexurevalueinthe

alphachannel

?Stage2:

lglossspecXtgios.

singlechannelo=diff區(qū)'diff+'gloss丫spec

glossmap

Bumpmapping

?Bumpmapping

-byBlinnin1978

-Inexpensivewayofsimulatingwrinklesandbumpsongeometry

?Tooexpensivetomodelgeometrically

-letatexturemodifythenormalateachpixel

?usethisnormaltocomputelighting

7/7/

Bumpmappedgeometr

Height-fieldbumpimageanditsuseonasphere

OffsetmapHeight-fieldmap

?Normalvectorn

-modifiedintheuandvdirections

-bythebufbvvaluestakenfromthebumptexture

Offsetvectorbumpmap

?Offsetmap

-Storesinatexturetwosigned

values,bandb,ateach

uv

point

-Correspondtotheamountto

varythenormalalongtheu

andvimageaxes

-Usedtoscaletwovectors

thatareperpendiculartothe

normal

Height-fieldbumpmap

?Height-fieldbumpmap

Eachmonochrometexture

valuerepresentasurface

height

?whitetoahigharea

?blacktoalowone

Theheightfieldisusedto

deriveuandvsignedvalues

?Thedifferencesbetween

neighboringcolumnstogetthe

slopesforuandbetween

neighboringrowsforv

ArtifactofusingBumpmap

?Bumpmapping

-Per-pixelbumpmappingisextremelyconvincing

-offersaninexpensivewaytoaddtheeffectofgeometricdetail

?Artifact

-Atthesilhouettesaroundtheobjects,norealbump,justsmooth

outlines

-Thebumpsdonotcastshadowsontotheownsurface

EmbossBumpMapping

?Embossing

-Oneofthefirstmethodsusedforrealtimebumpmapping

-employsatechniqueborrowedfromtwodimensionalimage

processing

EmbossBumpMapping

Steps

?Renderthesurfacewiththeheightfield

-adiffusemonochrometexture

?Shiftallthevertex(u,v)coordinatesinthedirectionofthe

light

?Renderthissurfacewiththeheightfieldagainappliedasa

diffusestexture,subtractionfromthefirstpassresult

?Renderthesurfaceagainwithnoheightfield,diffusedly

illuminatedandGouraudshaded.Addthisshadedimage

totheresult

DiffuseLightingCalculation

C=(£??/)XDzXDm

-Lislightvector

-Nisnormalvector

-Dzislightdiffusecolor

-Dmismaterialdiffusecolor

-BumpmappingchangesNperpixel

-Embossbumpmappingapproximates(L,N)

ApproximatediffusefactorL?N

?Texturemaprepresentheightfield

-(Fd+m)approximates(L?N)perpixel

-Firstderivativerepresentsslopem

-mincreases/decreasesbasediffusefactorFd

Approximatederivative

?Embossingapproximatesderivative

-LookupheightHoatpoint(u,v)

-LookupheightH1atpointslightlyperturbedtowardlight

source(u+Au,v+Av)

-subtractoriginalheightHofromperturbedheightH1

-differencerepresentsinstantaneousslopem-HrHg

ComputetheBump

OriginalbumpOriginalbump(Ho)overlaid

(HQwithsecondbump("Jperturbed

towardlightsource

brightensimage

darkensimage

Subtractoriginalbump

fromsecond(H/-H。)

Coordinatesystematavertex

?n

-Retrievetheshadingnormalnatthevertex

?t

-Findsurfacevectortthatfollowsoneofthetwotexture

coordinateaxesuorv

-tisperpendiculartonandtangenttothesurface

?b

-thebinormal

-ismutuallyperpendiculartonandtandrunsinthedirection

oftheothertexturecoordinateaxis

Ztytz0、

久久b二0

&a生0

10001/

(%v)£soffset

ThelightdirectionIistransformed

Thelightdirectioniscastuponthetriangle'splanebysetting/.ztozero

Theresultingvectorisscaledandaddedtothevertex5stexturecoordinates

EmbossBumpMapping

?TransformthelightdirectionI

-Lightvectorsistheninthevertex5stangentspace

n

LimitationstoEmbossBumpMapping

?Appliesonlytodiffusesurface

-Specularhighlightsarenotpossible.

?Whenthelightisdirectlyoverasurface,nooffsetoccurs

-thebumpsdisappearentirely

?Thebasicembossingalgorithmdoesnothandlebumps

thatfaceawayfromthelightonsurfacesthatare

illuminated

DotProductBumpMapping

?Dot3bumpmapping

一Primarymethodofperformingbumpmappingonmodern

graphicshardware

-Theactualnormalsforthesurfacearestoredas(x,y,z)

vectorsinthenormalmaps

-The8-bitsvaluesaremappedto[-1,1]

-Tocomputetheeffectofalightsource,thepositionallight

source'slocationistransformedtothesurface'stangent

spacebasisateachvertex

Normalmap

Diffuseandspecularbumpmapping

EnvironmentMapBumpMapping(EMBM)

?EMBM

-Perturb(u,v)environmentmappingcoordinatesbyuandv

differentialsfoundinthebumptexture

-IntroducedwithDirectX6

-Allowonlyasingleplanarenvironmentmaptobedefined

?somethinglikedefiningacubemapwithonlyoneface.

-auserdefined2X2matrixisappliedinordertorotateandscale

thedifferentialsbeforetheyareadded.

-Thismatrixcontrolstheperceivedbumpinessofthemap

EnvironmentMapBumpMapping(EMBM)

bumpmapaccesswhichisandthenaddedtothe

Bumpmappingofenvironmentmap

Bumpmappingofenvironmentmap

CombineNormalmappingandcubicenvironment

mapping

w

d

d

cEc

d

E

n

m

/support/vpwebsamples2.shtml

Displacementmap

?Displacementmap

-Modifygeometry

BumpmapDisplacementmap

Displacementmap

Theheightfieldontheleftisusedtodisplacetheverticesofamesh

VisualAppearance

Lightmakesright.

AndrewGlassner

Introduction

?Imagerenderingofthreedimensionalmodels

-Lookcorrectgeometrically

-Havearealisticvisualappearance

-Withcombinationoftechniques

?Associatingamaterialwitheachsurface

?Applyingvariouskindsofliahtsources

?Addingtextures

?Usingfog

?Transparency

?Antialiasingtechniques

Outline

Light

Material

Antialiasing

Fog

Gammacorrection

Transparency

LightSources

-photonsbounceoffthesurfaceofobjectandreachtheeyesof

theviewer

?Lightsources

-Directionallights

-Pointlights

-Spotlights

?Directionallights:positionedessentiallyinfinitelyfarawayfrom

theobjectsthatarebeinglit

-Sun

n

?Positionallight(Pointlightandspotlight)

一Singlepointthatemitsphotons

?Lightparameters

Intensityandcolor

-

Squaresubdividedinto100X100X2triangleislitby

AdirectionallightsourceApointlightsourceAspotlight

?Lightintensityandcolor

-ambient,diffuse,specularintensity

?Lightsourceparameters

NotationDescription

SambAmbientintensitycolor

$diffDiffuseintensitycolor

Q

2specSpecularintensitycolor

Q

2PosLightSourceposition

Spotlight.Sdir,Scut>Sexp

SpotLight

Lightattenuation

?Lightdropoffwiththedistance

?Intheareaofrealtimerendering,lightdonotdropoff

withdistance

-Easiertocontrol

?Noneedtoworryabouttheeffectofdistance

?Effectsmaybecomputedmorequickly

Lightattenuation

Lanp=Spot

ReoderTine=15Sec

SpotBi=.150

Light-sourceSpotSi=80

iera

<-helper-lamp

http://www.ru.is/kennarar/hannes/useful/BlenderManual/htmll/ch28sO2.html

Light

MaterialMaterial

Fog

Gammacorrection

Transparency

?Materialconsistsofanumberofparameters

-ambient,diffuse,specular,shininessandemissive

?Thecolorofsurfaceisdeterminedby

-Materialparameters

-Lightsourcesparameters

-Lightmodel

Tableofmaterialparameters

NotationDescription

^ambAmbientmaterialcolor

m防Diffusematerialcolor

m$pecSpecularmaterialcolor

^shiShininessparameter

m

111ermEissmivematerialcolor

LightingandShading

?Lighting

-Designatetheinteractionbetweenmaterialandlightsources

-Interactionwiththegeometryoftheobjecttoberendered

?Shading

-Performinglightingcomputations

-Determinepixelscolors

FlatGouraudPhong

Perpolygonpervertexperpixel

LightingandShading

?FlatShading

-Coloriscomputedforatriangleandthetriangleisfilledwiththe

color

?GouraudShading

一lightateachvertexisdetermined,andlightsamplesare

interpolatedoverthesurface

?PhongShading

一shadingnormalsstoredattheverticesareusedtointerpolate

theshadingnormalateachpixelinthetriangle

LightingandShading

FlatShadingGouraudShadingPhongShading

?FlatShading:

-Fastandsimpletoimplement

-Doesnotgiveasmoothlooktocurvedsurface

?GouraudShading:

-Speedandimprovedquality

-dependentonthelevelofdetailofobjectsthatarerendered

GouraudShading

256102416384triangles

GouraudShading

?GouraudShading

-Missinghighlight

-Failuretocapturespotlighteffects

?Usingtexturetorepresenteffects

Phongshading

GouraudShading

?Gouraudshadingcanachieveessentiallythesameshading

resultasPhongshading

-subdividingasurfaceintotrianglessmallerthanapixel

-Slowinpractice

-Rarelyusedinrealtimesystems

?LightingModel:ambient,diffuse,specular

ambientdiffusespecular

DiffuseComponent

?Lambert'sLaw

-Ideallydiffusereflectlightdeterminedbysurfacenormalnandlight

vectorI

DiffuseComponent

?Viewindependent

?Tomakeuseofdiffusecoloroflightsourceanddiffusecolor

ofmaterial

idiff=Wmdiff?sdifr?

血),-R

idiff=max((?sdiffJ

s的=(1.0,1.0,1.0)m助=(1.0,0.0,0.0)

mdiffsdiff(1.0,0.0,0.0)

SpecularComponent

?Makeobjectlookshinybycreatinghighlights

-Surfacecurvature

-Directionandlocationoflightsource

WithouthighlightWithhighlights

SpecularLighting

i-(rDr)"""二(cosp)”而

Reflectionvectorr

r=2(n?l)n—I

r=2(n-l)n-l

n-l

2(n4)n

LightFormulaofOpenGLandDirectX

以"(〃“產(chǎn)”二(cos8產(chǎn),

h—'+'(rQ^)m-s,/7/p(〃必)4"無(wú)

Z+v

LightFormulaofOpenGLandDirectX

?Withspecularcoloroflightsourceandmaterial

區(qū))

ispec—'(〃?),"""mspecsspec

?Iftheanglebetweennandhgreaterthan90°,thespecular

contributionis0

〃〃)加

Lsnpe”c=max\((%)""90js5pe"c0spec

o8

?

s.o6

gu?

Ic

J

Eo4

W?

O

U

d

so2

?

0

-n/2-K/40K/4兀/2

angle

Asthe/77s/7/increases,thecurveispulledin,makingforatighter

highlightandashinierimpression

ArtifactsinPhongshading

GouraudShadingGouraudShadingPhongshading

LittletessellationHightessellationPer-pixelShading

Otherspecularhighlightfunctions

?Schlick5sapproximation

t-cosp

spec-~~~^spec兇spec

mshi-tmshi+t

Simplefunctions

?)卯比

specmax(nh,0—

?Tisthresholdvalue

-max(c力,0)>T,1;

-Otherwise,0.

?Taffectstheapparentsizeofthelightbeingreflected

AmbientComponent

?Lightemanatingfromsourcemightbounceoffwall

andthenreachobject

?Notaccountedbydiffuseorspecularcomponent

dmb=marnb⑤

LightingEquation

?Locallightingmodel

Kot-1amb+Idiff+'spec

ambientdiffusespecularresult

LightingEquation

?Lightintensityintherealworldisinverselyproportionaltothe

squareofthedistancefromthelightsource

?Diffuseandspecularcomponentsareaffected

+3/SpLP+%Sp°s-p

Lightingattenuation

i.=a,?mh+m.+\ik+dk\ik+ik)I

totglobhambemiN」spott\amb}\drifffspecJI

k=l

=aglob?marnb+merni

?k

5expk

+£max(—〃Dy*,0)(mamb?samb

后二1

?max((疝%),0)加的九學(xué)療+max((〃*),0產(chǎn)'加印用二

kk

s:+s;spos-p+s:spos-p

AliasingandAntialiasing

Musing

Sampling&filteringprocess

Pixels

Texture

Time

Samplingandreconstruction

?Sampling:

-fromcontinuoussignaltodiscrete

?Reconstructionrecoverstheoriginalsignal

-Caremustbetakentoavoidaliasing

?Nyquisttheorem

一thesamplingfrequencyshouldbeatleast2timesthemax

frequencyinthesignal

Samplingtheorem

?Nyquisttheorem

-thesamplingfrequencyshouldbeatleast2timesthemax

frequencyinthesignal

1cmTP]1sampleperrevolution

0GAlittlemorethan1sample/revolution

2samplesperrevolution

>2samplesperrevolution

OGG。。

Reconstruction

?Assumewehaveabandlimitedsignal(e.g.,atexture)

?Usefiltersforreconstruction

0---1---1---1_b

-101

Reconstructionwithboxfilter

Reconstructionwithtentfilter

32x32

texture

Reconstructionwithsinefilter

?Intheory,theidealfiltersin(zix)

?Notpracticalsinc(x)=

7DC

Resampling

?Enlargingordiminishingsignals

?Assumesamplesareatunit-intervals,i.e.,

?Resamplesothattheyareaapart

-a<1givesmagnification

-a>\givesminification

Magnification

?Halfsampledistance

Minification

?Doublethedistancebetweensamples

Screen-basedAntialiasing

?Supersampling

?usemorethanonesampleperpixel

Formulaandexamplesofdifferentschemes

n

p(x/)=Zw,c(Qxj)

i=l

?wzaretheweightsin[0,1]

?c(zj,y)isthecolorofsampleiinsidepixel

2x2RGSS

1sample4x4checker

1x2sample8rooks

溫馨提示

  • 1. 本站所有資源如無(wú)特殊說(shuō)明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁(yè)內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒(méi)有圖紙預(yù)覽就沒(méi)有圖紙。
  • 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
  • 5. 人人文庫(kù)網(wǎng)僅提供信息存儲(chǔ)空間,僅對(duì)用戶上傳內(nèi)容的表現(xiàn)方式做保護(hù)處理,對(duì)用戶上傳分享的文檔內(nèi)容本身不做任何修改或編輯,并不能對(duì)任何下載內(nèi)容負(fù)責(zé)。
  • 6. 下載文件中如有侵權(quán)或不適當(dāng)內(nèi)容,請(qǐng)與我們聯(lián)系,我們立即糾正。
  • 7. 本站不保證下載資源的準(zhǔn)確性、安全性和完整性, 同時(shí)也不承擔(dān)用戶因使用這些下載資源對(duì)自己和他人造成任何形式的傷害或損失。

評(píng)論

0/150

提交評(píng)論