Skip to content

Commit

Permalink
Optimize visual effect
Browse files Browse the repository at this point in the history
  • Loading branch information
Ninputer committed Dec 29, 2011
1 parent ffbcdd9 commit 51ff437
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions AMPDemo/MandelbrotViewer/mandelbrot.cpp
Expand Up @@ -89,10 +89,15 @@ void generate_mandelbrot(
}
while((length_sqr < _F(4.0)) && (count < max_iter));

float h = sqrt(sin(count * 0.003067962f));
float normalc = count / 512.0f;
float h = sqrt(1.0f - 1.0f / (normalc + 1.0f));

//float h = sqrt(fabs(sin(count * 0.003067962f)));;
//float h = (float)count / 1024; //* 0.001953125f;
//h = 1.8f * fabs(0.5f - h + floor(h)) + 0.1f;

float bfactor = count >= max_iter ? 0.0f : 1.0f;

result[i] = set_hsb(h, 0.7f, (1.0f - h * h * 0.833333f));
result[i] = set_hsb(h, 0.7f, (1.0f - h * h * 0.833333f) * bfactor);
});
}

0 comments on commit 51ff437

Please sign in to comment.