tag:blogger.com,1999:blog-5246987755651065286.post2714898808544004358..comments2024-02-22T16:15:42.388-08:00Comments on cbloom rants: 11-18-08 - DXTCcbloomhttp://www.blogger.com/profile/10714564834899413045noreply@blogger.comBlogger3125tag:blogger.com,1999:blog-5246987755651065286.post-32893024429798974302008-11-18T19:14:00.000-08:002008-11-18T19:14:00.000-08:00Though even getting the scale & bias right it&...Though even getting the scale & bias right it's still not going to always pick the actual closest palette entry in the DXT1 case because of the integer truncation issues. The error will be small, however, so not really relevant for you guys and the real-time case.cbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-47510366299763004462008-11-18T19:08:00.000-08:002008-11-18T19:08:00.000-08:00Yeah, this :const int GREEN_RANGE = 3; float bias ...Yeah, this :<BR/><BR/><I><BR/>const int GREEN_RANGE = 3;<BR/> <BR/>float bias = maxGreen + (maxGreen - minGreen) / (2.0 * GREEN_RANGE);<BR/>float scale = 1.0f / (maxGreen - minGreen);<BR/> <BR/>// Compute indices<BR/>uint indices = 0;<BR/>for (int i = 0; i < 16; i++)<BR/>{<BR/> uint index = saturate((bias - block[i].y) * scale) * GREEN_RANGE;<BR/> indices |= index << (i * 2);<BR/>}<BR/></I><BR/><BR/>Appears to be correct. You've got the bias and the *3 instead of *4.cbloomhttps://www.blogger.com/profile/10714564834899413045noreply@blogger.comtag:blogger.com,1999:blog-5246987755651065286.post-38216237097893041932008-11-18T17:20:00.000-08:002008-11-18T17:20:00.000-08:00The index evaluation method used by Peter Ulicians...The index evaluation method used by Peter Uliciansky is also used in our latest GPU implementation:<BR/><BR/>http://developer.nvidia.com/object/real-time-normal-map-dxt-compression.html<BR/><BR/>it was first proposed by JP in the Real-Time DXT Compression paper:<BR/><BR/>http://cache-www.intel.com/cd/00/00/32/43/324337_324337.pdf<BR/><BR/>and it was first implemented by the guys from Allegorithmic. I did not realize the bug in his implementation, I think ours is correct, right?castanohttps://www.blogger.com/profile/08088335278984724562noreply@blogger.com