缘起: 浏览Nvidia SDK 9.5的时候看到了这个,一下来了兴致,我也搞过这玩意儿啊,看这儿
数字时钟DigitalClock尝试--续(2)终于画出时间了,挺漂漂的,吼吼 非常有兴趣看下Nvidia是如何实现的。
截图:
对比下我的,窃以为不如我的好看,嘿嘿
概要: 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
七星重剑 阅读(862)
评论(0) 编辑 收藏 引用 所属分类:
Game Graphics