Filtering mai kalakala

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.  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 
Yayin aiwatar da taswirar rubutu don kowane yanayi na 3D na sabani, a 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. "Chapter 9 - OpenGL Programming Guide". Glprogramming.com. 2009-02-13. Filtering. Retrieved 2018-01-14.

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 
Mipmapping daidaitaccen dabara ce da ake amfani da ita don adana wasu ayyukan tacewa da ake buƙata yayin rage rubutu.  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 
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 
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,  da aliasing da shimmering yayin ƙaddamarwa.  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. 

 Makwabci mafi kusa tare da mipmapping 
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 
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 
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.  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.  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. 

 Tace trilinear 
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 .  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 
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  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,  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 
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.   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 

 Duba kuma 

 Algorithms na Sikeli-Art
 Atlas Texture

 manazarta 

Rukuni:Shafuka masu fassarorin da ba'a duba ba