|
Space Sim
|
Meshes a chunk using marching cubes. More...
Go to the source code of this file.
Data Structures | |
| struct | Vertex |
| struct | WarpLayer |
| struct | PerlinLayer |
| struct | FBMLayer |
Macros | |
| #define | LODMAX 4 |
| #define | MAX_CHUNKS 1000 |
| #define | MAX_LAYERS 24 |
| #define | NUM_OCTAVES 5 |
Functions | |
| layout (local_size_x=1, local_size_y=1, local_size_z=1) in | |
| layout (std140) uniform CameraData | |
| layout (std430, binding=8) buffer MarchingCubesData | |
| float | mod289 (float x) |
| vec4 | mod289 (vec4 x) |
| vec4 | perm (vec4 x) |
| float | noise (vec3 p) |
| float | fbm (vec3 x) |
| float | density_fn (vec3 p) |
| uint | density_index (uvec3 p, uint padded) |
| float | lookup_density (uvec3 p, uint padded) |
| float | sample_density (vec3 p, vec3 chunk_offset, vec3 center_offset, float voxel_size, uint padded) |
| vec3 | check_bounds (vec3 p, vec3 min, vec3 max) |
| void | main () |
Variables | |
| const vec3 | delta [8] |
| const float | ISO_VALUE = 0.0 |
| uniform int | uSize |
| uniform vec3 | chunk_offset |
| uniform int | chunk_id |
| uniform sampler3D | perlin_tex |
| uniform sampler3D | fbm_tex |
Meshes a chunk using marching cubes.
Definition in file marching_cubes.comp.
| struct Vertex |
| struct WarpLayer |
| struct PerlinLayer |
| struct FBMLayer |
| #define LODMAX 4 |
Definition at line 38 of file marching_cubes.comp.
| #define MAX_CHUNKS 1000 |
Definition at line 39 of file marching_cubes.comp.
| #define MAX_LAYERS 24 |
Definition at line 45 of file marching_cubes.comp.
| #define NUM_OCTAVES 5 |
Definition at line 110 of file marching_cubes.comp.
| layout | ( | local_size_x | = 1, |
| local_size_y | = 1, | ||
| local_size_z | = 1 ) |
References layout().
| layout | ( | std140 | ) |
Definition at line 11 of file marching_cubes.comp.
References layout(), projection, and view.
| layout | ( | std430 | , |
| binding | = 8 ) |
Definition at line 19 of file marching_cubes.comp.
References EDGE_TABLE, EDGE_TO_VERTICES, layout(), and TRIANGLE_TABLE.
| float mod289 | ( | float | x | ) |
Definition at line 111 of file marching_cubes.comp.
References mod289().
Definition at line 112 of file marching_cubes.comp.
References mod289().
Definition at line 113 of file marching_cubes.comp.
| float noise | ( | vec3 | p | ) |
| float fbm | ( | vec3 | x | ) |
Definition at line 138 of file marching_cubes.comp.
References fbm(), noise(), and NUM_OCTAVES.
| float density_fn | ( | vec3 | p | ) |
Definition at line 152 of file marching_cubes.comp.
References FBMLayer::amp, PerlinLayer::amp, WarpLayer::amp, density_fn(), fbm_tex, FBMLayer::freq, PerlinLayer::freq, WarpLayer::freq0, WarpLayer::freq1, WarpLayer::freq2, WarpLayer::offset0, WarpLayer::offset1, WarpLayer::offset2, perlin_tex, and vec3::z.
Referenced by density_fn(), and sample_density().
| uint density_index | ( | uvec3 | p, |
| uint | padded ) |
Definition at line 180 of file marching_cubes.comp.
References chunk_id, and density_index().
Referenced by density_index(), and lookup_density().
| float lookup_density | ( | uvec3 | p, |
| uint | padded ) |
Definition at line 187 of file marching_cubes.comp.
References density_index(), and lookup_density().
Referenced by lookup_density(), and sample_density().
| float sample_density | ( | vec3 | p, |
| vec3 | chunk_offset, | ||
| vec3 | center_offset, | ||
| float | voxel_size, | ||
| uint | padded ) |
Definition at line 193 of file marching_cubes.comp.
References c0, c1, chunk_offset, density_fn(), lookup_density(), sample_density(), uSize, vec3::x, vec3::y, and vec3::z.
Referenced by calc_density(), main(), sample_density(), and sample_density().
Definition at line 231 of file marching_cubes.comp.
References check_bounds(), vec3::x, vec3::y, and vec3::z.
Referenced by check_bounds().
| void main | ( | ) |
Definition at line 246 of file marching_cubes.comp.
References chunk_id, chunk_offset, delta, EDGE_TABLE, EDGE_TO_VERTICES, ISO_VALUE, main(), sample_density(), TRIANGLE_TABLE, uSize, and verts.
| const vec3 delta[8] |
| const float ISO_VALUE = 0.0 |
Definition at line 103 of file marching_cubes.comp.
Referenced by main().
| uniform int uSize |
Definition at line 104 of file marching_cubes.comp.
| uniform vec3 chunk_offset |
Definition at line 105 of file marching_cubes.comp.
| uniform int chunk_id |
Definition at line 106 of file marching_cubes.comp.
| uniform sampler3D perlin_tex |
Definition at line 107 of file marching_cubes.comp.
| uniform sampler3D fbm_tex |
Definition at line 108 of file marching_cubes.comp.