Googles appar
Huvudmeny

Post a Comment On: cbloom rants

"11-18-08 - DXTC"

3 Comments -

1 – 3 of 3
Blogger castano said...

The index evaluation method used by Peter Uliciansky is also used in our latest GPU implementation:

http://developer.nvidia.com/object/real-time-normal-map-dxt-compression.html

it was first proposed by JP in the Real-Time DXT Compression paper:

http://cache-www.intel.com/cd/00/00/32/43/324337_324337.pdf

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?

November 18, 2008 at 5:20 PM

Blogger cbloom said...

Yeah, this :


const int GREEN_RANGE = 3;

float bias = maxGreen + (maxGreen - minGreen) / (2.0 * GREEN_RANGE);
float scale = 1.0f / (maxGreen - minGreen);

// Compute indices
uint indices = 0;
for (int i = 0; i < 16; i++)
{
uint index = saturate((bias - block[i].y) * scale) * GREEN_RANGE;
indices |= index << (i * 2);
}


Appears to be correct. You've got the bias and the *3 instead of *4.

November 18, 2008 at 7:08 PM

Blogger cbloom said...

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.

November 18, 2008 at 7:14 PM

You can use some HTML tags, such as <b>, <i>, <a>

This blog does not allow anonymous comments.

Comment moderation has been enabled. All comments must be approved by the blog author.

You will be asked to sign in after submitting your comment.