From-ShaderX-2-–-Shader-Programming-Tips-and-Trick.docx
《From-ShaderX-2-–-Shader-Programming-Tips-and-Trick.docx》由会员分享,可在线阅读,更多相关《From-ShaderX-2-–-Shader-Programming-Tips-and-Trick.docx(29页珍藏版)》请在第壹文秘上搜索。
1、AdvancedImageProcessingwithDirectX9PixelShadersJasonL.Mitchell,MarwanY.AnsariandEvanHart3DApplicationResearchGroupATIResearchIntroductionWiththeintroductionoftheps_2_0pixelshadermodelinDirectX9.0,weareabletosignificantlyexpandourabilitytouseconsumergraphicshardwaretoperformimageprocessingoperations.
2、Thisisduetothelongerprogramlength,theabilitytosamplemoretimesfromtheinputimage(s)andtheadditionoffloatingpointinternaldatarepresentation.InthefirstShaderXbook,weusedtheps_l_4pixelshadermodelinDirectX8.1toperformbasicimageprocessingtechniquessuchassimpleblurs,edgedetection,transferfunctionsandmorphol
3、ogicaloperatorsMitchell02.Inthischapter,wewillextendourimageprocessingtoolboxtoincludecolorspaceconversion,abetteredgedetectionfiltercalledtheCannyfilter,separableGaussianandmedianfilters,andareal-timeimplementationoftheFastFourierTransform.ReviewAsshowninouroriginalimageprocessingchapterinthefirstS
4、haderXbook,post-processingof3Dframesisfundamentaltoproducingavarietyofinterestingeffectsingamescenes.ImageprocessingisperformedonaGPUbyusingthesourceimageasatextureanddrawingascreen-alignedquadrilateralintothebackbufferoranothertexture.Apixelshaderisusedtoprocesstheinputimagetoproducethedesiredresul
5、tintherendertarget.Figure 1 - Using a pixel shader for image processing by rendering from one image to anotherOutputImageImageprocessingisespeciallypowerfulwhenthecolorofthedestinationpixelistheresultofcomputationsdoneonmultiplepixelsfromthesourceimage.Inthiscase,wesamplethesourceimagemultipletimesa
6、ndusethepixelshadertocombinethedatafromthemultiplesamples(ortaps)toproduceasingleoutput.ColorSpaceConversionBeforewegetintointerestingmulti-tapfilters,we,llpresentapairofshaderswhichcanbeusedtoconvertbetweenHSVandRGBcolorspaces.Theseshadersperformsomerelativelycomplexoperationstoconvertbetweencolors
7、paceseventhoughtheyareonlysingle-tapfilters.ForthosewhomaynotbefamiliarwithHSVspace,itisacolorspacewhichisdesignedtobeintuitivetoartistswhothinkofacolorstint,shadeandtoneSmith78.InterpolationinthiscolorspacecanbemoreaestheticallypleasingthaninterpolationinRGBspace.Additionally,whencomparingcolors,it
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- From ShaderX Shader Programming Tips and Trick

链接地址:https://www.1wenmi.com/doc/865204.html