Linear interpolation between VBOs

First time poster to the OpenGL boards, old time OpenGL coder back home after some DX years :slight_smile:

So… I’ve just learned how to work with VBOs but there’s something I can’t still figure out: how to send two distinct VBOs (same vertex count) to the shader and further interpolate between the two to get the final position (with interpolation as another float variable ranging from 0 to 1 that must be passed to the vertex program as well)

Any hints?
Thanks in advance,

andrea


glBindBuffer( GL_ARRAY_BUFFER, vbo1 );
glVertexAttribPointer( 0, 3, GL_FLOAT, GL_FALSE, 0, 0 );
glBindBuffer( GL_ARRAY_BUFFER, vbo2 );
glVertexAttribPointer( 1, 3, GL_FLOAT, GL_FALSE, 0, 0 );
glEnableVertexAttribArray( 0 );
glEnableVertexAttribArray( 1 );

Any hints?

This ought to be just about everything you need to know about how to send vertex data to OpenGL. And if it’s not there, it’s probably linked from there.

Your interpolation will need to be sent as a uniform parameter to the vertex shader.