3#define CAMERA_POSITIONS_LENGTH 1
4#define CAMERA_POSITIONS_ARRAY { (float4)(10, 0, 0, 0)}
5#define CAMERA_FACING_DIRECTIONS_LENGTH 1
6#define CAMERA_FACING_DIRECTIONS_ARRAY { (float4)(normalise((float3)(1, 0, 0)), 0) }
7#define FORCE_FREE_CAMERA true
17#define MAXIMUM_MARCH_STEPS 300
18#define MAXIMUM_MARCH_DISTANCE 100.0f
19#define SURFACE_INTERSECTION_EPSILON 0.0001f
20#define CAMERA_SPEED 1.0f
21#define SCENE_BACKGROUND_COLOUR (float3)(1.0f, 0.5f, 0.3f)
22#define SCENE_GLOW_COLOUR (float3)(0.8f, 0.8f, 0.8f)
23#define SCENE_MAX_GLOW_DISTANCE 0.1f
24#define CAMERA_FOCUS_DISTANCE 0.1f
25#define SURFACE_SHADOW_FALLOFF 5.0f
34 light.
ambient = (float3)(0.1f, 0.1f, 0.1f);
35 light.
diffuse = (float3)(0.5f, 0.5f, 0.5f);
36 light.
specular = (float3)(1.0f, 1.0f, 1.0f);
44 float cubeDistance = 0.0f;
45 float tetrahedronDistance = 0.0f;
47 Material cube = sierpinskiCubeSDF((float3)(1, 1, 1) - position, 7, &cubeDistance);
48 Material tetrahedron = sierpinskiTetrahedronSDF((float3)(-5, 0, 0) - position, 12, 100000000, &tetrahedronDistance);
50 if (cubeDistance < tetrahedronDistance)
52 *distance = cubeDistance;
57 *distance = tetrahedronDistance;
65 return SDF(position,
time, &distance);
70 return min(boxSDF(position, (float3)(0, 0, 0), 1.0f), sphereSDF(position, (float3)(-5, 0, 0), 1.75f));
const uint const uint const float time
Light getLight(float time)
Material SDF(const float3 position, const float time, float *distance)
Material getMaterial(float3 position, float time)
float boundingVolumeDE(float3 position, float time)
float DE(float3 position, float time)
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.