OpenGL ES 2.0 lights study project

Avg Bid (USD)
Project Budget (USD)
$30 - $250

Project Description:
This is a very simple study style project for someone with 3D background. I'm just trying to learn OpenGL ES 2.0 lights and stuck on a problem with lighting correctly models with Phong edge smoothing normals.

Attached is a simple XCode project along with my simple 3d model .obj. This is a standard iOS 'OpenGL Game' template project generated by XCode with the only change I replaced their default cube model mesh data with the one from the included .obj. The other change is I'm rendering the model twice with slight translation on X axis.

The model actually appears to render correctly (see attached screenshot). However, each object instance is lit absolutely identical to the other despite them being offset in the scene. I suppose thats because the example XCode auto-generated vertex shader is not taking vertex position into account, only relying on the directional light vs vertex normal angle to calculate diffusion. The light is not interpolated across the whole scene, every object is just lit in the same way as the other.

This is what the auto-generated template vertex shader looks like:

void main()
vec3 eyeNormal = normalize(normalMatrix * normal);
vec3 lightPosition = vec3(0.0, 0.0, 1.0);
vec4 diffuseColor = vec4(0.4, 0.4, 1.0, 1.0);
float nDotVP = max(0.0, dot(eyeNormal, normalize(lightPosition)));

colorVarying = diffuseColor * nDotVP;

gl_Position = modelViewProjectionMatrix * position;

So this project is for changing the shaders code in such a way that actual vertex position is taken into account when computing per-vertex lighting. Please make sure you understand what I need exactly before you bid on it.

On that screenshot I attached, you can clearly see that the two blocks are lit identically which looks weird. You get a feeling that the second one is brighter while in fact if you check the actual pixel colors the two boxes are lit identicaly.

Instead, I want the light to be interpolated across the whole scene so there is no weird light step between two adjacent blocks as you can see on the screenshot. I believe this method is called Phong shading.


Skills required:
iPhone, Mobile Phone, OpenGL
Additional Files: Screen%2BShot%2B2013-04-07%2Bat%2B17.11.41.png
About the employer:
Public Clarification Board
Bids are hidden by the project creator. Log in as the employer to view bids or to bid on this project.
You will not be able to bid on this project if you are not qualified in one of the job categories. To see your qualifications click here.

$ 144
in 3 days
$ 250
in 3 days
$ 242
in 5 days
$ 315
in 5 days
Hire maolongdong
$ 220
in 1 days