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

Raymarches Rayleigh-Mie through the atmosphere against a sphere. More...

Go to the source code of this file.

Data Structures

struct  WarpLayer
struct  PerlinLayer
struct  FBMLayer

Macros

#define MAX_LAYERS   24

Functions

 layout (location=0) in vec3 aPosition
 layout (std140) uniform CameraData
 layout (std430, binding=13) buffer PlanetData
float scale (float fCos)
void main ()

Variables

out vec3 vPos
out vec3 vNormal
out vec3 c0
out vec3 c1
out vec3 t0
out vec3 vViewDir
uniform vec3 uCamPosWorld
uniform float uInnerRadius
uniform float uInnerRadius2
uniform float uOuterRadius
uniform float uOuterRadius2
uniform vec3 uInvWavelength
uniform float uFScale
uniform float uFScaleOverDepth
uniform float uFInvScaleDepth
uniform float uFScaleDepth
uniform float uG
uniform float uG2
uniform float ufKrESun
uniform float ufKmESun
uniform float ufKr4Pi
uniform float ufKm4Pi
uniform mat4 uFakeView
uniform mat4 uFakeProj
uniform vec3 uCamPos
const int samples = 4

Detailed Description

Raymarches Rayleigh-Mie through the atmosphere against a sphere.

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

Definition in file atmosphere.vert.


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 29 of file atmosphere.vert.

Function Documentation

◆ layout() [1/3]

layout ( location = 0)

References layout().

◆ layout() [2/3]

layout ( std140 )

Definition at line 20 of file atmosphere.vert.

References layout(), projection, and view.

◆ layout() [3/3]

layout ( std430 ,
binding = 13 )

Definition at line 60 of file atmosphere.vert.

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

◆ scale()

float scale ( float fCos)

◆ main()

Variable Documentation

◆ vPos

out vec3 vPos

Definition at line 13 of file atmosphere.vert.

◆ vNormal

out vec3 vNormal

Definition at line 14 of file atmosphere.vert.

◆ c0

out vec3 c0

Definition at line 15 of file atmosphere.vert.

◆ c1

out vec3 c1

Definition at line 16 of file atmosphere.vert.

◆ t0

out vec3 t0

Definition at line 17 of file atmosphere.vert.

◆ vViewDir

out vec3 vViewDir

Definition at line 18 of file atmosphere.vert.

◆ uCamPosWorld

uniform vec3 uCamPosWorld

Definition at line 75 of file atmosphere.vert.

Referenced by main().

◆ uInnerRadius

uniform float uInnerRadius

Definition at line 76 of file atmosphere.vert.

Referenced by main().

◆ uInnerRadius2

uniform float uInnerRadius2

Definition at line 77 of file atmosphere.vert.

◆ uOuterRadius

uniform float uOuterRadius

Definition at line 78 of file atmosphere.vert.

Referenced by main().

◆ uOuterRadius2

uniform float uOuterRadius2

Definition at line 79 of file atmosphere.vert.

◆ uInvWavelength

uniform vec3 uInvWavelength

Definition at line 80 of file atmosphere.vert.

Referenced by main().

◆ uFScale

uniform float uFScale

Definition at line 81 of file atmosphere.vert.

Referenced by main().

◆ uFScaleOverDepth

uniform float uFScaleOverDepth

Definition at line 82 of file atmosphere.vert.

Referenced by main().

◆ uFInvScaleDepth

uniform float uFInvScaleDepth

Definition at line 83 of file atmosphere.vert.

◆ uFScaleDepth

uniform float uFScaleDepth

Definition at line 84 of file atmosphere.vert.

Referenced by main().

◆ uG

uniform float uG

Definition at line 85 of file atmosphere.vert.

◆ uG2

uniform float uG2

Definition at line 86 of file atmosphere.vert.

◆ ufKrESun

uniform float ufKrESun

Definition at line 87 of file atmosphere.vert.

Referenced by main().

◆ ufKmESun

uniform float ufKmESun

Definition at line 88 of file atmosphere.vert.

Referenced by main().

◆ ufKr4Pi

uniform float ufKr4Pi

Definition at line 89 of file atmosphere.vert.

Referenced by main().

◆ ufKm4Pi

uniform float ufKm4Pi

Definition at line 90 of file atmosphere.vert.

Referenced by main().

◆ uFakeView

uniform mat4 uFakeView

Definition at line 91 of file atmosphere.vert.

Referenced by main().

◆ uFakeProj

uniform mat4 uFakeProj

Definition at line 92 of file atmosphere.vert.

Referenced by main().

◆ uCamPos

uniform vec3 uCamPos

Definition at line 101 of file atmosphere.vert.

◆ samples

const int samples = 4

Definition at line 103 of file atmosphere.vert.

Referenced by main().