@George++ :
sorry, I have forgoten to add some lines.
Here is a shader which works

The shader (with lighting and fog, but no normalmap, I can add it if needed) :
Vertex :
+ Code Snippet// terrain with 2 textures for ground and an alpha for the road
attribute highp vec3 position;
attribute vec2 uv;
attribute mediump vec3 normal;
varying highp vec3 posVarying;
varying mediump vec3 normalVarying;
varying mediump vec3 lightVarying;
mediump vec3 GetVSLighting( mediump vec3 normal, highp vec3 pos );
varying vec2 uv0Varying;
varying vec2 uv1Varying;
varying vec2 uv2Varying;
uniform vec4 uvBounds0;
uniform vec4 uvBounds1;
uniform vec4 uvBounds2;
uniform highp mat4 agk_WorldViewProj;
uniform highp mat3 agk_WorldNormal;
uniform highp mat4 agk_World;
uniform highp mat4 agk_ViewProj;
void main()
{
highp vec4 pos = agk_World * vec4(position,1.0);
gl_Position = agk_ViewProj * pos;
mediump vec3 norm = normalize(agk_WorldNormal * normal);
posVarying = pos.xyz;
normalVarying = norm;
lightVarying = GetVSLighting( norm, posVarying );
// TEXTURES COORDS
uv0Varying = uv * uvBounds0.xy + uvBounds0.zw;
uv1Varying = uv * uvBounds1.xy + uvBounds1.zw;
uv2Varying = uv * uvBounds2.xy + uvBounds2.zw;
}
pixel :
+ Code Snippet// constant values sent through from AGK code.
uniform sampler2D texture0; // ground
uniform sampler2D texture1; // road
uniform sampler2D texture2; // mask
varying vec2 uv0Varying; // uv for ground
varying vec2 uv1Varying; // uv for road
varying vec2 uv2Varying; // uv for the "alpha mask"
varying mediump vec3 normalVarying;
varying mediump vec3 lightVarying;
varying highp vec3 posVarying;
mediump vec3 GetPSLighting( mediump vec3 normal, highp vec3 pos );
mediump vec3 ApplyFog( mediump vec3 color, highp vec3 pointPos );
uniform mediump vec4 agk_MeshDiffuse;
uniform mediump vec4 agk_MeshEmissive;
void main()
{
// the textures coords
vec4 colorResult0 = texture2D(texture0, uv0Varying);
vec4 colorResult1 = texture2D(texture1, uv1Varying);
vec4 colorResult2 = texture2D(texture2, uv2Varying);
mediump vec4 blendTex = vec4(1.0,1.0,1.0,1.0);
mediump vec3 norm = normalize(normalVarying);
mediump vec3 light = lightVarying + GetPSLighting( norm, posVarying );
// mix with the R color of the 3rd texture. You can use the G and b channel for another road
gl_FragColor = mix(colorResult0, colorResult1, colorResult2.r);
// add light
gl_FragColor = gl_FragColor * blendTex * vec4(light,1.0) * agk_MeshDiffuse + agk_MeshEmissive;
// add fog
gl_FragColor.rgb = ApplyFog( gl_FragColor.rgb, posVarying );
}
The result :

@Hoyoyo80 :
You're right, the unreal/ unity/ godot render is really impressive, and better than AGk, for the moment

.
Global illumination in GLSL (not very easy ^^):
https://realtimeillumination.wordpress.com/tag/glsl/It's not only Global illumination (GI), I guess they have lots of parameters for lighting and a better render (shader, post-effect) :
- diffuse shader : in unity/unreal/godot we have the choice of the diffuse shader (lambert, oren-nayar...), with lots of parameters to change, in agk we have only one shader with no options.
- specular shader : in agk, we haven't that shader

. In other engine, same as diffuse shader : lots of choice and parameters to change
Lighting :
- all use lightmaps baked (or in realtime for PC) with internal lightmapper, GI probe, SSAO, Ambient Occlusion, and lots of other great parameters.
- in AppGameKit, we have only 2 basics lights (1 directional (sun) and pointlight) but, we can't even set the parameters of the light (fall of, attenuation, linear...).
- shadows : all 3 engines use soft shadows system. Currently, the shadow system isn't as good as the other engine.
- post-prod : they use post-fx like bloom, saturation/contraste... We can do that in AGk with fullscreenshader. For Dof and other interesting effect, you have the janbo shaders

.
Agk doesn't have a lightmap (like unity/godot or unreal), so we have to bake our lightmap in our 3Dmodeler.
If you want better lighting, you should use lightmap baked (from blender) :
Example of AppGameKit lighting :
- sun, ambient, shadow : not bad, but not very good ^^

- sun, ambient, no shadow, lightmap (baked) : much better

- Only the lightmap (baked) without texture, no light, no sun, no ambient, no shadow...
Note :
Lightmap is created in blender : with softshadows, AmbientOcclusion, GI... (mix of blender internal and cycle rendering)
@Mobius : agk is not only a langage.
From AppGameKit website : "AppGameKit is a game creation system for mobile cross platform development."

"game creation system" seems to be like "game engine + langage to use it" ^^