The World’s Largest Online Community for Developers

'; opengl - Size limit of a texture or an UBO, need help finding an other solution - LavOzs.Com

I'm trying to render multiples mesh with different height on each vertices with a glDrawElementsInstancedcall.

To do so I pass the height of each vertices with a texture, but I'm hurting a huge limit, I can't pass more than 16384 float in a texture. So I thought I could use a UBO but it's limited the same way, so what should I do? Is there any other way to send a float to each vertex of each instance? Or I will have to use an other render methods?

If I have to change my render method, what would be the best replacement to keep the best performance as possible?

Shader storage buffers are pretty similar to UBO's, but without the size limitations. Alternatively you could look at using 3D indexing for textures (i.e. use 2D texture arrays), or simply split the rendering into multiple chunks that fit the current maximums.

OpenGL - Unable to render colors other than white after texture mapping
Combining vertex arrays with textures in OpenGL
Passing a list of values to fragment shader
Rendering meshes with multiple indices
Wrapping texture co-ordinates on a variable-size quad?
Find out the texture portion needed for a mesh
rendering crowds in OpenGL with VBOs
Passing only 1 float in a sampler1D
GLSL Sending color data form Fragment Shader to Vertex Shader seems to be always equal to 0