Jump to content

  • Log In with Google      Sign In   
  • Create Account


#ActualDmitryNik

Posted 06 November 2012 - 02:38 PM

Normal vectors are not zero. I've checked it. Also even custom point lightning doesn't work. And this is very strange. Since I take the light position and the Vertex position, then the "ray" is created. After that the dot product is calculated(DOT(ray, normal)). Moreover the ray is normalized. I've tried this effect on the small mesh and it worked.



ADDED:

Yeees! Problem solved!!! Posted Image

The only reason WHY lighting doesn't work was in the order in which statements were written! Before putting vertices into the buffer we have to calculate the normal component of the each vertex. And ONLY after that we can put it in the buffer.Posted Image

#1DmitryNik

Posted 06 November 2012 - 02:07 PM

Normal vectors are not zero. I've checked it. Also even custom point lightning doesn't work. And this is very strange. Since I take the light position and the Vertex position, then the "ray" is created. After that the dot product is calculated(DOT(ray, normal)). Moreover the ray is normalized. I've tried this effect on the small mesh and it worked.

PARTNERS