File tree 1 file changed +4
-5
lines changed
crates/bevy_core_pipeline/src/motion_blur
1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -78,10 +78,8 @@ fn fragment(
78
78
79
79
// If depth is not considered during sampling, you can end up sampling objects in front of a
80
80
// fast moving object, which will cause the (possibly stationary) objects in front of that
81
- // fast moving object to smear. To prevent this, we check the depth of the fragment we are
82
- // sampling. If it is closer to the camera than this fragment (plus the user-defined bias),
83
- // we discard it. If the bias is too small, fragments from the same object will be filtered
84
- // out.
81
+ // fast moving object to smear. To prevent this, we check the depth and velocity of the
82
+ // fragment we are sampling.
85
83
#ifdef NO_DEPTH_TEXTURE_SUPPORT
86
84
let sample_depth = 0.0 ;
87
85
#else
@@ -100,7 +98,8 @@ fn fragment(
100
98
101
99
var weight = 1.0 ;
102
100
// if the sampled frag is in front of this frag, we want to scale its weight by how parallel
103
- // their motion vectors are.
101
+ // their motion vectors are. This is because that means the sampled fragment is more likely
102
+ // to have occupied this fragment during the course of its motion.
104
103
if sample_depth > this_depth || ! depth_supported {
105
104
let this_len = length (this_motion_vector );
106
105
let sample_len = length (sample_motion_vector );
You can’t perform that action at this time.
0 commit comments