|
Space Sim
|
The system for clouds and atmospheric scattering generation and rendering. More...
Files | |
| file | src/render/atmosphere.frag |
| Generates the final color for Rayleigh-Mie based on incoming coefficients. | |
| file | src/render/atmosphere.vert |
| Raymarches Rayleigh-Mie through the atmosphere against a sphere. | |
| file | src/render/atmosphere_from_space.vert |
| Raymarches Rayleigh-Mie through the atmosphere against a sphere from outside of the sphere. | |
Macros | |
| #define | ATMOSPHERE_IDX(x, y, o) |
Functions | |
| void | render_sky_from_outside_atmosphere () |
| Renders the atmosphere from outside of the atmosphere. | |
| void | render_sky_cubemap () |
| Renders the atmosphere and clouds from inside of the atmosphere. | |
| void | make_atmosphere_sphere_face (FACE face, int *vcnt, int *icnt) |
| Creats a sphere face to be used for atmosphere rendering. | |
| void | mesh_atmosphere_sphere () |
| Creates an atmosphere sphere for rendering. | |
| float | ESun |
| vec3 | wavelength |
| vec3 | cam_pos_world |
| vec3 | sun_dir |
| vec3 | sun_color |
| float | G |
| float | fKr |
| float | fKm |
| GLuint | ATMOSPHERE_VBO |
| GLuint | ATMOSPHERE_EBO |
| GLuint | ATMOSPHERE_VAO |
| AtmosphereVertex * | ATMOSPHERE_VERTS |
| uint32_t * | ATMOSPHERE_INDICES |
| int | ATMOSPHERE_VCNT |
| int | ATMOSPHERE_ICNT |
The system for clouds and atmospheric scattering generation and rendering.
| #define ATMOSPHERE_IDX | ( | x, | |
| y, | |||
| o ) |
Definition at line 31 of file mesh.c.
Referenced by make_atmosphere_sphere_face().
| void render_sky_from_outside_atmosphere | ( | ) |
Renders the atmosphere from outside of the atmosphere.
Definition at line 787 of file main.c.
References ATMOSPHERE_EBO, ATMOSPHERE_FROM_SPACE_SHADER, ATMOSPHERE_ICNT, ATMOSPHERE_VAO, ATMOSPHERE_VBO, cam, Camera::cam_data, CamData::cam_pos, cam_pos_world, ESun, fKm, fKr, G, Uniform::location, planet_origin, ShaderProgram::program, CamData::proj, render_sky_from_outside_atmosphere(), ShaderProgram::uniforms, CamData::view, wavelength, vec3::x, vec4::x, vec3::y, vec4::y, vec3::z, and vec4::z.
Referenced by render_sky_from_outside_atmosphere().
| void render_sky_cubemap | ( | ) |
Renders the atmosphere and clouds from inside of the atmosphere.
Definition at line 934 of file main.c.
References ATMOSPHERE_EBO, ATMOSPHERE_ICNT, atmosphere_queries, ATMOSPHERE_SHADER, ATMOSPHERE_VAO, ATMOSPHERE_VBO, cam, Camera::cam_data, CamData::cam_pos, cam_pos_world, clouds_queries, CLOUDS_SHADER, compute_camera_basis(), current_query_frame, ESun, FBM_TEXTURE, fKm, fKr, G, Uniform::location, make_look_at(), make_projection(), PERLIN_TEXTURE, Camera::pitch, planet_origin, planet_radius, ShaderProgram::program, render_sky_cubemap(), SKY_CUBEMAP, SKY_FBO, ShaderProgram::uniforms, view, wavelength, WORLEY_TEXTURE, vec3::x, vec4::x, vec3::y, vec4::y, Camera::yaw, vec3::z, and vec4::z.
Referenced by render(), and render_sky_cubemap().
| void make_atmosphere_sphere_face | ( | FACE | face, |
| int * | vcnt, | ||
| int * | icnt ) |
Creats a sphere face to be used for atmosphere rendering.
| face | Which face to generate. |
| vcnt | The current amount of vertices. |
| icnt | The current amount of indices. |
Definition at line 1652 of file mesh.c.
References ATMOSPHERE_ICNT, ATMOSPHERE_IDX, ATMOSPHERE_INDICES, ATMOSPHERE_RES, ATMOSPHERE_VCNT, ATMOSPHERE_VERTS, c0, c1, calc_normal(), CHUNK_RADIUS, CHUNK_WORLD_SIZE, cube_pos(), end_timer(), make_atmosphere_sphere_face(), AtmosphereVertex::normal, AtmosphereVertex::pos, radius, scale(), size, start_timer(), vec3_add(), vec3_normalize(), vec3_scale(), vec2::x, and vec2::y.
Referenced by make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().
| void mesh_atmosphere_sphere | ( | ) |
Creates an atmosphere sphere for rendering.
Definition at line 1741 of file mesh.c.
References ATMOSPHERE_ICNT, ATMOSPHERE_VCNT, ATMOSPHERE_VERTS, make_atmosphere_sphere_face(), mesh_atmosphere_sphere(), AtmosphereVertex::normal, and vec3_normalize().
Referenced by main(), and mesh_atmosphere_sphere().
|
extern |
Definition at line 234 of file main.c.
Referenced by display_main_menu(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
| GLuint ATMOSPHERE_VBO |
Definition at line 183 of file main.c.
Referenced by init(), main(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
|
extern |
Definition at line 235 of file main.c.
Referenced by display_main_menu(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
|
extern |
Definition at line 236 of file main.c.
Referenced by display_main_menu(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
|
extern |
Definition at line 237 of file main.c.
Referenced by display_main_menu(), layout(), and main().
|
extern |
Definition at line 238 of file main.c.
Referenced by display_main_menu(), layout(), and main().
|
extern |
Definition at line 239 of file main.c.
Referenced by display_main_menu(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
|
extern |
Definition at line 240 of file main.c.
Referenced by display_main_menu(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
|
extern |
Definition at line 241 of file main.c.
Referenced by display_main_menu(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
| GLuint ATMOSPHERE_EBO |
Definition at line 184 of file main.c.
Referenced by init(), main(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
| GLuint ATMOSPHERE_VAO |
Definition at line 185 of file main.c.
Referenced by init(), main(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().
| AtmosphereVertex* ATMOSPHERE_VERTS |
Definition at line 186 of file main.c.
Referenced by main(), make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().
| uint32_t* ATMOSPHERE_INDICES |
Definition at line 187 of file main.c.
Referenced by main(), and make_atmosphere_sphere_face().
| int ATMOSPHERE_VCNT |
Definition at line 188 of file main.c.
Referenced by main(), make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().
| int ATMOSPHERE_ICNT |
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().