Phong Shading - Troubles

Hello!

I need some help with my phong shading. I use opentk, C# and C++ (for the shaders).

I have to implement a light in my scene. The position of the light has to be indicated with this red cube in the middle of my scene. The calculation has to be done with phong shading.

The image below shows how the result should look like:

[ATTACH=CONFIG]1055[/ATTACH]

The image below shows how my current scene looks like:

[ATTACH=CONFIG]1053[/ATTACH]

Here is my code:

[ATTACH]1054[/ATTACH]

The main problems: the light position has a really strange behaviour, the light doesn’t have any impact on the second half of the plane and no impact on the character and the shading doesn’t really look like a phong shading.

I really don’t now what I am doing wrong.

I hope anyone of you can help me. That would be really great.

hi,

for the plane the basic problem may be the result of the dot() product.
if your light is shining straight from left to rigrt at its position, than the left half of the plane would be < 1.
but just a quick guess.

cu
uwi2k2

Thank you. You are right! :smiley: