I am new to OpenGL ES programming and I am trying to debug my shader programming and I wonder if there is any way to log the value of a particular variable. For example, in the vertex shader program below, I would like to test the value returned by normal, basically, I was looking for something similar to NSLog...
attribute vec4 position;
attribute vec3 normal;
attribute vec2 texture;
varying vec2 v_texCoord;
varying float LightIntensity;
uniform mat4 modelViewProjectionMatrix;
uniform mat3 normalMatrix;
void main()
{
vec3 eyeNormal = normalize(normalMatrix * normal);
vec3 lightPosition = vec3(-1.0, 0.0, 3.0);
float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition)));
LightIntensity = nDotVP;
v_texCoord = texture;
gl_Position = modelViewProjectionMatrix * position;
}