Commit efe6f5c3 authored by blackle's avatar blackle
Browse files

Use 'MAXDEPTH' constant in shader that gets changed in makefile

parent 003e8cf7
......@@ -18,6 +18,8 @@ shader.frag.min : shader.frag Makefile
sed -i 's/m_reflectance/i/g' shader.frag.min
sed -i 's/m_transparency/c/g' shader.frag.min
sed -i 's/MAXDEPTH/18/g' shader.frag.min
sed -i 's/\bRay\b/Ra/g' shader.frag.min
sed -i 's/\bMat\b/Ma/g' shader.frag.min
......
......@@ -69,6 +69,7 @@ vec2 smatUnion(vec2 a, vec2 b, float k) {
}
vec2 bottle(vec3 point) {
//blackle were you raised in a barn? fix this shit!
float dist = length(point.xy);
......@@ -209,10 +210,10 @@ Ray transmissionForRay(Ray ray) {
}
// #define 18 18
Ray rayQueue[18];
Ray rayQueue[MAXDEPTH];
int raynum = 1;
void addToQueue(Ray ray) {
if (raynum >= 18) return;
if (raynum >= MAXDEPTH) return;
rayQueue[raynum] = ray;
raynum++;
}
......@@ -220,7 +221,7 @@ void addToQueue(Ray ray) {
void recursivelyRender(inout Ray ray) {
rayQueue[0] = ray;
for (int i = 0; i < 18; i++) {
for (int i = 0; i < MAXDEPTH; i++) {
if (i >= raynum) break;
castRay(rayQueue[i]);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment