sig graph 06
DESCRIPTION
DescTRANSCRIPT
-
SinglepassWireframeRenderingwithHiddenSurfaceRemoval
AndreasBrentzen,SteenLundNielsen,MikkelGjl,BentD.LarsenandNielsJrgenChristensen
-
Overview
Whatiswrongwiththetraditionaloffsetbasedmethodsforwireframedrawing?
Asinglepassmethodforwireframedrawingwithhiddensurfaceremoval.
Drawingprefilteredlines. Results Discussionandfuturework.
-
OffsetBasedMethods
Offsetbasedmethodshavetwopasses: Pass1:Drawmeshasfilledpolygons.
Zwriteandcomparisonenabled.
Pass2:DrawmeshaswireframewithZoffset.Zwritedisabled.Zcomparisonenabled.
Offsetensuresfilledpolygonsdonotoccludewireframe.
-
OffsetBasedMethods
Twotriangleswiththeiredgesdrawnusingnooffset,slopebasedoffset,constantoffset.
-
OffsetBasedMethods
uselinedrawingwhichisslow. areinherentlytwopass(evenslower) requireantialiasingtolookgood(slowerstill) haveartifactsbecauseitisimpossibletopickaperfectoffsetin
mostcases.
Admittedly,wecanlivewiththesemethods,butwedon'thaveto!
-
Approaches
Edgeisdrawnonlyifthepixelalreadycontainsafragmentfromthecorrespondingfilledpolygon.E.g.[Herreletal.1995].
Ourmethod:Drawwireframedirectlyasyouaredrawingfilledpolygon.Allinonepass.
-
SinglePassMethod
Foreachfragment,computecolorfromdistancetoclosestedge:
-
ComputingDistance
Weneed2Dwindowspacedistance. In2D,distancetolineisanaffinefunction. Linearinterpolationreproducesaffinefunctions.
-
ComputingDistances
Pervertex: Input:Allverticesof
triangle. Vertexshaderprojectsall
verticesoftriangle. Distancestoalledgesare
computed. Output:vectorofdistances
toallthreeedges.
-
ComputingDistances
Perfragment: Interpolatedistances.
Computecolorusingpreviousfragmentprogram.
Note:Thismethodextendstoquads.
-
PerspectiveCorrection
Oops!Graphicscardsperformperspectivecorrectinterpolation
However,itiseasytofix: Negateperspectivecorrection. WaitforD3D10orOpenGL3.0hardware.
-
Teapotusingourmethod...sofar.
-
Preintegratedlines
Colorisnowafunctionofdistance:
-
Teapotusingourmethod
-
SinglepassMethod
Detailofteapot Noticesmoothlines Perhapslinesarealittle
thick?
-
SinglepassMethod
Thinnerlinesareeasy. However,wetrade
thinnessforalittlealiasing.
-
Offsetbasedmethod
Constoffset=2000 Noticestippling Offsetcouldbechanged
butthereisnoperfectvalue
-
Offsetbasedmethod
Slopebasedoffset Noticedisocclusion
artefacts
-
Usedepthtofadeoutlinecolor.
-
Usedepthtodecidelinethickness.
Usealphatestingtoremoveinteriorofpolygon.
-
IndexedPrimitives
UsingthegeometryshadersofD3D10allowsustodrawwireframetrianglestrips.
-
LineStyles
-
Results
Performance
-
Themethoddoesnotsupportindexedgeometry Primitive/geometryshadersalleviatethis! Silhouetteedgesdrawnfromonesideonly Onlynoticeableonsmallmeshes Thisisessentiallyamethodfortrianglesand
quadrilaterals yesbutthatisaverycommonspecialcase
Issues
-
Merits
Methodisfast Singlepass Avoidslineprimitive Littleperfragmentcomputation
Highqualitylines Prefiltered NoZissues
Tweakable Manylinestylesarepossible
-
Thisisafutureworkteaser. Acknowledgements:
MarkHarris,NVIDIA,andPeterPikeSloan,Microsoft,wereveryhelpful.
MicrosoftmadeitpossibletotestthemethodonD3D10viaaWindowsVistaBeta.
-
Linetypes
4x4supersampling
Ourmethod PrefilteringwithGaussian