- Joined
- Feb 10, 2009
- Messages
- 5,484
- Trophies
- 2
- Location
- Sacramento, California
- Website
- lazerlight.x10.mx
- XP
- 5,509
- Country
The GPU supports procedural textures, which includes a color LUT, but it's not completely documented and I don't know of anyone who has successfully achieved it. I will be toying with it this week though for usage in ScummVM.
Some data on it:
https://www.3dbrew.org/wiki/GPU/Procedural_Texture_Generation
https://www.3dbrew.org/wiki/GPU/Internal_Registers#GPUREG_PROCTEX_LUT
From what I understand, there is no actual texture/image data you can associated with it to abuse its color LUT capability. I hope I'm wrong though, so if you do find a way that allows you to use an indexed texture and draw it through that, it would be very much appreciated to fill us in.
There is, an alternative that StapleButter devised many months ago, but it's still being tinkered with. It abuses bumpmapping to use reflective color LUTs to mimic a kind of indexed texture, using the GPU_L8 format, with up to 255 usable colors out of 256. The remaining one is an invalid entry because the calculation done with this one entry (0x80) produces a zero-length normal, resulting in black texels. This is a problem because this invalid entry is still drawn, when it would likely be applicable as the transparency index, hence why it would be nice if there was some special way to crop it out with color/texture combiners (which is why I asked earlier). There is the GPU_LA8 format which includes its own alpha component per texel, but that is double the texture space needed. The problem with using bumpmapping? Greater load on the GPU than a regular texture (about 100% more, I think), because of having to calculate the normals based on the texture data.