MultiTexturing in Modern Opengl


I am very beginner in OpenGL.

I am trying to mix two textures in fragment shader for the same vertices but different texture coordinates like this,

Fragment Shader:

uniform sampler2D tex0;
uniform sampler2D tex1;

in vec2 coord0;
in vec2 coord1;


and in my client code I am driving the vertex shader with following VBO structure.

{vertices, coordinates for tex0, coordinates for tex1}

The problem is that although I am sampling tex1 with coord1 it seems that it is also being sampled by coord0 coordinates. What am I doing worng? or Could you please suggest a way to sample different textures with different texture coordinates but for the same vertices ?

Thank you in advance

Show us your code. Best is a minimal example that one can compile easily.

Is the texture uniform tex1 set to e.g. 1? Is your vertex format/source setup correctly?