TW200910252A - Method for enabling alpha-to-coverage transformation - Google Patents

Method for enabling alpha-to-coverage transformation Download PDF

Info

Publication number
TW200910252A
TW200910252A TW96130927A TW96130927A TW200910252A TW 200910252 A TW200910252 A TW 200910252A TW 96130927 A TW96130927 A TW 96130927A TW 96130927 A TW96130927 A TW 96130927A TW 200910252 A TW200910252 A TW 200910252A
Authority
TW
Taiwan
Prior art keywords
pixel
transparency
coverage
sub
samples
Prior art date
Application number
TW96130927A
Other languages
Chinese (zh)
Inventor
R-Ming Hsu
Original Assignee
Silicon Integrated Sys Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Silicon Integrated Sys Corp filed Critical Silicon Integrated Sys Corp
Priority to TW96130927A priority Critical patent/TW200910252A/en
Publication of TW200910252A publication Critical patent/TW200910252A/en

Links

Landscapes

  • Image Generation (AREA)

Abstract

An alpha-to-coverage transformation is performed by a pixel shader. The pixel shader compares data of a transparency column of a pixel and thresholds of sub-pixels of the pixel to generate a plurality of coverage masks, and stores the plurality of coverage masks in the LSBs of the transparency column of the pixel, and finally update the data of the sub-pixels according to the coverage masks stored in the transparency column of the pixel. A new instruction "a2c" is invented to speed up such thresholds comparison and coverage mask generation.

Description

200910252 九、發明說明: 【發明所屬之技術領域】 本發明係相關於一種執行透明度 — 種利用一像素著色器 方法。 一锸刹田你主-么抑 芝後盍率轉換之方法’尤指 一锸刹田一你之特定指令 以曰 執仃透明度至覆蓋率轉換之 【先前技術】 麟圖的技術主要私於如何敲鎌示一個立 的千面純以顯不或展示於i示裝置上。該物件可為一 (ge_try primitive) ’例如點、直線片段、三 角形、或多邊形。經由用-系列的連接平面多邊形(planar __小可在顯示裝置上綠示較複雜的物件,例如以一系列的 連接平面三角形,可展示—個複雜物件。而且所有幾何圖元最後 =可用-個頂點(vertex)或_組頂點描述,例如狀義多邊形線 ¥又片K點或中心的座標(χ,y,z )來描述。 為產生一個可投射在電腦螢幕或其它顯示裝置上,代表立體 Q元的平面影像的資料組,該圖元的多數個頂點會經一系列運 ^或疋在圖形繪示管道(graphics-rendering pipeline )中經過多 級處理。—般的管道只是一系列串接的處理單元或處理級 (stages) ’其中前一級的輸出被當成下一級的輸入。在圖形處理 器的環i兄中’舉例而言,這些處理級包含每個頂點運算(per_vertex 〇Perati〇ns)、圖元組合運算(primitive assembly operations)、像素 200910252 運算(pkeloperati⑽)、質地組合運算 operations)、描晝運算(rasierizati〇n〇peraii〇ns)及月段運算 (fragment operations )等 ° 在典型的圖形顯示系統中,影像f料庫〇magedatabase), 如命令列表’可儲存在場景(seene)巾的各物件的贿。其中, 遠些物件是以覆蓋該物件表面的多數個小多邊形所描述,且其方 法與多數健磚(tiles)覆蓋赌或其它表面的方式相同。每個多邊 形都是以継座標(在「施dd」座標祕中的χ,γ,ζ)列表、材 料表面特性規格(如色彩、f地、光转),關每_點表面的 糾量(normal Veet⑽)所描述。對具有複義_立體物件而 言’-般而言·多邊形必須為三角形或四邊形’且後者亦 分解成多數個三角形對。 轉換引擎(transformation engine)會根據使用者所輸入的選 定觀看歧,觀齡鍊。此外,伽者村敏财㈤^ 〇f 二)、產生㈣狀核三維視景體(___ _, 以藉此包含或消除想要的背景。 —旦已選定觀看H (viewing area),修剪邏 ===在觀敝梅邊形,及物 内且刀在規看區之外的多邊形。這些經修剪的多邊 於觀看邊緣的新邊緣,對應於落在觀看區之内的多邊形部分。' 200910252 邊七的伽會被料$,丨下—侧校座標的處魏 x、y座標對於顴砉茛, τ姻不的 於每__:t(tWmgS_),且該座標的2座標對應200910252 IX. DESCRIPTION OF THE INVENTION: TECHNICAL FIELD OF THE INVENTION The present invention relates to an implementation transparency method using a pixel shader. A 锸 锸 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 你 ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' ' Knocking on a stand-up surface is shown or displayed on the i-display device. The object can be a (ge_try primitive) such as a point, a line segment, a triangle, or a polygon. By using a series of connected planar polygons (planar__ small can display more complex objects on the display device, for example with a series of connected planar triangles, you can display a complex object. And all geometry primitives last = available - Vertex or _ group vertex description, such as the shape of the polygon line ¥ and K points or the coordinates of the center (χ, y, z) to describe. To produce a projection on a computer screen or other display device, representative The data set of the planar image of the stereo Q element, the majority of the vertices of the primitive will be processed through multiple processes in a series of graphics or rendering pipelines. The general pipeline is just a series of strings. The processing unit or processing stage 'where the output of the previous stage is treated as the input of the next stage. In the ring of the graphics processor', for example, these processing stages contain each vertex operation (per_vertex 〇Perati〇 Ns), primitive assembly operations, pixel 200910252 operations (pkeloperati(10)), texture combination operations, and rasierizati〇n 〇peraii〇ns) and fragment operations etc. ° In a typical graphic display system, the image f library (magedatabase), such as the command list 'can store the bribes of the objects in the scene. Among them, far objects are described by a plurality of small polygons covering the surface of the object, and the method is the same as that of most tiles covering gambling or other surfaces. Each polygon is a list of 継 coordinates (χ, γ, ζ in the "Sdd" coordinates), material surface characteristics (such as color, f, light), and the correction of each _ point surface ( Normal Veet (10)) is described. For a complex _ three-dimensional object, the polygon must be a triangle or a quadrilateral and the latter is also decomposed into a plurality of triangular pairs. The transformation engine will view the differences based on the choices entered by the user. In addition, Gayamura Mincai (5)^ 〇f 2), produces (four) nucleus three-dimensional view (___ _, in order to contain or eliminate the desired background. Once selected H (viewing area), pruning logic === Polygons in the shape of the plume, and inside the object and outside the gauge area. These trimmed polygons are new to the edge of the viewing edge, corresponding to the polygon part that falls within the viewing zone.' 200910252 The gamma of the side seven is expected to be $, the lower part of the coordinates of the side of the school, the coordinates of the x, y coordinates for the 颧砉茛, the τ marriage is not every __: t (tWmgS_), and the coordinates of the coordinates of the two coordinates

又在—個典型的系統中,接下來會考慮光源而 “…、日模型。具有個別色彩值(―此)的 會被傳送至-個轉魏„erizer)D 、,對^言’點_化时決定職像素位置會被多 邊形覆盘,並嘗試將相關色雜與深度,寫人能_器(行_ ^ffer)。轉轉化器會將正接受處理的多邊形的深度值,與已入 晝框緩衝ϋ的像絲度值減較。如果新多邊_像素深度錄 低’代表其位於寫人晝框緩衝器的多邊形之前,因為新多邊形 會讓先前處理過並已寫人畫框緩衝㈣多邊賴得更加模糊,所 以接下來其值會取代在晝滅補巾的錄。這賊理會持續進 行直至丨所有夕邊形多都被會陣轉化過為止。此時,視訊控制器 (video contr〇iier)會以一次一個光柵(raster)掃描行(此麵㈣ •)的方式,在顯示器上顯示晝框緩衝器的内容。 執行即時繪示(real_timerendering)的一般方法,是以位於 多邊形之内或位於多邊形之外的像素顯示多邊形。其所產生的用 來定義多形的邊緣,會在靜態顯示幕(staticdisplay)上,表現出 缺口狀(jagged look) ’ 及在動態顯示幕(animateddispiay)上, 表現出爬行狀(crawlingl〇〇k) ’上述產生的問題稱為鋸齒效應 (aliasing),而用來降低或消除該問題的方法,稱為抗鋸齒效應 7 200910252 (anti-aliasing )技術。 以螢幕為基礎的抗鋸齒效應方法因其只用到管道的輸出取 樣,所以不需要得知正在緣示的物件知識。抗鋸齒效應方法常使 用一種稱為多取樣抗鋸齒效應(Multi_Sample Anti_Aliasing, MSAA)的線性抗鋸齒效應技術,該技術在一單一處理中,會對 每個像素使用一個以上的取樣。每個像素的取樣或子像素 (sub-pixel)的個數,被稱為取樣率(sampiingrate),當取樣率辦 加時,相關的記憶體流通量也會相對增加。 請參考第1圖,第1圖為習知電腦繪圖系統中繪圖管道之特 定模組之功能方塊圖。繪圖管道的模組會因系統需求而變,且可 以多種方式貫現。繪圖的頂點資料被傳送到一頂點著色器 shader) 12。頂點著色器12可在從命令列表中所接收的緣圖資料 上’執行各種轉換。其中,該資料可從世界座標(w〇rld c〇〇rdinates ) 轉換成模型觀點座標(Model View coordinates),再轉換成投射座 標(Projection coordinates),最後再轉換成螢幕座標(Screen coordinates)。了貝點著色器12所執行的功能處理為熟習相關技術者 所热知,因此在此不再贅述。接下來,繪圖資料會再被傳送至一 點陣轉化H (msterizeO 14。關元侧的像素#訊,會被傳送至 像素著色⑦16,像素著色n ι6會決定已絲且翻定較先前儲存 像素更接近觀看者的圖元之内的每個像素的色彩資訊。 200910252 像素繪示(pixelrendering) 18會在位於圖元之内的每個像素 上,執行一個深度測試。所儲存的深度值可提供一指定像素位置' 上先前繪示圖元的深度。如果目前的深度值較儲存的深度值接近 觀看者的眼睛,則目前的深度值會取代所儲存的深度值,而且目 前的繪圖資訊(如色彩)會取代在對應晝框緩衝器中由像素著色 器16所決定的像素位置的色彩資訊。如果目前的深度值並非較所 儲存的深度值更為接近觀看者的眼睛,卿為先雜示的像素確 實是在目前像素之前,所以能緩衝ϋ及深度緩衝兩者的内容都 不會被取代。 【發明内容】 本發明之目的之-係提供-種執行透明度至覆蓋率雜之方 法,以加速透明度至覆蓋率轉換。 本發明係提供-種執行透明度至覆蓋率轉換之方法,包含一 像素著色ϋ將-像素之透明賴之_與該像素之複數個次取樣 之臨界值作味以產生複數㈣鲜遮罩;將該減㈣蓋率遮 罩儲存於雜素之透明度攔之概個最低有效位元巾;及根據儲 存於雜素之透明賴之該複數個覆蓋率遮罩,更新該像素之複 數個次取樣的資料。 本發明另提供-種執行透·至覆蓋率轉換之方法,包含輸 入-指令明發-像素著色_—像素之咖賴之資料與該像 9 200910252 之複數^取樣之複軸臨界健味以產域數個覆蓋率遮 罩;及根據儲存於該像素之翻度歡複數靖蓋轉罩,更新 該次取樣之資料。 【實施方式】 請參考第2圖,第2圖為執行透明度至覆蓋率 (alpha to coverage)轉換之方法之示意圖。透明度至覆蓋率轉換 是-種不需要將物件排序而可描_件的邊緣透明度及物件的外 遮罩(mask)之方法。執行翻度至紐轉換時,—像素的透 明度攔被轉換成對應的覆蓋率,以對應』倍的多重取樣反鑛齒 (MSAA)中n個次取樣(sub_sample)的n位元而形成覆蓋率遮 罩(_mgemask) ’並且將對應比率的數量設定為 1。以4倍的 多重取樣反織為例,透明度欄為〇時覆蓋率遮罩為〇〇〇〇b,透明 度欄為1時覆蓋率遮罩為1Ulb,而Q至丨之間的值就轉換為對應 的覆蓋率鱗。覆蓋率鮮和鱗素對應的各次取樣的深度測試 的結果,產生有效位元(validbit),再利用及(AND)閘運算, 以對應的覆蓋率遮秘有效的次取樣留下。如此,造成以覆蓋率 對應的遞色(dithering)效果,所以在使用多重取樣反鋸齒處理圖 形後,圖形就和背景產生混色(blend)效果了。 請參考第3圖’第3圖為透明度欄之示意圖。應用程式之透 明度攔為oO.w ’並且應用程式可透過設定一旗標enA2C來開啟透 明度至覆蓋率轉換的功能。透明度攔為32位元的浮點數,在開啟 200910252 透明度至覆蓋物換的輕後,透明度齡被設定為覆蓋率的透 明度α ’精確度的要纽低。,在本剌實施财,利用透 月度襴的η個最低有效位疋(丨咖si明池,咖)來儲存覆 蓋率遮罩。此外,會關翻度欄關形處理程序還包含透明产 測試(响傾AT)及透明度混色(alphawend),當旗標^c 被設定為〇時,透明度α的資料歧透明度攔中的32位元的浮點 數。當旗標enA2C被設定為1時,透明度搁的η個最低有效位元 就被設定為0,而透明度α的資料還是由透明度攔中得到。如此, 覆蓋率遮罩就可以被編碼在透明度_ η個最低有效位元上 不需使用輸出暫存器。 請參考第4圖及第5圖,第4圖為執行透明度至覆蓋率轉換 之方法之絲圖’第5圖為本翻執行透日績錢蓋率轉換之方 法之第-實關之轉®。_度至覆蓋铸換之方法主要是將 透明度欄中的透明度和對應多重取樣反据齒的η個次取樣的 ^界 值(threshold)分別比較’以得到η位元的覆蓋率遮罩。透明度至 後盘率轉換之方法包含下列四個步驟。 步驟110:用像素著色器原有的It(小於),ie(小於等於)g以大 於)或ge (大於等於)等比較指令,將—像素輪出的^ #顏色中的透明度攔(〇aw) ’和4個次取樣臨界值做 比較,將比較結果放於4欄中; 步驟120 :根據4欄中比較結果,用movc (有條件地搬移)指令, 分別決定覆蓋率遮罩中的4個位元,4個位元還是分別 11 200910252 被儲存於4攔中; 步驟130.·將透明度攔(0〇.w)中最後4個最低有效位元更新為 〇 ’利用一個及(and)指令來遮罩最低有效位元; 步驟M0··匯集4個位元於透明度攔(0〇.w)令的覆蓋率遮罩。 步驟110至140並非絕對循序的 ...... '-叫"I个^少‘娜ii(j、 120是因為比較指令只能輸出真/假(true/false)的二元結果,若社 果為真·賴所有驗元全為1,若結料假職賴所有的位 凡全為〇’所以需要多-個指令將比較結果轉為覆蓋率遮罩中的對 應位元。步驟130、140是為了將覆蓋率遮罩編碼入透明度欄 (〇〇.w)。以4倍的多重取樣反麵為例,糾像素著色器原 指令集來處理上述4個步驟’至少需要7道指令,因此在本發明 實施例中’以1道新增的指令必處理上述4個步驟,該新增的 齡可以完全作用於透明度攔(〇〇.w),而不必指定來源/結果暫存 加入適當的來源/結果暫存器,就可以增加軟體轉換像素 者色器指令的彈性,例如卷〇 士 ’、 屮日"〇〇,W由—個單獨贿(搬移)指令輪 出夺可直接以a2c取代而不用增加指令。 根據本發明實施例,透明产 K 又主復盍率轉換之4個步驟被整合 為一個a2c指令,新增的 “ -[,wlzzle],srcn,wl2zle],,;^ 為分別比較靖梅物令的作用 界值,並將產生的覆蓋率遮罩2反銘齒的次取樣的4個臨 旱儲存於結果暫存器的4個最低有效 12 200910252 位元(bit3〜_。舉例來說,_的4攔和對應多重取樣反鑛 齒的次取樣的4個臨界值,例如利用h指令比較時,4個臨界值 :別為0.125、0.625、0.875及0,375 ’小於則將輸出暫存器對應的 取低有效位7C設為卜否職為〇 ’其它位元則由肌时對應的位 元直接搬入。利用a2c指令可和原有的比較指令共用硬體,只需 增加指錄出結果的硬體,而來源/結果暫存器_位都可使用原 有的硬體,不會增加衫硬體成本,卻可大大提高處理的效率。 明參考第6圖’帛6圖為使用擾亂表執行透明度至覆蓋率轉 換之方法之不意圖。為了達到更好的效果,透明度至 的遞色«要進-步_亂(dis_ng)’才能避免產生太一致的 圖案(pattern)。擾亂的方法可以利用各種亂數或螢幕位置,目前 常用螢幕位亂的方法’比較能控制圖案的效果。同樣以4倍 的多重取樣反鋸齒為例,根據像素的螢幕位置,循環性地查詢一 城的擾亂表(dithertable),找出一介於+/_ 〇 5的亂數,透明度攔 加上該亂數後,再和覆蓋率遮罩中各位元的臨界值分別比較,就 可得到4位元蓋率遮罩。接著,將覆蓋率遮罩和該像素對應 的各次取樣的深度測試結果做及閘運算,可達到品質較好的透明 度至覆蓋率轉換。 請參考第7圖,第7圖為本發明執行透明度至覆蓋率轉換之 方法之第二實施例之示意圖。第6圖中產生的擾亂表可儲存於、一 新增的材質(texture)或定值(constant)中,利用讀取(记)浐 13 200910252 .令讀取材質’或用索引(index)讀取定值以得到亂數,並加入透 明度欄中達成擾敗,再用a2c指令得到覆蓋率遮罩。增加的擾亂 的方法包含4個步驟,可用原有的4個像素著色器的指令完成。 菖擾亂表儲存於新增的材質中時,步驟如下: 步驟210 :將螢幕二維位置,由浮點數轉為整數,需要一個轉換 指令ftou ; 步驟220 :將步驟210得到的二維整數,以-個及(and)指令來 遮罩出查擾亂表需要的index,如8x8的擾亂表,就遮 罩3個LSB。此步驟也可用udiv指令的餘數(讎ainde〇 功能達到; v驟230 .以步驟2遮罩出的座標讀取擾亂表。需要一個材質讀 取(Id)指令; 步驟24G .將步驟3讀出的結果,加人透明度攔達成擾亂,需要 一個“加” (add)指令。 當擾亂表儲存於新增的定值中時,因為定值只能以一維座標 索引(index) ’則步驟230及步驟240分別改為步驟33〇及步驟 340。 步驟330:以步驟22〇遮罩出的二維座標,以一個乘加(mad) 指令得出擾亂表的定值索引; 步驟340·以步驟33〇求出的索引,索引出定值加入透明度攔達 成擾亂’需要一個加(add)指令。 14 200910252 覆蓋率轉換之方法。 本發明實施例以4倍的多重取樣反鑛齒處理透 ==並非限_之範籌,2倍的多重取樣: 及1倍的夕重取樣反鑛齒(即無多重取樣反鑛齒) : 此外,當執行大於4倍的多重取樣反軸時,因為必指令 平行地比較4瓣應多錄樣反_触取樣的臨界值,也二 將覆蓋率遮罩編入4個最低有效位元中。因此,上述的、= 可以-般化為-群必—m的指令來處理。例如處理4倍的多& 樣反鑛齒的必指令即a2cJ,處理8倍的多重取樣反鑛齒即 由a2c—i及a2e—2,處理16倍的多重取樣反_即需要由必! a2c一2、a2〇及a2c_4。每個a2c—m指令負責分別比較對應多重取 樣反錯齒的次取_ 4健界值,將赶㈣鱗遮罩儲存於結 果暫存器的bit (4m-l)〜bit (4ην4)的4位元。 綜上所述,本發明糊像素著色器來處理執行透明度至覆蓋 率轉換之方法’可增加鱗,料將該像奴覆料鮮儲存於 透明度欄之最低有效位元’可節省成本。像素著色將該一像素 之透明度歡貧料與該像素之複數個次取樣之臨界值作比較以產 生複數個覆鮮料,並縣複數個覆鲜遮_存於該像素之 200910252 .透明度欄之複數個最低有效位元中,最後根據儲存於該像素之透 明度欄之該複數個覆蓋率遮罩,更新該像素之複數個次取樣的資 料。本發明執行透明度至覆蓋率轉換之方法可使用軟體或硬體來 貫作,用軟體貫作時,可利用單獨的工具程式,或是成為程式載 入程式(ProgramLoader)或裝置驅動程式(DeviceDriver)的— 部份,或附加於編輯器(Compiler)。用硬體實作時,於像素著色 器的指令擷取(Fetch)或解碼(Decode)之前,内含於圖形處理 器或像素著色器中。 以上所述僅為本發明之較佳實施例,凡依本發明申請專利範 圍所做之鱗變化與修飾,皆應屬本發日狀涵蓋範圍。 【圖式簡單說明】 第 第 第 ,為習知電麟_財職轉之蚊池之舰方塊圖。 2圖為執行透明度至覆蓋率轉換之方法之示意圖。 3圖為透明度欄之示意圖。 第4圖 第5圖 第6圖 苐7圖 為執行透明度至覆蓋率轉換之方法之流程圖。 為本發明執行刺歧錢_ ;立面 乃沃之第一實施例之 為使用擾亂表執行透明度至覆蓋率 為本發明執行透明度至覆料轉換方L之不意圖。 意圖 、万法之第二實施例之 【主要元件符號說明】 200910252 12 16 頂點著色器 14 像素著色器 18 點陣轉化器 像素繪示 17In another typical system, the light source will be considered next to the "..., day model. Individual color values ("this" will be sent to - weiler erizer) D,, for ^言' point _ When determining the position of the job, the pixel position will be covered by the polygon, and try to write the relevant color and depth, and write the _ _ _ _ _ ^ _ _ _ _ _ _ The converter will subtract the depth value of the polygon being processed from the value of the image that has been buffered. If the new polygon_pixel depth record low represents its polygon before the write frame buffer, because the new polygon will make the previously processed and written frame buffer (four) multilaterally more fuzzy, so the next value will Replace the record in the annihilation patch. This thief will continue to do so until all the eves have been transformed by the formation. At this time, the video controller (video contr〇iier) displays the contents of the frame buffer on the display in a raster scan line (this side (four) •). The general way to perform real_timerendering is to display polygons in pixels that are inside or outside the polygon. The edge that is used to define the polymorphic shape will show a jagged look on the static display and a crawling on the animated dispay (crawlingl〇〇k The problem caused by the above is called aliasing, and the method used to reduce or eliminate the problem is called anti-aliasing effect 7 200910252 (anti-aliasing) technique. The screen-based anti-aliasing method does not need to know the object knowledge that is being shown because it only uses the output of the pipe. The anti-aliasing method often uses a linear anti-aliasing technique called Multi-Sample Anti-Aliasing (MSAA), which uses more than one sample per pixel in a single process. The number of samples or sub-pixels per pixel is called the sampling rate. When the sampling rate is increased, the associated memory throughput is relatively increased. Please refer to Figure 1. Figure 1 is a functional block diagram of a specific module of a drawing pipeline in a conventional computer graphics system. Modules for drawing pipelines can vary depending on system requirements and can be replicated in a variety of ways. The vertex data of the drawing is passed to a vertex shader shader). Vertex shader 12 can perform various transformations on the edge map data received from the command list. Among them, the data can be converted from world coordinates (w〇rld c〇〇rdinates) to Model View coordinates, converted to Projection coordinates, and finally converted to Screen coordinates. The functional processing performed by the bedding shader 12 is well known to those skilled in the art, and therefore will not be described herein. Next, the plot data will be transferred to the dot matrix conversion H (msterizeO 14. The pixel # signal on the side of the gate will be sent to the pixel shader 716, and the pixel shader n ι6 will determine that it has been tapped and flipped more than the previously stored pixel. Color information for each pixel within the viewer's primitive. 200910252 Pixel Rendering 18 performs a depth test on each pixel located within the primitive. The stored depth value provides one Specify the depth of the primitive previously drawn on the pixel location. If the current depth value is closer to the viewer's eye than the stored depth value, the current depth value will replace the stored depth value, and the current drawing information (such as color) Will replace the color information of the pixel position determined by the pixel shader 16 in the corresponding frame buffer. If the current depth value is not closer to the viewer's eyes than the stored depth value, The pixel is indeed in front of the current pixel, so the content of both the buffer and the depth buffer will not be replaced. [The content of the present invention] A method of performing transparency to coverage to accelerate transparency to coverage conversion. The present invention provides a method for performing transparency to coverage conversion, including a pixel coloring, a pixel-by-pixel transparency, and the pixel The threshold value of the plurality of samplings is scented to produce a plurality of (four) fresh masks; the reduced (four) coverage mask is stored in the transparency of the impurities to form a minimum effective cost of the mask; and according to the transparency stored in the impurities The plurality of coverage masks are updated to update the plurality of subsampled data of the pixel. The present invention further provides a method for performing transmissive-to-coverage conversion, including input-instruction explicit-pixel rendering--pixel The data of the Lai Lai and the complex axis of the sample 9 200910252 are covered by several coverage areas of the production area; and the sampling is updated according to the number of flaps stored in the pixel. [Embodiment] Please refer to Figure 2, which is a schematic diagram of a method for performing transparency to alpha to coverage conversion. Transparency to coverage conversion is a type of object that does not need to be sorted. The method of describing the edge transparency of the piece and the outer mask of the object. When performing the turn-to-turn transition, the transparency of the pixel is converted into a corresponding coverage ratio to correspond to the multi-sampled anti-mineral tooth ( MSAA) n sub-samples (sub_sample) of n bits to form a coverage mask (_mgemask) ' and set the number of corresponding ratios to 1. Taking 4 times of multi-sample anti-weaving as an example, the transparency bar is 〇 The coverage mask is 〇〇〇〇b, the coverage mask is 1Ulb when the transparency column is 1, and the value between Q and 转换 is converted to the corresponding coverage scale. The coverage is fresh and the squama corresponds to each time. The result of the depth test of the sample, the valid bit is generated, and the AND gate operation is used to mask the effective sub-sample with the corresponding coverage. In this way, the dithering effect corresponding to the coverage is caused, so after the multi-sample anti-aliasing process is used, the graphics and the background are blended. Please refer to Figure 3'. Figure 3 is a schematic diagram of the transparency bar. The transparency of the application is blocked by oO.w ’ and the application can turn on transparency to coverage conversion by setting a flag enA2C. Transparency is a 32-bit floating point number. After turning on the transparency of 200910252 to cover, the transparency age is set to the transparency of the coverage. In the implementation of the money, the use of the monthly minimum 有效 最低 最低 最低 最低 丨 丨 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存 储存In addition, the closing degree bar processing program also includes a transparent product test (sounding AT) and a transparency mixed color (alphawend). When the flag ^c is set to 〇, the data of the transparency α is 32 bits in the transparency block. The floating point number of the element. When the flag enA2C is set to 1, the n least significant bits of the transparency are set to 0, and the data of the transparency α is still obtained by transparency. Thus, the coverage mask can be encoded on the transparency_n least significant bits without the use of an output register. Please refer to Figure 4 and Figure 5, Figure 4 is a silk diagram of the method of performing transparency to coverage conversion. Figure 5 is the first method of the implementation of the method of translating the performance of the Japanese currency. . The method of _degree to cover casting is mainly to compare the transparency in the transparency column with the threshold of the n sub-samples corresponding to the multi-sampled back-tooth, respectively, to obtain a coverage mask of η-bit. The transparency to post-rate conversion method consists of the following four steps. Step 110: using the pixel shader's original It (less than), ie (less than or equal to) g with a comparison instruction such as greater than) or ge (greater than or equal to), the transparency in the ^ # color of the pixel is rotated (〇aw 'Compare with 4 sub-sampling thresholds, put the comparison results in 4 columns; Step 120: According to the comparison result in 4 columns, use movc (conditional move) instruction to determine 4 in coverage mask respectively One bit, 4 bits or 11 200910252 are stored in 4 blocks; Step 130. Update the last 4 least significant bits in the transparency bar (0〇.w) to 〇' utilize one and (and) The instruction masks the least significant bit; Step M0··Collects the coverage mask of 4 bits in the transparency block (0〇.w). Steps 110 to 140 are not absolutely sequential... '-called "I^^'s nai(j, 120 is because the comparison instruction can only output true/false (true/false) binary results, If the fruit is true, all the vouchers are all 1, and if all the scams are all 〇', then more than one instruction is needed to convert the comparison result to the corresponding bit in the coverage mask. 130, 140 is to encode the coverage mask into the transparency bar (〇〇.w). Taking the 4x multi-sampling reverse as an example, correcting the pixel shader original instruction set to process the above 4 steps' requires at least 7 channels. The instruction, therefore, in the embodiment of the present invention, the above four steps must be processed by one new instruction, and the new age can be completely applied to the transparency block (〇〇.w) without specifying the source/response temporary storage. By adding the appropriate source/result register, you can increase the flexibility of the software to convert the pixel to the color of the device, such as the Roller's ', the next day', and the W by a separate bribe (moving) instruction Directly replaced by a2c without adding instructions. According to an embodiment of the present invention, transparent production K and main re-recovery rate In 4 steps, it is integrated into an a2c command. The new "-[, wlzzle], srcn, wl2zle],,;^ are used to compare the action boundary values of Jingmei, and the coverage coverage is masked. 2 4 samples of the sub-sampling of the anti-indicator are stored in the result register of the 4 least effective 12 200910252 bits (bit3~_. For example, 4 blocks of _ and sub-sampling of corresponding multi-sample anti-mining teeth The four critical values, for example, when comparing with the h command, the four critical values: other than 0.125, 0.625, 0.875, and 0,375 'less than the lower valid bit 7C corresponding to the output register is set to be 〇' The other bits are directly loaded by the corresponding bit in the muscle. The a2c command can be used to share the hardware with the original comparison command, and only the hardware that refers to the result is added, and the source/result register_bit can be used. Using the original hardware does not increase the hardware cost of the shirt, but it can greatly improve the processing efficiency. Refer to Figure 6 '帛6' for the purpose of using the scrambling table to perform the transparency-to-coverage conversion method. Better results, transparency to the divergence «to step - chaos (dis_ng)' Avoid creating patterns that are too consistent. The method of scrambling can use a variety of random numbers or screen positions. At present, the method of using screens is often 'comparable to control the effect of the pattern. Also take 4 times of multi-sampling anti-aliasing as an example, according to The position of the screen of the pixel, cyclically query the dithertable of a city, find a random number between +/_ 〇5, the transparency block adds the random number, and then the elements in the coverage mask The threshold value is compared separately, and a 4-bit coverage mask can be obtained. Then, the coverage mask and the depth test result of each sampling corresponding to the pixel are gated, and the transparency to coverage can be achieved. Conversion. Please refer to FIG. 7. FIG. 7 is a schematic diagram of a second embodiment of a method for performing transparency to coverage conversion according to the present invention. The scrambling table generated in Figure 6 can be stored in a new texture or constant, using read (record) 浐 13 200910252 . Let read material ' or read with index (index) Take the value to get the random number, and add the transparency bar to achieve the disturbance, and then use the a2c command to get the coverage mask. The added method of scrambling consists of 4 steps, which can be done with the instructions of the original 4 pixel shaders. When the tampering table is stored in the newly added material, the steps are as follows: Step 210: Convert the two-dimensional position of the screen from a floating point number to an integer, and a conversion instruction ftou is required; Step 220: The two-dimensional integer obtained in step 210, Use the - and (and) instructions to mask the index needed to find the scrambled table, such as the 8x8 scrambling table, to mask 3 LSBs. This step can also be used with the remainder of the udiv instruction (雠ainde〇 function is achieved; v step 230. The scrambling table is read with the coordinates masked by step 2. A material read (Id) instruction is required; step 24G. Step 3 is read out As a result, adding transparency to the disturbance requires an "add" command. When the scrambling table is stored in the newly added value, since the setting can only be indexed by one-dimensional coordinates, then step 230 And step 240 is changed to step 33 and step 340 respectively. Step 330: The two-dimensional coordinates masked by step 22 are used, and a fixed value index of the scrambling table is obtained by a multiply-add (mad) command; step 340·step 33 〇 find the index, the index is set to add transparency to achieve the disturbance 'requires an add command. 14 200910252 Coverage conversion method. The embodiment of the present invention is processed by 4 times multi-sample anti-mineral tooth == Not limited to _, the multi-sampling of 2 times: and 1 times of re-sampling anti-mineral teeth (ie no multi-sampling anti-mineral teeth): In addition, when performing multi-sampled anti-axis more than 4 times, because of the mandatory Parallel comparison of 4 flaps should be multi-recorded anti-touch The threshold value is also programmed into the 4 least significant bits. Therefore, the above = can be generalized to - group must - m instructions. For example, processing 4 times more & The inevitable command of the anti-mineral tooth is a2cJ, and the multi-sample anti-mining tooth that handles 8 times is treated by a2c-i and a2e-2, and the multi-sampling inverse of processing 16 times needs to be necessary! a2c-2, a2〇 and a2c_4 Each a2c-m instruction is responsible for respectively comparing the secondary _ 4 threshold values of the corresponding multi-sampled anti-missing teeth, and storing the rush (four) scale mask in the bit (4m-l)~bit (4ην4) of the result register. 4-bit. In summary, the paste pixel shader of the present invention processes the method of performing transparency to coverage conversion, which can increase the scale, and store the image-like material in the least significant bit of the transparency bar to save Cost. Pixel coloring compares the transparency of one pixel with the threshold of multiple samplings of the pixel to generate a plurality of overlays, and counts a plurality of masks in the county. 200910252. Transparency The least significant number of bits in the column, and finally based on the transparency stored in the pixel The plurality of coverage masks of the column are used to update a plurality of sub-sampled data of the pixel. The method for performing transparency to coverage conversion of the present invention can be implemented by using software or hardware, and can be utilized when using software. The utility program, either as part of the ProgramLoader or DeviceDriver, or as an add-on to the Compiler. When using hardware implementation, the instructions in the pixel shader are captured. Before (Fetch) or Decode, it is included in the graphics processor or pixel shader. The above description is only a preferred embodiment of the present invention, and all scale changes and modifications made in accordance with the scope of the present invention should fall within the scope of the present invention. [Simple description of the figure] The first is the block diagram of the ship of the Mosquito Pool. Figure 2 is a schematic diagram of the method of performing transparency to coverage conversion. 3 is a schematic diagram of the transparency bar. Figure 4 Figure 5 Figure 6 Figure 7 is a flow chart of the method for performing transparency to coverage conversion. Performing the thorns for the present invention _; Facade The first embodiment of the invention is to use the scrambling table to perform transparency to coverage. The present invention is not intended to perform transparency to the overlay conversion. Intention, the second embodiment of the method [Main component symbol description] 200910252 12 16 Vertex shader 14 Pixel shader 18 Dot matrix converter Pixel rendering 17

Claims (1)

200910252 十、申請專利範圍: I 一種執行透明度至覆蓋率(alpha-to-coverage)轉換之方法,包 含: 一像素著色器(pixel shader)將一像素之透明度攔之資料與該 像素之複數個次取樣(sub-sample)之複數個臨界值 (threshold)作比較以產生複數個覆蓋率遮罩(c〇verage mask); . 將該複數個覆蓋率遮罩儲存於該像素之透明度攔之複數個最 低有效位元(least significant bit,LSB )中;及 根據儲存於該像素之透明度欄之該複數個覆蓋率遮罩,更新該 像素之複數個次取樣的資料。 2·如請求項1所述之方法,其中該像素著色器將該像素之透明度 棚之資料與該像素之複數個次取樣之複數個臨界值作比較以 產生複數個覆蓋率遮罩包含: 比較該像素之透明度歡資料與該像素之複數個次取樣之複 數個臨界值,並將一比較結果儲存於一暫存器中;及 根據該比較結果產生該複數鋪蓋率遮罩,並㈣複數 率遮罩儲存於該暫存器中。 3.如請求項丨所述之方法,聽含_暫存器中存取該複數 蓋率遮罩。 1$ 200910252 4. 5. U貞1所述之方法,其巾該像素著色器職像素之透明度 欄之前樓該像素之複數個次取樣之複數她界值作比較以 產ΐ複數倾麵轉顧像素著⑼職像素之透明度欄 /、Λ像素之四個次取樣之四個臨界值作比較以產生四 個覆蓋率遮罩。 如明求項1所述之方法,另包含致能—透明度至覆蓋率轉換之 旗標。 6. 如請求項1所述之方法,另包含: 藉由-顯示面板之座標位置產生一擾絲 (dither table ); 產生a亥擾亂表之複數個索引; 根據該複數個索引讀取該擾亂表;及 將由該擾亂表讀取之定值加入該像素之透明度欄。 7. 如請求項1所述之方法,另包含: 產生該像素之每一次取樣之深度測試之資料;及 將該像素之覆蓋率遮罩及次取樣之深度測試之貧料進行及 (AND)閘運算。 8. 如請求項1所述之方法’另包含執行--錄胁界值及產生該 覆蓋率遮罩之指令。 19 200910252 9. 一種執行透明度至覆蓋率(alpha-to-coverage)轉換之方法, 包含: 輸入一指令以觸發: 一像素著色器(pixel shader)將一像素之透明度攔之資料與該 像素之複數個次取樣(sub-sample)之複數個臨界值 (threshold )作比車父以產生複數個覆盘率遮罩(coverage mask);及 根據儲存於該像素之透明度攔之複數個覆蓋率遮罩,更新該次 取樣之資料。 1〇_如請求項9所述之方法,其中該像素著色器將一像素之透明度 欄之資料與該像素之複數個次取樣之複數個臨界值作比較以 產生複數個覆蓋率遮罩包含: 比較该像素之透明度欄之資料與該像素之複數個次取樣之複 數個臨界值,並將一比較結果儲存於一暫存哭中;及 根據該比較結果產生該複數個覆蓋率遮罩,並將該複數個覆蓋 率遮罩儲存於該暫存器中。 11.如請求項9所述之方法,其中輸入該指令進一步觸發存取該暫 存器中之該複數個覆蓋率遮罩。 20 200910252 之資料=復鲜遮罩健像素著色11將該像素之透明度搁 μ 21°亥像素之四個次取樣之四個臨界值作比較以產生四 13. 中輸令進-步觸發致能 一透 R崎相9所述之方法,另包含: 藉/、貝不面板之座標位置產生一擾亂表(dithertable); 產生_IL表之複數個索引; 根據該複數個索引讀取該擾亂表;及 將由4擾亂表讀取之定值加人該像素之透明度棚。 15·如凊求項9所述之方法,另包含: 產生该像素之每一次取樣之深度測試之資料;及 將該像素之覆蓋率遮罩及次取樣之深度測試之資料進行及 (AND)閘運算。 16.如請求項9所述之方法’其中輸入該指令進一步觸發儲存該複 數個覆蓋率遮罩於該像素之透明度欄之複數個最低有效位^^ (least significant bit,LSB)中。 21200910252 X. Patent application scope: I A method for performing alpha-to-coverage conversion, comprising: a pixel shader blocking the transparency of a pixel with a plurality of times of the pixel Sub-sample a plurality of thresholds for comparison to generate a plurality of coverage masks (c〇verage mask); storing the plurality of coverage masks in a plurality of transparency blocks of the pixels The least significant bit (LSB); and updating the plurality of subsampled data of the pixel according to the plurality of coverage masks stored in the transparency column of the pixel. 2. The method of claim 1, wherein the pixel shader compares the data of the transparency of the pixel with a plurality of sub-samples of the plurality of sub-samples to generate a plurality of coverage masks comprising: comparing a transparency threshold of the pixel and a plurality of sub-samples of the pixel, and storing a comparison result in a temporary register; and generating the complex coverage mask according to the comparison result, and (4) a complex rate The mask is stored in the register. 3. Access the complex cover mask in the _scratchpad as described in the request. 1$ 200910252 4. 5. The method described in U贞1, the towel of the pixel shader, the transparency of the column, before the multi-sampling of the pixel, the multiple of the threshold is compared with the value of the threshold. The four threshold values of the four sub-samples of the (9) job pixel transparency column and the Λ pixel are compared to generate four coverage masks. The method of claim 1, further comprising enabling - transparency to coverage conversion flag. 6. The method of claim 1, further comprising: generating a dither table by the coordinate position of the display panel; generating a plurality of indexes of the a hash table; reading the disturbance according to the plurality of indexes a table; and adding a value read by the scrambling table to the transparency column of the pixel. 7. The method of claim 1, further comprising: generating data of a depth test for each sampling of the pixel; and performing (AND) the poor coverage of the coverage mask and the sub-sample depth test. Gate operation. 8. The method of claim 1 further comprising an execution-recording threshold value and an instruction to generate the coverage mask. 19 200910252 9. A method for performing an alpha-to-coverage conversion, comprising: inputting an instruction to trigger: a pixel shader blocks a pixel of transparency and a plurality of pixels of the pixel Sub-samples of a plurality of thresholds (thresholds) for generating a plurality of coverage masks than the parent; and a plurality of coverage masks according to the transparency stored in the pixels , update the data of the sampling. The method of claim 9, wherein the pixel shader compares data of a transparency column of a pixel with a plurality of sub-samples of the plurality of sub-samples to generate a plurality of coverage masks comprising: Comparing the data of the transparency column of the pixel with a plurality of sub-samples of the pixel, and storing a comparison result in a temporary crying; and generating the plurality of coverage masks according to the comparison result, and The plurality of coverage masks are stored in the register. 11. The method of claim 9, wherein entering the instruction further triggers access to the plurality of coverage masks in the register. 20 200910252 Data = Re-shadow Mask Pixel Pixel Shading 11 The transparency of the pixel is compared to the four thresholds of the four sub-samples of the 21° Hei pixel to generate four 13. The middle input step-step trigger enable A method as described in R, wherein the method further comprises: generating a disturbing table by using a coordinate position of the panel; generating a plurality of indexes of the _IL table; and reading the scrambling table according to the plurality of indexes; And the setting value read by the 4 scrambling table is added to the transparency shed of the pixel. The method of claim 9, further comprising: generating data of a depth test for each sampling of the pixel; and performing (AND) the data of the coverage mask of the pixel and the depth of the sub-sampling Gate operation. 16. The method of claim 9, wherein the inputting the instruction further triggers storing the plurality of coverage masks in a plurality of least significant bits (LSBs) of the transparency column of the pixel. twenty one
TW96130927A 2007-08-21 2007-08-21 Method for enabling alpha-to-coverage transformation TW200910252A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
TW96130927A TW200910252A (en) 2007-08-21 2007-08-21 Method for enabling alpha-to-coverage transformation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
TW96130927A TW200910252A (en) 2007-08-21 2007-08-21 Method for enabling alpha-to-coverage transformation

Publications (1)

Publication Number Publication Date
TW200910252A true TW200910252A (en) 2009-03-01

Family

ID=44724320

Family Applications (1)

Application Number Title Priority Date Filing Date
TW96130927A TW200910252A (en) 2007-08-21 2007-08-21 Method for enabling alpha-to-coverage transformation

Country Status (1)

Country Link
TW (1) TW200910252A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109389664A (en) * 2017-08-04 2019-02-26 腾讯科技(深圳)有限公司 Model pinup picture rendering method, device and terminal

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109389664A (en) * 2017-08-04 2019-02-26 腾讯科技(深圳)有限公司 Model pinup picture rendering method, device and terminal
CN109389664B (en) * 2017-08-04 2022-02-22 腾讯科技(深圳)有限公司 Model map rendering method and device and terminal

Similar Documents

Publication Publication Date Title
AU2011200479B2 (en) A Graphics Processing Architecture Employing A Unified Shader
TWI592902B (en) Control of a sample mask from a fragment shader program
TWI272014B (en) Color compression using an edge data bitmask in a multi-sample anti-aliasing scheme
US7742060B2 (en) Sampling methods suited for graphics hardware acceleration
CN110383337A (en) Variable bit rate coloring
JP5460438B2 (en) Pixel value generation and decomposition in the graphics processing pipeline
US6924808B2 (en) Area pattern processing of pixels
CN110291563A (en) Multiple tinter processes in graphics process
US20100110102A1 (en) Methods of and apparatus for processing computer graphics
CN107392988A (en) System, the method and computer program product for being used to render with variable sampling rate using perspective geometry distortion
CN110390708A (en) Render the System and method for and non-volatile memory medium of optical distortion effect
US8139075B2 (en) Color packing glyph textures with a processor
EP1371012A2 (en) Antialiasing method and apparatus for video applications
WO2013101150A1 (en) A sort-based tiled deferred shading architecture for decoupled sampling
CN108335349A (en) Utilize NN filtering image data
US11893676B2 (en) Parallel texture sampling
US20060103663A1 (en) Method and system for real-time anti-aliasing using fixed orientation multipixels
JP2022511319A (en) Distance field color palette
CN110390711A (en) Computer graphical based on layering ray cast
US20080284780A1 (en) Method for enabling alpha-to-coverage transformation
US6812928B2 (en) Performance texture mapping by combining requests for image data
CN106575428A (en) High order filtering in a graphics processing unit
JP4801088B2 (en) Pixel sampling method and apparatus
US6982719B2 (en) Switching sample buffer context in response to sample requests for real-time sample filtering and video generation
EP1058912B1 (en) Subsampled texture edge antialiasing