For the past few months we have been modifying the path tracer demo to create a program that lets the user create their own material programs with multiple BRDFs. However we have run into a little bit of a wall. The way our path tracer works is for every pixel a ray is traced and a material program is called. That material program then deals with sending off its own ray’s to calculate the BRDSs that it may include making our path tracer very recursive. However It seems to only get to around depth 4 when the exception program is called. I think it could be that we are running out of stack. Is there a way to test if this is the case and this does turn out to be the problem is there a way we can increase our stack size?