Realtime Fractal Renderer Documentation
defines.cl File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define INCREASE_INTERSECTION_EPSILON_LINEARLY   true
 Whether to increase the intersection epsilon value linearly More...
 
#define USE_BOUNDING_VOLUME   false
 Whether to use the bounding volume optimisation. float boundingVolumeDE(float3 position, float time) must be defined in the scene file for this to work More...
 
#define DO_AMBIENT_LIGHTING   true
 Whether to enable ambient lighting More...
 
#define DO_DIFFUSE_LIGHTING   true
 Whether to enable diffuse lighting More...
 
#define DO_SPECULAR_HIGHLIGHTS   true
 Whether to enable specular highlights More...
 
#define DO_GEOMETRY_GLOW   false
 Whether to enable geometry glow More...
 
#define DO_SOFT_SHADOWS   false
 Whether to enable the soft shadows feature More...
 
#define DO_HARD_SHADOWS   false
 Whether to enable the hard shadows feature More...
 
#define DO_GAMMA_CORRECTION   false
 Whether to enable gamma correction or not More...
 
#define DO_RENDER_SURFACE_NORMALS   false
 Whether to render surface normals More...
 
#define DO_RENDER_MARCHING_ITERATIONS   false
 Whether to render the number of ray marching iterations taken More...
 
#define DISPLAY_BOUNDING_VOLUME   false
 Whether to display the bounding volume. USE_BOUNDING_VOLUME must be enabled More...
 
#define BOUNDING_VOLUME_COLOUR   (float3)(0.4f, 0.1f, 0.1f)
 Colour to display the bounding volume when DISPLAY_BOUNDING_VOLUME is enabled More...
 
#define CAMERA_VERTICAL_FOV_DEGREES   40.0f
 Camera vertical field of view in degrees More...
 
#define CAMERA_FOCUS_DISTANCE   0.1f
 Camera focus distance in world units More...
 
#define CAMERA_UP_AXIS   (float3)(0, 1, 0)
 Camera up axis. Must be a normalised float3 More...
 
#define CAMERA_SPEED   5.0f
 Speed of the camera when controlling it manually More...
 
#define CAMERA_DO_LOOP   false
 Whether the camera should return to the starting position once it reaches the end position. Only used if the camera is using a camera path More...
 
#define CAMERA_POSITIONS_ARRAY   { (float4)(0, 0, 0, 0) }
 Array of camera world positions and times, used when calculating camera paths. Each value in the array should be in the format (float4)(x, y, z, time). More...
 
#define CAMERA_FACING_DIRECTIONS_ARRAY   { (float4)(normalise((float3)(1, 1, 1)), 0.0f) }
 Array of camera normalised facing directions and times, used when calculating camera paths. Each value in the array should be in the format (float4)(x, y, z, time). More...
 
#define CAMERA_POSITIONS_LENGTH   1
 The length of the array specified by CAMERA_POSITIONS_ARRAY More...
 
#define CAMERA_FACING_DIRECTIONS_LENGTH   1
 The length of the array specified by CAMERA_FACING_DIRECTIONS_ARRAY More...
 
#define FORCE_FREE_CAMERA   false
 Whether to force the camera to use player input instead of a camera path More...
 
#define BENCHMARK_START_STOP_TIME_DONT_DO_TIMED   (float2)(-1, -1)
 
#define BENCHMARK_START_STOP_TIME   BENCHMARK_START_STOP_TIME_DONT_DO_TIMED
 The start and stop time that the benchmarker should use. If the values are negative, then the benchmarker will run for the entire durarion that the scene is active More...
 
#define SCENE_GLOW_COLOUR   (float3)(1)
 Colour of the glow effect in the scene. DO_GEOMETRY_GLOW must be enabled More...
 
#define SCENE_MAX_GLOW_DISTANCE   10.0f
 Maximum distance of the glow effect. DO_GEOMETRY_GLOW must be enabled More...
 
#define SCENE_BACKGROUND_COLOUR   (float3)(0)
 Background colour for the scene More...
 
#define FLOAT_MAX_VALUE   3e38
 Approximate value for a float More...
 
#define MAXIMUM_MARCH_STEPS   100
 Maximum number of iterations each ray can complete More...
 
#define MAXIMUM_MARCH_DISTANCE   1000.0f
 Maximum distance in world units that each ray can travel More...
 
#define SURFACE_INTERSECTION_EPSILON   0.001f
 Epsilon value used to define the maximum distance which is considered a ray collision More...
 
#define LINEAR_INTERSECTION_EPSILON_MULTIPLIER   0.75f
 Multiplier used to determine how quickly SURFACE_INTERSECTION_EPSILON should increase as each ray gets further away from the camera More...
 
#define SURFACE_NORMAL_EPSILON   0.001f
 Epsilon value used to calculate surface the normal of geometry More...
 
#define BOUNDING_VOLUME_INTERSECTION_EPSILON   0.1f
 Epsilon value used for determining ray collisions with the a bounding volume More...
 
#define SURFACE_SHADOW_EPSILON   0.1f
 Epsilon value used when calculating shadows on geometry. Represents the distance at which shadow checks start being made. Must be greater than SURFACE_INTERSECTION_EPSILON to prevent artifacting More...
 
#define SURFACE_SHADOW_FALLOFF   5.0f
 Falloff value used when calculating soft shadows More...
 
#define GAMMA_CORRECTION_STRENGTH   0.45f
 Strength of gamma correction. DO_GAMMA_CORRECTION must be enabled More...
 

Macro Definition Documentation

◆ BENCHMARK_START_STOP_TIME

#define BENCHMARK_START_STOP_TIME   BENCHMARK_START_STOP_TIME_DONT_DO_TIMED

The start and stop time that the benchmarker should use. If the values are negative, then the benchmarker will run for the entire durarion that the scene is active

Returns
float2

Definition at line 200 of file defines.cl.

◆ BENCHMARK_START_STOP_TIME_DONT_DO_TIMED

#define BENCHMARK_START_STOP_TIME_DONT_DO_TIMED   (float2)(-1, -1)

Definition at line 194 of file defines.cl.

◆ BOUNDING_VOLUME_COLOUR

#define BOUNDING_VOLUME_COLOUR   (float3)(0.4f, 0.1f, 0.1f)

Colour to display the bounding volume when DISPLAY_BOUNDING_VOLUME is enabled

Returns
float3

Definition at line 91 of file defines.cl.

◆ BOUNDING_VOLUME_INTERSECTION_EPSILON

#define BOUNDING_VOLUME_INTERSECTION_EPSILON   0.1f

Epsilon value used for determining ray collisions with the a bounding volume

Returns
float

Definition at line 262 of file defines.cl.

◆ CAMERA_DO_LOOP

#define CAMERA_DO_LOOP   false

Whether the camera should return to the starting position once it reaches the end position. Only used if the camera is using a camera path

Returns
bool

Definition at line 128 of file defines.cl.

◆ CAMERA_FACING_DIRECTIONS_ARRAY

#define CAMERA_FACING_DIRECTIONS_ARRAY   { (float4)(normalise((float3)(1, 1, 1)), 0.0f) }

Array of camera normalised facing directions and times, used when calculating camera paths. Each value in the array should be in the format (float4)(x, y, z, time).

  • If it is defined as an empty array, then one default direction will be used
  • If it is defined as a single direction, then the scene will use a controllable camera
  • If it is defined as more than one direction, then the scene will use a camera path

CAMERA_POSITIONS_ARRAY and CAMERA_FACING_DIRECTIONS_ARRAY must both have only one element for the controllable camera to be selected.

Returns
float4[]

Definition at line 169 of file defines.cl.

◆ CAMERA_FACING_DIRECTIONS_LENGTH

#define CAMERA_FACING_DIRECTIONS_LENGTH   1

The length of the array specified by CAMERA_FACING_DIRECTIONS_ARRAY

Returns
int

Definition at line 183 of file defines.cl.

◆ CAMERA_FOCUS_DISTANCE

#define CAMERA_FOCUS_DISTANCE   0.1f

Camera focus distance in world units

Returns
float

Definition at line 109 of file defines.cl.

◆ CAMERA_POSITIONS_ARRAY

#define CAMERA_POSITIONS_ARRAY   { (float4)(0, 0, 0, 0) }

Array of camera world positions and times, used when calculating camera paths. Each value in the array should be in the format (float4)(x, y, z, time).

  • If it is defined as an empty array, then one default position will be used
  • If it is defined as a single position, then the scene will use a controllable camera
  • If it is defined as more than one position, then the scene will use a camera path

CAMERA_POSITIONS_ARRAY and CAMERA_FACING_DIRECTIONS_ARRAY must both have only one element for the controllable camera to be selected.

Returns
float4[]

Definition at line 150 of file defines.cl.

◆ CAMERA_POSITIONS_LENGTH

#define CAMERA_POSITIONS_LENGTH   1

The length of the array specified by CAMERA_POSITIONS_ARRAY

Returns
int

Definition at line 176 of file defines.cl.

◆ CAMERA_SPEED

#define CAMERA_SPEED   5.0f

Speed of the camera when controlling it manually

Returns
float

Definition at line 121 of file defines.cl.

◆ CAMERA_UP_AXIS

#define CAMERA_UP_AXIS   (float3)(0, 1, 0)

Camera up axis. Must be a normalised float3

Returns
float3

Definition at line 115 of file defines.cl.

◆ CAMERA_VERTICAL_FOV_DEGREES

#define CAMERA_VERTICAL_FOV_DEGREES   40.0f

Camera vertical field of view in degrees

Returns
float

Definition at line 103 of file defines.cl.

◆ DISPLAY_BOUNDING_VOLUME

#define DISPLAY_BOUNDING_VOLUME   false

Whether to display the bounding volume. USE_BOUNDING_VOLUME must be enabled

Returns
bool

Definition at line 85 of file defines.cl.

◆ DO_AMBIENT_LIGHTING

#define DO_AMBIENT_LIGHTING   true

Whether to enable ambient lighting

Returns
bool

Definition at line 25 of file defines.cl.

◆ DO_DIFFUSE_LIGHTING

#define DO_DIFFUSE_LIGHTING   true

Whether to enable diffuse lighting

Returns
bool

Definition at line 31 of file defines.cl.

◆ DO_GAMMA_CORRECTION

#define DO_GAMMA_CORRECTION   false

Whether to enable gamma correction or not

Returns
bool

Definition at line 65 of file defines.cl.

◆ DO_GEOMETRY_GLOW

#define DO_GEOMETRY_GLOW   false

Whether to enable geometry glow

Returns
bool

Definition at line 43 of file defines.cl.

◆ DO_HARD_SHADOWS

#define DO_HARD_SHADOWS   false

Whether to enable the hard shadows feature

Returns
bool

Definition at line 55 of file defines.cl.

◆ DO_RENDER_MARCHING_ITERATIONS

#define DO_RENDER_MARCHING_ITERATIONS   false

Whether to render the number of ray marching iterations taken

Returns
bool

Definition at line 79 of file defines.cl.

◆ DO_RENDER_SURFACE_NORMALS

#define DO_RENDER_SURFACE_NORMALS   false

Whether to render surface normals

Returns
bool

Definition at line 73 of file defines.cl.

◆ DO_SOFT_SHADOWS

#define DO_SOFT_SHADOWS   false

Whether to enable the soft shadows feature

Returns
bool

Definition at line 49 of file defines.cl.

◆ DO_SPECULAR_HIGHLIGHTS

#define DO_SPECULAR_HIGHLIGHTS   true

Whether to enable specular highlights

Returns
bool

Definition at line 37 of file defines.cl.

◆ FLOAT_MAX_VALUE

#define FLOAT_MAX_VALUE   3e38

Approximate value for a float

Returns
float

Definition at line 226 of file defines.cl.

◆ FORCE_FREE_CAMERA

#define FORCE_FREE_CAMERA   false

Whether to force the camera to use player input instead of a camera path

Returns
bool

Definition at line 189 of file defines.cl.

◆ GAMMA_CORRECTION_STRENGTH

#define GAMMA_CORRECTION_STRENGTH   0.45f

Strength of gamma correction. DO_GAMMA_CORRECTION must be enabled

Returns
float

Definition at line 281 of file defines.cl.

◆ INCREASE_INTERSECTION_EPSILON_LINEARLY

#define INCREASE_INTERSECTION_EPSILON_LINEARLY   true

Whether to increase the intersection epsilon value linearly

Returns
bool

Definition at line 11 of file defines.cl.

◆ LINEAR_INTERSECTION_EPSILON_MULTIPLIER

#define LINEAR_INTERSECTION_EPSILON_MULTIPLIER   0.75f

Multiplier used to determine how quickly SURFACE_INTERSECTION_EPSILON should increase as each ray gets further away from the camera

Returns
float

Definition at line 250 of file defines.cl.

◆ MAXIMUM_MARCH_DISTANCE

#define MAXIMUM_MARCH_DISTANCE   1000.0f

Maximum distance in world units that each ray can travel

Returns
float

Definition at line 238 of file defines.cl.

◆ MAXIMUM_MARCH_STEPS

#define MAXIMUM_MARCH_STEPS   100

Maximum number of iterations each ray can complete

Returns
int

Definition at line 232 of file defines.cl.

◆ SCENE_BACKGROUND_COLOUR

#define SCENE_BACKGROUND_COLOUR   (float3)(0)

Background colour for the scene

Returns
float3

Definition at line 218 of file defines.cl.

◆ SCENE_GLOW_COLOUR

#define SCENE_GLOW_COLOUR   (float3)(1)

Colour of the glow effect in the scene. DO_GEOMETRY_GLOW must be enabled

Returns
float3

Definition at line 206 of file defines.cl.

◆ SCENE_MAX_GLOW_DISTANCE

#define SCENE_MAX_GLOW_DISTANCE   10.0f

Maximum distance of the glow effect. DO_GEOMETRY_GLOW must be enabled

Returns
float

Definition at line 212 of file defines.cl.

◆ SURFACE_INTERSECTION_EPSILON

#define SURFACE_INTERSECTION_EPSILON   0.001f

Epsilon value used to define the maximum distance which is considered a ray collision

Returns
float

Definition at line 244 of file defines.cl.

◆ SURFACE_NORMAL_EPSILON

#define SURFACE_NORMAL_EPSILON   0.001f

Epsilon value used to calculate surface the normal of geometry

Returns
float

Definition at line 256 of file defines.cl.

◆ SURFACE_SHADOW_EPSILON

#define SURFACE_SHADOW_EPSILON   0.1f

Epsilon value used when calculating shadows on geometry. Represents the distance at which shadow checks start being made. Must be greater than SURFACE_INTERSECTION_EPSILON to prevent artifacting

Returns
float

Definition at line 269 of file defines.cl.

◆ SURFACE_SHADOW_FALLOFF

#define SURFACE_SHADOW_FALLOFF   5.0f

Falloff value used when calculating soft shadows

Returns
float

Definition at line 275 of file defines.cl.

◆ USE_BOUNDING_VOLUME

#define USE_BOUNDING_VOLUME   false

Whether to use the bounding volume optimisation. float boundingVolumeDE(float3 position, float time) must be defined in the scene file for this to work

Returns
bool

Definition at line 17 of file defines.cl.