|
Space Sim
|
#include <stdbool.h>#include <stdint.h>#include <SDL2/SDL.h>#include <GL/glew.h>#include "nk_config.h"#include "nuklear/nuklear.h"#include <omp.h>#include "nuklear/nuklear_sdl_gl3.h"Go to the source code of this file.
Data Structures | |
| struct | vec2 |
| struct | vec3 |
| struct | vec4 |
| struct | ivec3 |
| struct | ivec4 |
| struct | uvec4 |
| struct | mat4 |
| struct | Timer |
| struct | Particle |
| struct | ParticleVertex |
| struct | Node |
| struct | MortonPair |
| struct | ParticleData |
| struct | MortonData |
| struct | GPUNode |
| struct | NodeData |
| struct | RadixData |
| struct | ChunkList |
| struct | NodeCounter |
| struct | BoundsData |
| struct | CamData |
| struct | RenderData |
| struct | Camera |
| struct | ChunkScore |
| struct | Globals |
| struct | ChunkData |
| struct | MarchingCubesData |
| struct | Vertex |
| struct | AtmosphereVertex |
| struct | WaterVertex |
| struct | WarpLayer |
| struct | PerlinLayer |
| struct | FBMLayer |
| struct | PlanetData |
| struct | WaterData |
| struct | Uniform |
| struct | ComputeShaderProgram |
| struct | ShaderProgram |
| struct | DensityData |
| struct | VertexInfo |
| struct | GPUChunk |
| struct | DrawArraysIndirectCommand |
Macros | |
| #define | FOV 90 |
| #define | VIEW_NEAR 0.01 |
| #define | VIEW_FAR 100000.0 |
| #define | BODY_COUNT 15000 |
| #define | MAX_NODES 45000 |
| #define | SHADOW_MAP_SIZE 2048 |
| #define | QUERY_FRAMES 3 |
| #define | MAX_DEPTH 64 |
| #define | WORKGROUP_SIZE 128 |
| #define | RADIX_BIN_SIZE 128 |
| #define | MAX_CHUNKS 1000 |
| #define | MAX_CHUNK_LIST (MAX_CHUNKS * 20) |
| #define | MAX_DENSITY_RESOLUTION 64 |
| #define | CHUNK_WORLD_SIZE 20 |
| #define | MAX_LAYERS 24 |
| #define | WATER_FFT_TEXTURE_SIZE 128 |
| #define | WATER_FFT_L 1000 |
| #define | MAX_LOD_MAX 1 |
| #define | HALF_LOD_MAX 27 |
| #define | QUARTER_LOD_MAX 90 |
| #define | HALF_DENSITY_RESOLUTION 32 |
| #define | QUARTER_DENSITY_RESOLUTION 16 |
| #define | WATER_RES 1024 |
| #define | VERTEX_COUNT_MAX (LODMAX * MAX_CHUNKS * 5) |
| #define | MESH_RES 64 |
| #define | ATMOSPHERE_RES 64 |
| #define | CHUNK_RADIUS 6 |
| #define | CHUNK_DIAMETER (CHUNK_RADIUS * 2 + 1) |
| #define | CHUNK_LIMIT (CHUNK_DIAMETER * CHUNK_DIAMETER * CHUNK_DIAMETER) |
| #define | PERLIN_TEXTURE_SIZE 32 |
| #define | WORLEY_TEXTURE_SIZE 32 |
| #define | FBM_TEXTURE_SIZE 32 |
Enumerations | |
| enum | PerformanceQueryTypes { PQUERY_MAIN , PQUERY_BOUNDS , PQUERY_MORTON , PQUERY_RADIX , PQUERY_TREECOUNT , PQUERY_TREE , PQUERY_COM , PQUERY_ATMOSPHERE , PQUERY_CLOUDS , PQUERY_WATER_GEN , PQUERY_WATER , PQUERY_MESH_GEN , PQUERY_PARTICLE , PQUERY_MESH , PQUERY_DRAW , PQUERY_POSTPROCESS , PQUERY_MAX } |
| enum | LodLevels { LOD0 , LOD1 , LOD2 , LOD3 , LODMAX } |
Functions | |
| void | start_timer (Timer *t) |
| double | end_timer (Timer *t) |
| float | noise (vec3 p) |
| float | noise3d (vec3 p) |
| void | render_sky_cubemap () |
| Renders the atmosphere and clouds from inside of the atmosphere. | |
Variables | |
| const int | LOD_RES [LODMAX] |
| const int | MAX_CHUNKS_LOD [LODMAX] |
| int | LOD_DENSITY_SIZES [LODMAX] |
| int | LOD_VERTEX_SIZES [LODMAX] |
| AtmosphereVertex * | ATMOSPHERE_VERTS |
| uint32_t * | ATMOSPHERE_INDICES |
| int | ATMOSPHERE_VCNT |
| int | ATMOSPHERE_ICNT |
| Globals | GLOBALS |
| GLsync | fence |
| Camera | cam |
| Camera | space_cam |
| Camera | LIGHT_CAM |
| Camera * | current_cam |
| GLuint64 | density_time |
| GLuint64 | mc_time |
| GLuint | d_q |
| GLuint | mc_q |
| bool | within_planet_atmosphere |
| struct uvec4 |
| struct mat4 |
| struct Particle |
| struct Node |
| struct ParticleData |
| Data Fields | ||
|---|---|---|
| Particle | p_spawn[BODY_COUNT] | |
| vec4 | p_colors[BODY_COUNT] | |
| uint32_t | p_dead[BODY_COUNT] | |
| uint32_t | claimed[BODY_COUNT] | |
| int | nodes_visited[BODY_COUNT] | |
| uint32_t | star_particles[BODY_COUNT] | |
| Particle | p[BODY_COUNT] | |
| struct MortonData |
| Data Fields | ||
|---|---|---|
| MortonPair | entry[BODY_COUNT] | |
| struct GPUNode |
| struct NodeData |
| struct RadixData |
| Data Fields | ||
|---|---|---|
| uint32_t | local_prefix[5000 *WORKGROUP_SIZE] | |
| uint32_t | local_offsets[BODY_COUNT] | |
| uint32_t | block_bin_count[5000 *RADIX_BIN_SIZE] | |
| uint32_t | global_offsets[5000 *RADIX_BIN_SIZE] | |
| uint32_t | local_bin_count[5000 *RADIX_BIN_SIZE] | |
| struct ChunkList |
| struct NodeCounter |
| struct BoundsData |
| struct CamData |
| struct Camera |
| struct ChunkScore |
| struct Globals |
| struct ChunkData |
| struct MarchingCubesData |
| struct Vertex |
| struct WarpLayer |
| struct PerlinLayer |
| struct FBMLayer |
| struct PlanetData |
| Data Fields | ||
|---|---|---|
| int | warp_count | |
| int | perlin_count | |
| int | fbm_count | |
| int | pad0 | |
| vec4 | sun_dir | |
| vec4 | sun_color | |
| WarpLayer | warp_layers[MAX_LAYERS] | |
| PerlinLayer | perlin_layers[MAX_LAYERS] | |
| FBMLayer | fbm_layers[MAX_LAYERS] | |
| struct ComputeShaderProgram |
| struct ShaderProgram |
| struct VertexInfo |
| struct GPUChunk |
| Data Fields | ||
|---|---|---|
| float | lod_dist[3] | |
| uint32_t | emitted_chunks | |
| VertexInfo | vertex_counts[VERTEX_COUNT_MAX] | |
| struct DrawArraysIndirectCommand |
| #define FOV 90 |
Definition at line 35 of file types.h.
Referenced by update_camera().
| #define VIEW_NEAR 0.01 |
Definition at line 36 of file types.h.
Referenced by update_camera().
| #define VIEW_FAR 100000.0 |
Definition at line 37 of file types.h.
Referenced by update_camera().
| #define BODY_COUNT 15000 |
Definition at line 39 of file types.h.
Referenced by delta(), init_random(), layout(), main(), main(), render(), and sim_step().
| #define MAX_NODES 45000 |
Definition at line 40 of file types.h.
Referenced by layout(), main(), and sim_step().
| #define SHADOW_MAP_SIZE 2048 |
| #define MAX_DEPTH 64 |
Definition at line 154 of file types.h.
Referenced by layout(), main(), and sim_step().
| #define WORKGROUP_SIZE 128 |
| #define MAX_CHUNKS 1000 |
Definition at line 182 of file types.h.
Referenced by init(), init_chunk_data(), layout(), and load_chunks().
| #define MAX_CHUNK_LIST (MAX_CHUNKS * 20) |
Definition at line 184 of file types.h.
Referenced by init_chunk_data().
| #define CHUNK_WORLD_SIZE 20 |
Definition at line 318 of file types.h.
Referenced by calc_density(), init(), load_chunks(), make_atmosphere_sphere_face(), and resolve_collisions().
| #define MAX_LAYERS 24 |
Definition at line 407 of file types.h.
Referenced by display_main_menu(), and layout().
| #define WATER_FFT_TEXTURE_SIZE 128 |
Definition at line 423 of file types.h.
Referenced by fft_textures(), init(), and update_water_fft().
| #define VERTEX_COUNT_MAX (LODMAX * MAX_CHUNKS * 5) |
Definition at line 483 of file types.h.
Referenced by load_chunks().
| #define ATMOSPHERE_RES 64 |
Definition at line 503 of file types.h.
Referenced by init(), main(), and make_atmosphere_sphere_face().
| #define CHUNK_RADIUS 6 |
Definition at line 505 of file types.h.
Referenced by load_chunks(), and make_atmosphere_sphere_face().
| #define CHUNK_DIAMETER (CHUNK_RADIUS * 2 + 1) |
| #define CHUNK_LIMIT (CHUNK_DIAMETER * CHUNK_DIAMETER * CHUNK_DIAMETER) |
| #define PERLIN_TEXTURE_SIZE 32 |
Definition at line 508 of file types.h.
Referenced by calc_density(), init(), make_perm(), noise3d(), precompute_perlin_texture(), and sample_density().
| #define WORLEY_TEXTURE_SIZE 32 |
Definition at line 509 of file types.h.
Referenced by init(), and precompute_worley_texture().
| #define FBM_TEXTURE_SIZE 32 |
Definition at line 510 of file types.h.
Referenced by calc_density(), init(), precompute_fbm_texture(), and sample_fbm_density().
|
inline |
Definition at line 58 of file types.h.
References start_timer(), and t.
Referenced by load_chunks(), main(), make_atmosphere_sphere_face(), resolve_collisions(), and start_timer().
|
inline |
Definition at line 63 of file types.h.
References end_timer(), and t.
Referenced by end_timer(), load_chunks(), main(), and make_atmosphere_sphere_face().
| float noise | ( | vec3 | p | ) |
| float noise3d | ( | vec3 | p | ) |
Definition at line 507 of file init.c.
References fade(), gradients, noise3d(), PERLIN_TEXTURE_SIZE, permutations, t0, vec3_dot(), ivec3::x, vec3::x, ivec3::y, vec3::y, ivec3::z, and vec3::z.
Referenced by noise3d(), and precompute_perlin_texture().
| const int LOD_RES[LODMAX] |
Definition at line 299 of file types.h.
Referenced by create_new_planet_mesh(), and init().
| const int MAX_CHUNKS_LOD[LODMAX] |
Definition at line 309 of file types.h.
Referenced by display_main_menu(), init(), init_chunk_data(), load_chunks(), and render_mesh_planet().
|
extern |
Definition at line 186 of file main.c.
Referenced by main(), make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().
|
extern |
Definition at line 187 of file main.c.
Referenced by main(), and make_atmosphere_sphere_face().
|
extern |
Definition at line 188 of file main.c.
Referenced by main(), make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().
|
extern |
Definition at line 189 of file main.c.
Referenced by main(), make_atmosphere_sphere_face(), mesh_atmosphere_sphere(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
|
extern |
Definition at line 39 of file main.c.
Referenced by display_main_menu(), init_globals(), init_random(), look_at_selected_body(), main(), process_input(), and render().
|
extern |
Definition at line 247 of file main.c.
Referenced by look_at_selected_body(), main(), and process_input().
|
extern |
Definition at line 224 of file main.c.
Referenced by load_chunks(), main(), and render().
|
extern |
Definition at line 225 of file main.c.
Referenced by load_chunks(), main(), and process_input().
|
extern |
|
extern |