Space Sim
Loading...
Searching...
No Matches
atmosphere.frag File Reference

Generates the final color for Rayleigh-Mie based on incoming coefficients. More...

Go to the source code of this file.

Data Structures

struct  WarpLayer
struct  PerlinLayer
struct  FBMLayer

Macros

#define MAX_LAYERS   24

Functions

 layout (std430, binding=13) buffer PlanetData
float rayleigh_phase (float fCos, float fCos2)
float mie_phase (float fCos, float fCos2)
void main ()

Variables

out vec4 fragColor
in vec3 vPos
in vec3 vNormal
in vec3 c0
in vec3 c1
in vec3 t0
in vec3 vViewDir
uniform float uG
uniform float uG2
uniform float uColor

Detailed Description

Generates the final color for Rayleigh-Mie based on incoming coefficients.

See also
https://developer.nvidia.com/gpugems/gpugems2/part-ii-shading-lighting-and-shadows/chapter-16-accurate-atmospheric-scattering

Definition in file atmosphere.frag.


Data Structure Documentation

◆ WarpLayer

struct WarpLayer

Definition at line 371 of file types.h.

Data Fields
vec3 offset0
float freq0
vec3 offset1
float freq1
vec3 offset2
float freq2
float amp
float pad0
float pad1
float pad3

◆ PerlinLayer

struct PerlinLayer

Definition at line 387 of file types.h.

Data Fields
float freq
float amp
float pad0
float pad1

◆ FBMLayer

struct FBMLayer

Definition at line 397 of file types.h.

Data Fields
float freq
float amp
float pad0
float pad1

Macro Definition Documentation

◆ MAX_LAYERS

#define MAX_LAYERS   24

Definition at line 21 of file atmosphere.frag.

Function Documentation

◆ layout()

layout ( std430 ,
binding = 13 )

Definition at line 52 of file atmosphere.frag.

References layout(), MAX_LAYERS, sun_color, and sun_dir.

◆ rayleigh_phase()

float rayleigh_phase ( float fCos,
float fCos2 )

Definition at line 68 of file atmosphere.frag.

References rayleigh_phase().

Referenced by main(), and rayleigh_phase().

◆ mie_phase()

float mie_phase ( float fCos,
float fCos2 )

Definition at line 73 of file atmosphere.frag.

References mie_phase(), uG, and uG2.

Referenced by main(), and mie_phase().

◆ main()

void main ( )

Definition at line 82 of file atmosphere.frag.

References c0, c1, fragColor, main(), mie_phase(), rayleigh_phase(), sun_dir, and t0.

Variable Documentation

◆ fragColor

out vec4 fragColor

Definition at line 9 of file atmosphere.frag.

Referenced by layout(), and main().

◆ vPos

in vec3 vPos

Definition at line 10 of file atmosphere.frag.

Referenced by main().

◆ vNormal

in vec3 vNormal

Definition at line 11 of file atmosphere.frag.

Referenced by main().

◆ c0

◆ c1

◆ t0

in vec3 t0

Definition at line 14 of file atmosphere.frag.

Referenced by main(), and noise3d().

◆ vViewDir

in vec3 vViewDir

Definition at line 15 of file atmosphere.frag.

Referenced by main().

◆ uG

uniform float uG

Definition at line 17 of file atmosphere.frag.

Referenced by mie_phase().

◆ uG2

uniform float uG2

Definition at line 18 of file atmosphere.frag.

Referenced by mie_phase().

◆ uColor

uniform float uColor

Definition at line 81 of file atmosphere.frag.