Use arrow keys to navigate slideshow, and press F11 for fullscreen
. |
|||||||
. | . | . | . | . | . | . | . |
0.5 + 0.5 * cos(x) in the range of -Pi to Pi
Wed Aug 11 20:14:17 EDT 2021 Note: KdotJPG informs me of a more efficient polynomial that involves no sqrt() or trig functions which produces nearly the same curve:
Here's a graph, the green line is (1 - s)^2, the blue line is 0.5 + 0.5 * cos(sqrt(s) * PI).
|
|
Abusing cosine some more
x = dh/dx / 127.0f + 0.5; y = dh/dy / 127.0f + 0.5; z = 1.0f;
red = normal.x * 255; green = normal.y * 255; blue = normal.z * 255;