I have got another question, to go with the flow with the story, i will post it in my old thread.
The terrain rendering is coming along nicely, but im having an problem with interpolating in the shader.
Example (the texturing is not complete, evrything above some value is atomaticly grass, this will get replaced by an noise function):
Bigger version: http://i49.tinypic.com/fyh8i0.png
Im sending an float value using the vbo, telling the shader what points needs to blend:
glVertexAttribPointer(attrib, 1, GL_FLOAT, false, stride, 32);
But because this is for each vertex, it gets blocky like shown above.
Is there an way to smooth this value out for an rounder effect, like with normals (not using splatmaps)?
Corresponding fragment-shader fragment
if(t > 1){
dist = (2-t)*0.6;
c2 = texture2D(Texture0, vec2(gl_TexCoord[0].x+0.5, gl_TexCoord[0].y));
c = mix(c2, c, dist);
}
- dirt & grass image are stored in the same texture, hence why im using +0.5 (take part 2 of texture)
** mix can also mess up textures with some combinations, need to find some replacement for that one to, but i guess thats easyer then my first problem.