iOS example working based on modified OpenGL3 example + Synergy

This commit is contained in:
Joel Davis
2015-06-15 09:23:57 -07:00
committed by ocornut
parent f4fc008a2a
commit eee6dab226
25 changed files with 3184 additions and 0 deletions

View File

@ -0,0 +1,10 @@
//
// Shader.fsh
// imguiex
varying lowp vec4 colorVarying;
void main()
{
gl_FragColor = colorVarying;
}

View File

@ -0,0 +1,25 @@
//
// Shader.vsh
// imguiex
attribute vec4 position;
attribute vec3 normal;
varying lowp vec4 colorVarying;
uniform vec3 diffuseColor;
uniform mat4 modelViewProjectionMatrix;
uniform mat3 normalMatrix;
void main()
{
vec3 eyeNormal = normalize(normalMatrix * normal);
vec3 lightPosition = vec3(0.0, 0.0, 1.0);
float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition)));
vec3 colorLit = diffuseColor * nDotVP;
colorVarying = vec4( colorLit.x, colorLit.y, colorLit.z, 1.0 );
gl_Position = modelViewProjectionMatrix * position;
}