Part of the Khronos Group

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: can shaders draw indexed color arrays?

  1. #1

    can shaders draw indexed color arrays?

    I have some questions relating to shaders and whether or not they can perform array lookups fast enough to use them to draw indexed color arrays

    • Is this possible?
    • Would it be fast blitting pixels this way?
    • How would I do this effectivly?
    • Can you post a code example?

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Are you talking about using gl*DrawArrays*() to render (effectively) gl*DrawElements*() batches?

    Seems like that would prevent effective use of the post-vertex shader transform cache (to suppress needless vertex shader executions).

    Or are you literally just talking about using an indirect lookup to fetch your vertex colors? Say, store a color index in your vertex color atttribute and then in the shader do a uniform, texture, or buffer lookup using that index. If so, then I would expect this to be pretty fast. Put it in the fastest memory you can afford to based on its size.

  3. #3
    like using actual c# arrays as a indexed bitmap and palette and using shaders to look them up and draw them
    like this..
    Click image for larger version. 

Name:	Indexed_palette.jpg 
Views:	11 
Size:	7.3 KB 
ID:	2828

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts