Jump to content

Filtering mai kalakala

Daga Wikipedia, Insakulofidiya ta kyauta.
Filtering mai kalakala
computer graphics term (en) Fassara

A cikin zane-zane na kwamfuta, gurin tacewar rubutu ko sassaukar rubutu ita ce hanyar da ake amfani da ita don tantance launi na rubutu don taswira pixel, ta amfani da launukan texels na kusa (watau pixels na rubutu).

filtering wani gurin ne a komfuta da yake Tace yana bayyana yadda ake amfani da rubutu a sifofi, girma, kusurwoyi da ma'auni daban-daban. Dangane da zaɓin algorithm tace, sakamakon zai nuna mabanbantan digiri na blurriness, daki-daki, aliasing sararin samaniya, ɓata lokaci da toshewa. Dangane da yanayin, ana iya yin tacewa a cikin software (kamar fakitin samar da software) ko cikin kayan masarufi, misali. tare da ko dai ainihin lokacin ko GPU haɓakar da'irori, ko a cikin cakuɗen duka biyun. Don galibin aikace-aikacen hoto na gama-gari, tacewar rubutu na zamani ana yin ta ne ta hanyar kayan aikin sadaukarwa wanda ke haɓaka damar ƙwaƙwalwar ajiya ta hanyar cacheing memory da pre-debo, kuma yana aiwatar da zaɓi na algorithms samuwa ga mai amfani da mai haɓakawa.

Akwai manyan nau'ikan tacewa guda biyu: tacewa girma da tacewa. [1] Dangane da halin da ake ciki, tacewar rubutu shine ko dai nau'in tacewa na sake ginawa inda aka haɗa bayanai da yawa don cike giɓi (girma), ko kuma nau'in anti-aliasing (AA) inda samfuran rubutu ke kasancewa a mitar mafi girma fiye da yadda ake buƙata don mitar samfurin. da ake buƙata don cika rubutu (minification).

Akwai hanyoyi da yawa na tace rubutu, waɗanda ke yin ciniki daban-daban tsakanin rikitarwa na lissafi, bandwidth ƙwaƙwalwar ajiya da ingancin hoto.

Bukatar tacewa

[gyara sashe | gyara masomin]

Yayin aiwatar da taswirar rubutu don kowane yanayi na 3D na sabani, atexture lookup yana faruwa don gano inda akan rubutun kowace cibiyar pixel ta faɗi. Don shimfidar polygonal da aka yi taswirar rubutu wanda ya ƙunshi alwatika na yau da kullun na yawancin filaye a cikin wasannin 3D da fina-finai, kowane pixel (ko samfurin pixel na ƙasa ) na wancan saman za a haɗa shi da wasu alwatika (s) da saitin daidaitawar barycentric, waɗanda ake amfani da su don samar da matsayi a cikin rubutu. Irin wannan matsayi bazai kwanta daidai akan "grid pixel ba," yana buƙatar wasu ayyuka don lissafin waɗannan lokuta. A wasu kalmomi, tunda saman da aka ƙera yana iya kasancewa a nesa da ba daidai ba da kuma daidaitawa dangane da mai kallo, pixel ɗaya ba ya saba daidai da texel ɗaya kai tsaye. Dole ne a yi amfani da wani nau'i na tacewa don tantance mafi kyawun launi don pixel. Rashin isasshe ko kuskuren tacewa zai bayyana a cikin hoton azaman kayan tarihi (kurakurai a cikin hoton), kamar 'toshewa', jaggies, ko shummering.

Za a iya samun nau'ikan wasiƙu daban-daban tsakanin pixel da texel/texels da yake wakilta akan allon. Wadannan sun dogara ne akan matsayi na rubutun da aka rubuta dangane da mai kallo, kuma ana buƙatar nau'i daban-daban na tacewa a kowane hali. Idan aka ba da rubutun murabba'i da aka yi taswira akan farfajiyar murabba'i a cikin duniya, a wasu nisan kallo girman pixel allo ɗaya daidai yake da texel ɗaya. Kusa da wancan, texels sun fi pixels girma, kuma suna buƙatar haɓakawa yadda ya kamata - tsarin da aka sani da haɓaka rubutu . Nisa daga nesa, kowane texel ya yi ƙasa da pixel, don haka pixel ɗaya ya rufe texels da yawa. A wannan yanayin dole ne a ɗauki launi mai dacewa bisa ga rufaffiyar texels, ta hanyar rage rubutu . API ɗin zane-zane irin su OpenGL suna ƙyale mai tsara shirye-shirye don saita zaɓuɓɓuka daban-daban don ragewa da matattarar haɓakawa. [1]

Lura cewa ko da a yanayin da pixels da texels suke daidai girman girman, pixel ɗaya ba lallai bane yayi daidai daidai da texel ɗaya. Yana iya zama ba daidai ba ko jujjuya shi, kuma yana rufe sassan har zuwa texels makwabta hudu. Don haka har yanzu ana buƙatar wani nau'i na tacewa.

Mipmapping daidaitaccen dabara ce da ake amfani da ita don adana wasu ayyukan tacewa da ake buƙata yayin rage rubutu. [2] Hakanan yana da fa'ida sosai don daidaitawar cache - ba tare da shi ba tsarin samun damar ƙwaƙwalwar ajiya yayin yin samfuri daga sassauƙa mai nisa zai nuna ƙaƙƙarfan wuri mara kyau, yana da illa ga aiki ko da ba a yi tacewa ba.

A lokacin haɓaka rubutu, adadin texels waɗanda ke buƙatar duba sama don kowane pixel koyaushe shine huɗu ko ƙasa da haka; yayin da ake ragewa, duk da haka, yayin da polygon da aka zayyana ya yi nisa da nisa wanda zai iya faɗuwa gabaɗayan rubutun zuwa pixel ɗaya. Wannan zai buƙaci karanta duk texels ɗin sa da kuma haɗa ƙimar su daidai don tantance launi pixel, aiki mai tsadar gaske. Mipmapping yana guje wa wannan ta hanyar tace rubutun da adana shi cikin ƙananan girma zuwa pixel guda. Yayin da saman da aka zayyana ya yi nisa, rubutun da ake amfani da shi yana canzawa zuwa ƙaramin girman da aka riga aka tace. Girma daban-daban na mipmap ana kiransa 'matakai', tare da matakin 0 shine mafi girman girma (amfani da mafi kusa da mai kallo), da haɓaka matakan da ake amfani da su a haɓaka nesa.

Hanyoyin tacewa

[gyara sashe | gyara masomin]

Wannan sashe yana jera hanyoyin tace rubutu da aka fi amfani da su, a cikin ƙarin tsari na ƙididdiga da ingancin hoto.

Maƙwabcin makwabci mafi kusa

[gyara sashe | gyara masomin]

Matsakaicin makwabci mafi kusa shine hanya mafi sauƙi kuma mafi kyawun tacewa — kawai yana amfani da launi na texel mafi kusa da cibiyar pixel don launin pixel. Duk da yake mai sauƙi, wannan yana haifar da adadi mai yawa na kayan tarihi - rubutun 'blockiness' yayin haɓakawa, [3] da aliasing da shimmering yayin ƙaddamarwa. [4] Wannan hanyar tana da sauri yayin haɓakawa amma yayin haɓaka haɓaka ta hanyar ƙwaƙwalwar ajiya yana zama babba ba bisa ka'ida ba kuma sau da yawa yana iya zama ƙasa da inganci fiye da taswirar taswirar MIP saboda rashin samun madaidaicin damar rubutu da sake amfani da layukan cache. [5]

Makwabci mafi kusa tare da mipmapping

[gyara sashe | gyara masomin]

Wannan hanyar har yanzu tana amfani da maƙwabcin maƙwabta mafi kusa, amma tana ƙara yin taswira — da farko za a zaɓi matakin mipmap mafi kusa gwargwadon nisa, sannan a zana cibiyar texel mafi kusa don samun launin pixel. Wannan yana rage aliasing da shimmering sosai yayin ragewa amma baya kawar da shi gaba ɗaya. Yin haka yana haɓaka damar ƙwaƙwalwar rubutu da sake amfani da cache-line ta hanyar guje wa manyan hanyoyin samun dama ta hanyar ƙwaƙwalwar rubutu yayin rasterization. Wannan baya taimakawa tare da toshewa yayin haɓakawa kamar yadda kowane girman texel zai kasance har yanzu yana bayyana azaman babban rectangle.

Mipmap tace

[gyara sashe | gyara masomin]

Kadan da aka saba amfani da shi, OpenGL da sauran APIs suna goyan bayan samfurin maƙwabci mafi kusa daga kowane mipmaps yayin da ke tsaka da tsaka-tsakin mipmaps biyu mafi kusa da suka dace da samfurin.

Tace bilinear

[gyara sashe | gyara masomin]

A cikin tacewa Bilinear, ana zana nau'ikan texels huɗu mafi kusa da cibiyar pixel (a matakin mipmap mafi kusa), kuma ana haɗa launukansu ta matsakaicin nauyi gwargwadon nisa. [6] Wannan yana kawar da 'toshewar' da ake gani yayin haɓakawa, saboda a yanzu ana samun sassaucin launi na canjin launi daga texel ɗaya zuwa na gaba, maimakon tsalle-tsalle yayin da cibiyar pixel ke ketare iyakar texel. [7] Tace bilinear don tacewa girma ya zama gama gari. Lokacin da aka yi amfani da shi don ragewa ana amfani da shi tare da mipmapping; ko da yake ana iya amfani da shi ba tare da shi ba, zai sha wahala iri ɗaya da matsaloli masu ƙyalli kamar tace maƙwabci mafi kusa idan an rage shi da yawa. Don madaidaicin ma'aunin ƙima, duk da haka, ana iya amfani da shi azaman babban samfuri mai saurin nauyi na kayan aiki mara tsada.

Nintendo 64 ya yi amfani da wani sabon salo na tacewa bilinear inda ake amfani da pixels uku kawai da aka sani da tace rubutu mai ma'ana 3, maimakon hudu saboda matsalolin inganta kayan aiki. Wannan yana gabatar da sanannen "ƙananan triangulation" a wasu sassa. [8]

Tace trilinear

[gyara sashe | gyara masomin]

Tace Trilinear magani ce ga kayan tarihi na gama gari da ake gani a cikin faifan gyare-gyaren gyare-gyaren bilinearly: canji mai saurin gaske da inganci a iyakoki inda mai yin jujjuyawa daga matakin mipmap zuwa na gaba. Tace mai Trilinear yana warware wannan ta hanyar yin duban rubutu da tace bilinear akan matakan mipmap biyu mafi kusa (ɗaya mafi girma da ƙanƙanta ɗaya), sannan kuma yana daidaita sakamakon a layi . [9] Wannan yana haifar da lalatar ingancin rubutu mai santsi yayin da nisa daga mai kallo ke ƙaruwa, maimakon jerin faɗuwar kwatsam. Tabbas, kusa da Level 0 akwai matakin mipmap ɗaya kawai akwai, kuma algorithm ɗin yana komawa zuwa tace bilinear.

Anisotropic tacewa

[gyara sashe | gyara masomin]

Anisotropic tacewa shine mafi girman ingancin tacewa da ake samu a cikin katunan zane na 3D masu amfani na yanzu. Mafi sauƙi, fasahohin "isotropic" suna amfani da mipmaps murabba'i kawai waɗanda aka haɗa su ta amfani da tace bi- ko trilinear. ( Isotropic yana nufin iri ɗaya a duk kwatance, don haka ana amfani da shi don bayyana tsarin da duk taswirorin ke da murabba'i maimakon murabba'i ko wasu ɓangarorin huɗu.)

Lokacin da saman ya kasance a babban kusurwa dangane da kyamara, wurin cikawa don rubutu ba zai zama kusan murabba'i ba. Yi la'akari da al'amarin gama gari na bene a cikin wasa: wurin cikawa ya fi tsayi nesa. A wannan yanayin, babu ɗayan taswirar murabba'in da ke da kyau. Sakamakon shine blurriness da/ko shimmering, dangane da yadda aka zaɓi dacewa. Anisotropic tacewa yana gyara wannan ta hanyar yin samfurin rubutu azaman sifar maras murabba'i. Manufar ita ce a samar da nau'in rubutu don dacewa da sawun pixel kamar yadda aka tsara zuwa sararin rubutu, kuma irin wannan sawun ba koyaushe yana daidaitawa da rubutu ba. Bugu da ari, lokacin da ake mu'amala da ka'idar samfurin pixel ba ƙaramin murabba'i ba ne [10] don haka sawun sa ba zai zama murabba'i da aka yi hasashe ba. Haɗin sawun sawun a cikin samfuran sararin rubutu yana ɗaukar wasu ƙididdiga na aikin ƙididdiga na pixel da aka yi hasashe a cikin sararin rubutu amma cikakkun bayanai galibi suna da ƙima, [11] na mallaka ne sosai kuma masu zurfin ra'ayi game da ka'idar samfurin. A ra'ayi ko da yake makasudin shine a samar da mafi daidaitaccen samfurin anisotropic na daidaitawa da ya dace don kauce wa rikici tsakanin aliasing a kan wani axis vs. blurring akan ɗayan lokacin da girman girman ya bambanta.

A cikin aiwatar da anisotropic, tacewa na iya haɗawa da algorithms tacewa iri ɗaya da aka yi amfani da su don tace murabba'in taswirorin mipmapping na gargajiya yayin gina matsakaici ko sakamako na ƙarshe.

Kashi na kusa tacewa

[gyara sashe | gyara masomin]

Taswirar taswirar inuwa mai zurfi na iya amfani da Filter Kusa da Kashi Mai ban sha'awa (PCF) tare da zane mai zurfin taswira wanda ke faɗaɗa fahimtar mutum game da nau'ikan matatun rubutu waɗanda za a iya amfani da su. A cikin PCF ana yin taswirar zurfin wurin daga tushen haske. Yayin aiwatar da wurin na gaba wannan taswirar zurfin za'a yi hasashen komawa cikin wurin daga wurin hasken kuma ana yin kwatance tsakanin haɗin zurfin tsinkaya da zurfin samfurin rubutu da aka samo. Haɗin kai zai zama zurfin pixels na wurin daga haske amma zurfin da aka samo daga taswirar zurfin zai wakilci zurfin wurin tare da wannan jagorar da aka tsara. Ta wannan hanyar za a iya yin ƙayyadaddun ganuwa ga haske don haka haskakawa ta hanyar haske za a iya yin pixel da aka yi. Don haka wannan aikin rubutun shine gwajin boolean na ko pixel yana haskakawa, duk da haka ana iya gwada samfurori da yawa don pixel da aka ba da kuma an taƙaita sakamakon boolean da matsakaita. Ta wannan hanyar a hade tare da sigogi daban-daban kamar samfurin samfurin texel har ma da zurfin tsinkayar taswirar taswira matsakaicin kwatancen-zurfin-zurfin-zurfin ko kashi na samfuran kusa don haka ana iya haskaka haske don pixel. Mahimmanci, taƙaita sakamakon boolean da ƙima na ƙimar kaso dole ne a yi aiki bayan zurfin kwatancen zurfin tsinkaya da ɗauko samfurin, don haka wannan zurfin kwatancen ya zama wani sashe mai mahimmanci na tace rubutu. Ana iya amfani da wannan kashi don auna lissafin hasashe da samar da ba kawai hasken boolean ko darajar inuwa ba amma sakamakon penumbra mai laushi. [12] [13] Ana goyan bayan sigar wannan a cikin kayan aikin zamani inda ake yin kwatancen kuma ana amfani da matatar bilinear na post boolean ta nisa [14]

  • Algorithms na Sikeli-Art
  • Atlas Texture
  1. 1.0 1.1 "Chapter 9 - OpenGL Programming Guide". Glprogramming.com. 2009-02-13. Filtering. Retrieved 2018-01-14. Cite error: Invalid <ref> tag; name "glprogramming_chapter09" defined multiple times with different content
  2. Williams, Lance (1983). "Pyramidal parametrics" (PDF). ACM SIGGRAPH Computer Graphics. 17 (3): 1–11. doi:10.1145/964967.801126. ISSN 0097-8930. Archived from the original (PDF) on 2016-06-06. Retrieved 2017-02-14.
  3. "Game Engine Design: Texture Mapping" (PDF). uncc.edu. Texture Magnification. Archived from the original (PDF) on 2021-04-17. Retrieved 2017-02-14.
  4. "Game Engine Design: Texture Mapping" (PDF). uncc.edu. Texture Minification. Archived from the original (PDF) on 2021-04-17. Retrieved 2017-02-14.
  5. Hendrik Lensch (2007-11-29). "Computer Graphics: Texture Filtering & Sampling Theory" (PDF). Max Planck Society. MipMaps. Retrieved 2018-01-14.
  6. Markus Hadwiger (2015-03-09). "GPU and GPGPU Programming Lecture 12: GPU Texturing 2" (PDF). KAUST. Texture Reconstruction: Magnification. Archived from the original (PDF) on 2021-01-24. Retrieved 2017-02-14.
  7. Markus Hadwiger (2015-03-09). "GPU and GPGPU Programming Lecture 12: GPU Texturing 2" (PDF). KAUST. Texture Anti-Aliasing: MIP Mapping. Archived from the original (PDF) on 2021-01-24. Retrieved 2017-02-14.
  8. "Video game system with coprocessor providing high speed efficient 3D graphics and digital audio signal processing". Retrieved 14 November 2022.
  9. Hendrik Lensch (2007-11-29). "Computer Graphics: Texture Filtering & Sampling Theory" (PDF). Max Planck Society. MipMapping II. Retrieved 2018-01-14.
  10. Alvy Ray Smith (1995-07-17). "A Pixel Is Not A Little Square! (And a Voxel is Not a Little Cube) - Technical Memo 6" (PDF). cs.princeton.edu. Retrieved 2018-01-14.
  11. Hendrik Lensch (2007-11-29). "Computer Graphics: Texture Filtering & Sampling Theory" (PDF). Max Planck Society. Anisotropic Filtering. Retrieved 2018-01-14.
  12. Reeves, William T.; Salesin, David H.; Cook, Robert L. (1987-08-01). "Rendering antialiased shadows with depth maps" (PDF). ACM SIGGRAPH Computer Graphics. Association for Computing Machinery (ACM). 21 (4): 283–291. doi:10.1145/37402.37435. ISSN 0097-8930. S2CID 18320563. Archived from the original (PDF) on 2018-01-15.
  13. Randima Fernando (2008-07-02). "Percentage-Closer Soft Shadows" (PDF). NVIDIA Corporation. Retrieved 2018-01-14.
  14. "WebGL WEBGL_depth_texture Khronos Ratified Extension Specification". Khronos.org. 2014-07-15. Retrieved 2018-01-14.