Search across packages, versions, files, declarations, and comments. Use multiple terms to narrow results (AND), and add @vertex, @fragment, or @compute to filter by shader stage.

Constants

PI

#
const PI: f32 = 3.141592653589793

ISTEPS

#
const ISTEPS: u32 = 16u

JSTEPS

#
const JSTEPS: u32 = 8u

Bindings

nishita

#
@group(0)
@binding(0)
var<uniform> nishita: Nishita

image

#
@group(1)
@binding(0)
var image: texture_storage_2d_array<rgba16float, write>

Structures

Nishita

#
struct Nishita {
ray_origin: vec3<f32>,
sun_position: vec3<f32>,
sun_intensity: f32,
planet_radius: f32,
atmosphere_radius: f32,
rayleigh_coefficient: vec3<f32>,
rayleigh_scale_height: f32,
mie_coefficient: f32,
mie_scale_height: f32,
mie_direction: f32,
}

Functions

rsi

#
fn rsi (
rd: vec3<f32>,
r0: vec3<f32>,
sr: f32
) -> vec2<f32>

render_nishita

#
fn render_nishita (
r_full: vec3<f32>,
r0: vec3<f32>,
p_sun_full: vec3<f32>,
i_sun: f32,
r_planet: f32,
r_atmos: f32,
k_rlh: vec3<f32>,
k_mie: f32,
sh_rlh: f32,
sh_mie: f32,
g: f32
) -> vec3<f32>

main

#
@compute
Runs custom parallel code on the GPU, not limited to graphics
@workgroup_size(8, 8, 1)
Defines the size of a thread group. One to three numbers: width (x), height (y), and depth (z). Missing values default to 1
fn main (
@builtin(global_invocation_id)
invocation_id: vec3<u32>,
@builtin(num_workgroups)
num_workgroups: vec3<u32>
)
Contents