The fragment shader in the AMD OpenGL ES SDK for 3.1 (as of 5/13/2016) is this:
precision highp float;
uniform vec4 lightVec;
uniform sampler2D textureUnit0;
varying vec2 vTexCoord;
varying vec3 vNormal;
void main()
{
vec4 diff = vec4(dot(lightVec.xyz,normalize(vNormal)).xxx, 1);
gl_FragColor = diff * texture(textureUnit0, vTexCoord);
}
Which is is flat out wrong. The closest I have gotten to correcting it is:
precision highp float;
uniform vec4 lightVec;
uniform sampler2D textureUnit0;
varying vec2 vTexCoord;
varying vec3 vNormal;
void main()
{
vec4 diff = vec4(dot(lightVec.xyz,normalize(vNormal)).xxx, 1);
gl_FragColor = diff * texture2D(textureUnit0, vTexCoord);
}
Which is just turning the texture into texture2D on the last line.
No clue what is going on with trying to compute the diffuse shader. It's using dot to get a float, and calling a swizzle (I think that's what you call the .xxx operator) on the float to try and duplicate it?
How does someone learn more about shaders easily? It seems like a very tough area to become skilled at.