Original Post
i want to project a texture onto a terrain with glsl. my vertex shader looks like:
const vec4 xplane = vec4(10.0,0.0,0.0,0.0);
const vec4 yplane = vec4(0.0,10.0,0.0,0.0);
void main()
{
vec4 ambient = vec4(0.2,0.2,0.2,1.0);
vec4 x = gl_ModelViewMatrixInverse * xplane;
vec4 y = gl_ModelViewMatrixInverse * yplane;
vec4 p = gl_ModelViewMatrix * gl_Vertex;
float s = p.x * x.x + p.y * x.y + p.z * x.z + x.w * p.w;
float t = p.x * y.x + p.y * y.y + p.z * y.z + y.w * p.w;
gl_TexCoord[1] = vec4(s,t,1.0,1.0); whats wrong here. i need something like the fixed pipeline GL_EYE_LINEAR texgen mode.