OpenGL Shaders and Constants

I need to get a bunch of constant values ​​in my GLSL geometry shader . I tried it like this:

const int lookup[HUGE_NUMBER] = int[HUGE_NUMBER](1,32,...)

This works ... for some hardware. On ATI cards, I get warnings that the size of my geometric shader can lead to poor performance (sounds reasonable). On other cards (NV), the shader will not communicate due to insufficient memory. Defining persistent arrays seems like an unsupported hack.

So - how to go? I read about "persistent buffers" in the DirectX pipeline. Is there something similar? Or do I need to use textures?

+3
source share
1 answer

You can use at least one of the following interfaces:

  • Texture
  • Single buffer object
  • Texture letters
+5
source

All Articles