Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-18 Thread Sergey Polischuk
Hi J-S. There one more point about available data size if you are using uniform arrays or uniform buffers: you should pack your data into vec4's if it possible, cause uniforms counts towards max size with some kind of slots, with one slot taking storage size of vec4; if you declare your

Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-18 Thread Glenn Waldron
J-S, Another uniform array snafu I ran into is this: different drivers may report the uniform location differently for arrays. Specifically: the ATI windows driver reports the uniform array location at array[0] and on NVIDIA it is reported as array. Both are valid, according to the spec. But OSG

Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-18 Thread Jean-Sébastien Guay
Hi Sergey, There one more point about available data size if you are using uniform arrays or uniform buffers: you should pack your data into vec4's if it possible, cause uniforms counts towards max size with some kind of slots, with one slot taking storage size of vec4; if you declare your

Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-18 Thread Jean-Sébastien Guay
Hi Glenn, This may not be relevant to your problem but it's a good thing to be aware of anyway when using arrays.. Definitely, thanks for the info. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com

Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-17 Thread Sergey Polischuk
Hi, J-S Uniform arrays maximum size is implementation dependent and about 4k-16k(+) floats in general. I personally used plain 1D\2D textures to store data for instancing. Another options as you mentioned is uniform buffers, textures and texture buffer objects. Uniform buffers max size is quite

Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-17 Thread Sergey Polischuk
Hi again, Wrote it wrong with sizes actually, uniform arrays in general goes in range of 512 - 4k floats max, and these limits counts towards size of all uniforms used in program summed, not each one of them individually. And uniform buffers should be at least 16k floats max if supported.

Re: [osg-users] Passing array of data to vertex shader - uniform array?

2011-02-17 Thread Jean-Sébastien Guay
Hi Sergey, Thanks for your guidance. The data I need per drawable might fit in 16k floats per drawable. I need a transform and a color, but the transform will always have a uniform scale, so that's: - 3 floats for translation - 4 floats for rotation quaternion - 1 float for uniform scale - 4