iPoint.x = iPoint.x + ref.x * t1;

iPoint.y = iPoint.y + ref.y * t1;

iPoint.z = iPoint.z + ref.z * t1;

This looks wrong to me.

Your intersection code returns 0 or 1 for t1, so that code does not move your sampling point to the intersection point, it just moves it along the vector towards your intersection point.

Hello people !!

I am trying develop a ray tracer in GLSL. I have already implemented shadows and phong. I am working with spheres and planes only. Now when i was implementing reflections i am having strange problem in which i get proper reflections of sphere in the plane, but when it comes to plane’s reflection in spheres and mutual reflection on spheres it only produces some kind of noise.

Interesting fact is that shape of this noise is exactly same as reflection’s should be. I cant figure out the problem despite of too much efforts in debugging….please help !!

link to GLSL sandbox containing my shader….

http://glsl.heroku.com/e#808.11