14 float t = fmod(
time * 0.5f, 2.0f * PI);
17 light.
ambient = (float3)(0.1f, 0.1f, 0.1f);
18 light.
diffuse = (float3)(0.6f, 0.6f, 0.6f);
19 light.
specular = (float3)(1.0f, 1.0f, 1.0f);
30 const float power = 7.75f +
time * 0.01f;
34 float4 colorParams = (float4) (absolute(w), m);
39 dz = 8.0f * pow(sqrt(m), 7.0f) * dz + 1.0f;
43 float b = power * acos(w.y / r);
44 float a = power * atan2(w.x, w.z);
45 w = pow(r, power) * (float3) (sin(b) * sin(a), cos(b), sin(b) * cos(a)) + position;
47 colorParams = min(colorParams, (float4) (absolute(w), m));
50 if (m > 256.0f)
break;
53 material.
ambient = (float3)(colorParams.x, colorParams.y, colorParams.z);
55 material.
specular = (float3)(0.5f, 0.5f, 0.5f);
59 *distance = opSubtraction(0.5f - position.x -
time * 0.01f, 0.25f * log(m) * sqrt(m) / dz);
66 return opSubtraction(0.5f - position.x -
time * 0.01f, sphereSDF(position, (float3)(0, 0, 0), 1.25f));
const uint const uint const float time
Light getLight(float time)
float boundingVolumeDE(float3 position, float time)
Material mandelbulbSDF(const float3 position, const float time, float *distance)
A struct representing a light, for use with the phong illumination model.
A struct representing a geometry material, for use with the Phong reflection model.