Realtime Fractal Renderer Documentation
sierpinski_tetrahedron.cl
Go to the documentation of this file.
1#define CAMERA_POSITIONS_LENGTH 1
2#define CAMERA_POSITIONS_ARRAY { (float4)(-0.4, -0.6, -0.4, 0) }
3
4#define CAMERA_FACING_DIRECTIONS_LENGTH 1
5#define CAMERA_FACING_DIRECTIONS_ARRAY { (float4)(normalise((float3)(-0.5, -0.5, -0.5)), 0.0f) }
6
7#define MAXIMUM_MARCH_STEPS 200
8#define MAXIMUM_MARCH_DISTANCE 10.0f
9
10#define SURFACE_INTERSECTION_EPSILON 0.000001f
11
12#define FORCE_FREE_CAMERA true
13#define CAMERA_SPEED 1.0f
14
15#define SCENE_LIGHT_POSITION (float3)(0, 0, 0)
16#define SCENE_LIGHT_COLOUR (float3)(1.0f, 1.0f, 1.0f)
17#define SCENE_BACKGROUND_COLOUR (float3)(0.78f, 0.78f, 0.73f)
18
19#define DO_LAMBERTIAN_REFLECTANCE true
20#define DO_SOFT_SHADOWS true
21
22#include "sierpinski.cl"
23
24#include "types.cl"
25#include "sdf.cl"
26
28{
29 Light light;
30 light.ambient = (float3)(0.2f, 0.2f, 0.2f);
31 light.diffuse = (float3)(0.5f, 0.5f, 0.5f);
32 light.specular = (float3)(1.0f, 1.0f, 1.0f);
33 light.position = (float3)(0.0, -4, -4);
34
35 return light;
36}
37
38Material getMaterial(float3 position, float time)
39{
40 float distance;
41 return sierpinskiTetrahedronSDF(position, 15, 100000000, &distance);
42}
43
44float DE(float3 position, float time)
45{
46 float distance;
47 sierpinskiTetrahedronSDF(position, 15, 100000000, &distance);
48 return distance;
49}
50
51#include "main.cl"
const uint const uint const float time
Definition: main.cl:368
Light getLight(float time)
Material getMaterial(float3 position, float time)
float DE(float3 position, float time)
A struct representing a light, for use with the phong illumination model.
Definition: types.cl:32
float3 ambient
Definition: types.cl:34
float3 position
Definition: types.cl:33
float3 diffuse
Definition: types.cl:35
float3 specular
Definition: types.cl:36
A struct representing a geometry material, for use with the Phong reflection model.
Definition: types.cl:20