PDA

View Full Version : False colors using shader



marcov
01-04-2009, 09:22 PM
I'm currently researching the feasability to show my 2D texture in false color.

Some points about the app that I have:
- a rectangle_ARB bmp. up to 4096x7000, but in this case way less, 0.5-1Mpixels
- currently it is 8-bit in the future also 12-bit (which will probably become 16-bit)
- There is some overlay drawn on top of the ARB. That is mostly important because of Depth_testing required, otherwise not.
- Using Mike Lischke's dglOpenGL headers.
- Speed, speed, speed. 10ms time budget. Card gf7x00+ or gf8x00 or even heavier in special cases.
- Older NV's had a palette extension but that is gone in modern cards. (and I need the more modern card (6x00/7x00 minimum) to upload such big BMPs 10+/s)

So in short, for every pixel in the bitmap, a lookup should be done in a 256 or 4096 table (1d texture I guess), probably using the (fragment?) shader.

Does anybody know an example for something that might look like this? Is it sane to begin with?

NecroDOME
02-04-2009, 07:47 AM
Most videocards are limited to a texture size of 4096x4096.

Texture lookups to convert color are easy to do in a shader. Currently I don't have an example, but I can help you if you have an OpenGL app that can render with shaders.

marcov
02-04-2009, 08:03 AM
Most videocards are limited to a texture size of 4096x4096.


Note that I have all this running, except for the false color bit. GF8 cards have 8192*8192, GF7 cards 4096*4096. Trick is that I pick the videocard we ship, usually so that it is just right for the job.

Since till now, the bottleneck is pretty much texture uploading, not shader performance, generally the speed is about the same across the same family of GPU (as long as not embedded). E.g. one can't really notice a difference between a 7300 and 7800



Texture lookups to convert color are easy to do in a shader. Currently I don't have an example, but I can help you if you have an OpenGL app that can render with shaders.


Thanks, I'll keep that in mind for when I'm a bit further.