3#define CAMERA_POSITIONS_LENGTH 1
4#define CAMERA_POSITIONS_ARRAY { (float4)(40, 0, 0, 0) }
5#define CAMERA_FACING_DIRECTIONS_LENGTH 1
6#define CAMERA_FACING_DIRECTIONS_ARRAY { (float4)(normalise((float3)(1, 1, 1)), 0) }
7#define FORCE_FREE_CAMERA true
8#define CAMERA_SPEED 5.0f
10#define USE_BOUNDING_VOLUME true
15#define SCENE_BACKGROUND_COLOUR (float3)(0.5f, 0.8f, 0.9f)
16#define MAXIMUM_MARCH_STEPS 200
17#define MAXIMUM_MARCH_DISTANCE 100.0f
18#define SURFACE_INTERSECTION_EPSILON 0.00001f
19#define CAMERA_FOCUS_DISTANCE 0.01f
21#define DO_GEOMETRY_GLOW true
22#define SCENE_GLOW_COLOUR (float3)(0.6f, 0.6f, 0.8f)
23#define SCENE_MAX_GLOW_DISTANCE 1.0f
30#define AMPLITUDE 10.0f
33#define FREQUENCY_MULTIPLIER 2.5f
34#define AMPLITUDE_MULTIPLIER 0.4f
38 float frequency =
SCALE;
44 height += amplitude *
snoise3(x * frequency, y * frequency, z * frequency);
54 float t = fmod(
time * 0.5f, 2.0f * PI);
57 light.
ambient = (float3)(0.1f, 0.1f, 0.1f);
58 light.
diffuse = (float3)(0.6f, 0.6f, 0.6f);
59 light.
specular = (float3)(1.0f, 1.0f, 1.0f);
60 light.
position = (float3)(50 * cos(t), -25, 50 * sin(t));
70 *distance = sphereSDF(position, (float3)(0), 10.0f) - max(
height, 0.0f) / 20.0f;
77 colour = (float3)(0, 0.05, 0.8);
85 colour = (float3)(0.9, 0.9, 1);
90 colour = (float3)(0.1, 0.5, 0.2);
98 material.
specular = (float3)(0.5f, 0.5f, 0.5f);
107 return SDF(position,
time, &distance);
112 return sphereSDF(position, (float3)(0), 11.0f);
118 SDF(position,
time, &distance);
const uint const uint height
const uint const uint const float time
Light getLight(float time)
#define FREQUENCY_MULTIPLIER
float getHeightAt(const float x, const float y, const float z)
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)
#define AMPLITUDE_MULTIPLIER
float snoise3(float x, float y, float z)
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.