Hi there, I'm new in Computer Graphics. so I started writing Ray Tracer and here is't.
and there are some questions I would like to answer..
I wrote iterative ray trace, I have one global array of stuctures; each structure can contain state of each step for ray trace.
and it's size is 2 ^ Depth; because in each state I may throw 2 rays(max), reflection or refraction ray, or otherwise its diffuse object so it doesn't need any other calculations.
at last I loop from last state to first one and update parent states.
also I'm passing all the information about my objects with uniforms. and drawing just single rectangle to make opengl call fragment shader for each pixel.
It's my solution and isn't too fast.. got fps 10.
so If I'm doing something wrongly or there is a some better way, I'll be glad to listen.
thanks.