Page 3 of 3

Re: [r643 and beyond]Graphic discoloration

Posted: Tue Jan 15, 2008 3:09 pm
by Graf Zahl
No, the black boxes come from color index 0 being mapped to palette entry 1.

Re: [r643 and beyond]Graphic discoloration

Posted: Tue Jan 15, 2008 5:09 pm
by randi
Do you think it would help you experiment if I made an attempt to explain what these cvars do? Here goes.

Inside the game, the palette is stored in one long row, rather than 16 as seen here. The pal cvar controls where it looks up color 0. The default value of 0.5 should place it directly in the middle of the first palette entry. A value of -1.5 would make it look directly in the center of a nonexistant entry before the first one, and a value of +1.5 should make it look directly in the center of the second palette entry. So by increasing this, you throw away entries at the start of the palette and shift everything left. By decreasing this, you throw away entries at the end of the palette and shift everything right.

To determine where to look up color 255, pc is added to pal. This means that the default value of 255 will have it looking at location 255.5, which should be directly in the center of the last palette entry (number 255). Each color in between should be evenly spaced between these. Unfortunately, that's not the way it's working on your card, so I'd like to find some combination of the two values that will map each color to a unique palette entry.

But explaining this has given me the idea to try doing the mapping with an interpolation instruction instead of a multiply-and-add instruction. Maybe that will work better. Edit: Nevermind. Shader Model 1.4, which is what the Radeon 9000 supports, doesn't have a lerp instruction, so it fakes it with a multiply and add anyway.

(I am so glad that later ATI cards do not have this problem.)

Re: [r643 and beyond]Graphic discoloration

Posted: Wed Jan 23, 2008 8:51 pm
by randi
After acquiring my own Radeon 9000 (and spending way too much time uninstalling and reinstalling drivers), I have verified that it does indeed seem impossible to program this card to not skip a palette entry. I've fixed it, working under the assumption that all R200-derived cards suffer this problem. I also fixed a few other issues that I found with this card.

Re: [r643 and beyond]Graphic discoloration

Posted: Thu Jan 24, 2008 2:59 am
by Anakin S.
Thank you very much.