Jump to content

  • Log In with Google      Sign In   
  • Create Account

#ActualAdam_42

Posted 03 March 2013 - 11:49 AM

Are your normals normalized? Interpolation can easily change their length and cause problems.

 

By the way if you post code that can be compiled, it's easier for other people to debug it.

 

Also

 

reflection = normalize(2 * lightIntensity * input.normal - (-lightvec));

 

Is equivalent to:

 

reflection = normalize(input.normal - (-lightvec));

 

You might find http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model useful.


#1Adam_42

Posted 03 March 2013 - 11:49 AM

Are your normals normalized? Interpolation can easily change their length and cause problems.

 

By the way if you post code that can be compiled, it's easier for other people to debug it.

 

Also

 

"reflection = normalize(2 * lightIntensity * input.normal - (-lightvec));"

 

Is equivalent to:

 

reflection = normalize(input.normal - (-lightvec));

 

You might find http://en.wikipedia.org/wiki/Blinn%E2%80%93Phong_shading_model useful.


PARTNERS