dof.wgsl
Name | Type | Value |
---|---|---|
COS_NEG_FRAC_PI_6
#
![]() |
f32
![]() |
0.8660254037844387 |
SIN_NEG_FRAC_PI_6
#
![]() |
f32
![]() |
-0.5 |
COS_NEG_FRAC_PI_5_6
#
![]() |
f32
![]() |
-0.8660254037844387 |
SIN_NEG_FRAC_PI_5_6
#
![]() |
f32
![]() |
-0.5 |
Name | Group | Binding index | Binding type | Type | Shader Def |
---|---|---|---|---|---|
depth_texture
#
![]() |
0 | 1 | texture_depth_multisampled_2d | 🟢 MULTISAMPLED | |
depth_texture
#
![]() |
0 | 1 | texture_depth_2d | 🔴 MULTISAMPLED | |
color_texture_a
#
![]() |
0 | 2 | texture_2d<f32> | ||
color_texture_b
#
![]() |
0 | 3 | texture_2d<f32> | 🟢 DUAL_INPUT | |
dof_params
#
![]() |
1 | 0 | <uniform> | DepthOfFieldParams | |
color_texture_sampler
#
![]() |
1 | 1 |
sampler
![]() |
Name | Type |
---|---|
focal_distance |
f32
![]() |
focal_length |
f32
![]() |
coc_scale_factor |
f32
![]() |
max_circle_of_confusion_diameter |
f32
![]() |
max_depth |
f32
![]() |
pad_a |
u32
![]() |
pad_b |
u32
![]() |
pad_c |
u32
![]() |
Annotation | Name | Type |
---|---|---|
location(0) | output_0 |
vec4<f32>
![]() |
location(1) | output_1 |
vec4<f32>
![]() |
Parameter | Type |
---|---|
in_frag_coord |
vec4<f32>
![]() |
frag_coord
is the screen-space pixel coordinate of the fragment (i.e. the
position
input to the fragment).
* coc
is the diameter (not the radius) of the circle of confusion for this
fragment.
* frag_offset
is the vector, in screen-space units, from one sample to the
next. For a horizontal blur this will be vec2(1.0, 0.0)
; for a vertical
blur this will be vec2(0.0, 1.0)
.
Returns the resulting color of the fragment.Parameter | Type |
---|---|
frag_coord |
vec4<f32>
![]() |
coc |
f32
![]() |
frag_offset |
vec2<f32>
![]() |
color_texture_a
.
* frag_coord
is the screen-space pixel coordinate of the fragment (i.e. the
position
input to the fragment).
* coc
is the diameter (not the radius) of the circle of confusion for this
fragment.
* frag_offset
is the vector, in screen-space units, from one sample to the
next. This need not be horizontal or vertical.Parameter | Type |
---|---|
frag_coord |
vec4<f32>
![]() |
coc |
f32
![]() |
frag_offset |
vec2<f32>
![]() |
🟢 DUAL_INPUT
Parameter | Type |
---|---|
frag_coord |
vec4<f32>
![]() |
coc |
f32
![]() |
frag_offset |
vec2<f32>
![]() |
Parameter | Type |
---|---|
in | FullscreenVertexOutput |
Parameter | Type |
---|---|
in | FullscreenVertexOutput |
Parameter | Type |
---|---|
in | FullscreenVertexOutput |
🟢 DUAL_INPUT
Parameter | Type |
---|---|
in | FullscreenVertexOutput |
bevy_core_pipeline::dof::DepthOfFieldUniforms
for information on what these parameters mean.