Back home 🏡 WGSL Spec Bevy WGSL Functions

ssr.wgsl

Import path

Bindings

Name Group Binding index Binding type Type
color_texture # 1 0 texture_2d<f32>
color_sampler # 1 1 sampler

Functions

evaluate_ssr

#
Returns the reflected color in the RGB channel and the specular occlusion in the alpha channel. The general approach here is similar to [1]. We first project the reflection ray into screen space. Then we perform uniform steps along that screen-space reflected ray, converting each step to view space. The arguments are: * R_world: The reflection vector in world space. * P_world: The current position in world space. [1]: https://lettier.github.io/3d-game-shaders-for-beginners/screen-space-reflection.html
fn evaluate_ssr(R_world: vec3<f32>, P_world: vec3<f32>) -> vec4<f32>
Parameter Type
R_world vec3<f32>
P_world vec3<f32>
Returns: vec4<f32>

fragment

#
@fragment
fn fragment(in: FullscreenVertexOutput) -> @location(0) vec4<f32>
Parameter Type
in FullscreenVertexOutput
Returns: @location(0) vec4<f32>