緣起: 瀏覽Nvidia SDK 9.5的時候看到了這個,一下來了興致,我也搞過這玩意兒啊,看這兒
數字時鐘DigitalClock嘗試--續(xù)(2)終于畫出時間了,挺漂漂的,吼吼 非常有興趣看下Nvidia是如何實現(xiàn)的。
截圖:

對比下我的,竊以為不如我的好看,嘿嘿

概要: This entry shows how to rasterize arbitrary quads to a screen aligned quad using a fragment shader. The fragment shader used in this sample has only three inputs, the current time in hours, minutes, and seconds. From this data it separates each number into individual digits, then calculates a set of on/off states that map that digit to an old style LCD clock. Once this is calculated, the shader needs to actually rasterize each digit and it does this by treating each section of each digit as a set of four line equations then testing the current fragment position to see if it is inside these four line equations. This is repeated for each of the eight segments in a digit, then again for the other five digits.
posted on 2008-12-24 02:28
七星重劍 閱讀(873)
評論(0) 編輯 收藏 引用 所屬分類:
Game Graphics