Space Sim
Loading...
Searching...
No Matches
Atmosphere

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

Detailed Description

The system for clouds and atmospheric scattering generation and rendering.

Macro Definition Documentation

◆ ATMOSPHERE_IDX

#define ATMOSPHERE_IDX ( x,
y,
o )
Value:
((o) + (y) * ATMOSPHERE_RES + (x))
#define ATMOSPHERE_RES
Definition types.h:503

Definition at line 31 of file mesh.c.

Referenced by make_atmosphere_sphere_face().

Function Documentation

◆ render_sky_from_outside_atmosphere()

◆ render_sky_cubemap()

◆ make_atmosphere_sphere_face()

void make_atmosphere_sphere_face ( FACE face,
int * vcnt,
int * icnt )

Creats a sphere face to be used for atmosphere rendering.

Parameters
faceWhich face to generate.
vcntThe current amount of vertices.
icntThe 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().

◆ 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().

Variable Documentation

◆ ESun

float ESun
extern

◆ ATMOSPHERE_VBO

GLuint ATMOSPHERE_VBO

Definition at line 183 of file main.c.

Referenced by init(), main(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().

◆ wavelength

vec3 wavelength
extern

◆ cam_pos_world

vec3 cam_pos_world
extern

◆ sun_dir

vec3 sun_dir
extern

Definition at line 237 of file main.c.

Referenced by display_main_menu(), layout(), and main().

◆ sun_color

vec3 sun_color
extern

Definition at line 238 of file main.c.

Referenced by display_main_menu(), layout(), and main().

◆ G

float G
extern

◆ fKr

float fKr
extern

◆ fKm

float fKm
extern

◆ ATMOSPHERE_EBO

GLuint ATMOSPHERE_EBO

Definition at line 184 of file main.c.

Referenced by init(), main(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().

◆ ATMOSPHERE_VAO

GLuint ATMOSPHERE_VAO

Definition at line 185 of file main.c.

Referenced by init(), main(), render_sky_cubemap(), and render_sky_from_outside_atmosphere().

◆ ATMOSPHERE_VERTS

AtmosphereVertex* ATMOSPHERE_VERTS

Definition at line 186 of file main.c.

Referenced by main(), make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().

◆ ATMOSPHERE_INDICES

uint32_t* ATMOSPHERE_INDICES

Definition at line 187 of file main.c.

Referenced by main(), and make_atmosphere_sphere_face().

◆ ATMOSPHERE_VCNT

int ATMOSPHERE_VCNT

Definition at line 188 of file main.c.

Referenced by main(), make_atmosphere_sphere_face(), and mesh_atmosphere_sphere().

◆ ATMOSPHERE_ICNT