About big uniform vector arrays

I’m implementing metaballs with GLSL. My method is to draw a quad as big as the screen in orthographic projection and make a varying vec3 to scan the whole screen. I send the ball coordinates as uniform vec3’s, one vec3 array for x, y and radius, another vec3 array for color. The problem is, I can’t render more than, say, 100 balls without the program starting to flicker weirdly. So, is my approach somehow very very wrong and what can I do to fix it? Should I use attributes or something else instead? I think 10064 = 2400 bytes should not be a problem with the hardware I’m using, I have a Corei7 920 / HD 4870 (512mb version) rig with 6GB of RAM.

Edit: ahem, I am quite embarrassed :smiley: I didn’t limit the rendering speed at all, which caused the flickering. Thank you and good night :slight_smile: But if you happen to have any information in some maximum amount of uniforms, let me know, the program still can’t handle very big arrays, it just crashes.

I just recently found uniform arrays to be problematic with ATi boards, though I haven’t really nailed it yet. Anyway, I think the best way to send large amounts of floats would be using a texture.

Yep, texture or texture buffer (core in 3.1). Check GL_MAX_TEXTURE_BUFFER_SIZE for the latter, GL_MAX_TEXTURE_SIZE for the former, and one of GL_MAX_(VERTEX|GEOMETRY|FRAGMENT)UNIFORM_COMPONENTS, GL_MAX_BINDABLE_UNIFORM_SIZE_EXT/GL_MAX(VERTEX|GEOMETRY|FRAGMENT)BINDABLE_UNIFORMS_EXT or GL_MAX_UNIFORM_BLOCK_SIZE/GL_MAX(VERTEX|GEOMETRY|FRAGMENT)_UNIFORM_BLOCKS for uniform (buffer/block) limits, depending on your hardware and OpenGL version.