I'm trying to do cube mapping. Problem is that I'm getting this: This is what I get when I rotate it:
But it should look like this
Here is code for vertex shader
varying vec2 tex_coord;
void main()
{
vec3 v = vec3(gl_ModelViewMatrix * gl_Vertex);
gl_TexCoord[0].stp = normalize(gl_Vertex.xyz);
gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex;
//gl_ModelViewMatrix * gl_Vertex
}
fragment shader
uniform samplerCube _tex;
void main()
{
//gl_FragColor = vec4(1.0, 1.0, 1.0, 1.0);
gl_FragColor = textureCube(_tex, gl_TexCoord[0].stp);
}
Could you please tell me what am I doing wrong?