Skip to content
Snippets Groups Projects
Commit 7a78a501 authored by Alexander Gauggel's avatar Alexander Gauggel
Browse files

[#106] Fix motion blur artifacts properly

parent eabfdb7b
No related branches found
No related tags found
1 merge request!89Resolve "Indirect Dispatch"
Pipeline #26746 passed
This commit is part of merge request !89. Comments created here will be created in the context of that merge request.
......@@ -14,7 +14,6 @@ layout( push_constant ) uniform constants{
float minVelocity;
};
void main(){
if(any(greaterThanEqual(gl_GlobalInvocationID.xy, imageSize(outImage))))
......@@ -25,6 +24,7 @@ void main(){
vec2 uv = vec2(coord) / textureRes;
vec2 motion = texture(sampler2D(inMotion, textureSampler), uv).rg;
motion *= motionFactor;
float velocity = length(motion);
// early out on little movement
......@@ -34,7 +34,11 @@ void main(){
return;
}
motion *= motionFactor;
// TODO: should be configurable by user or computed by velocity tile sizes
const float maxBlurDistance = 0.075;
if(velocity > maxBlurDistance){
motion *= maxBlurDistance / velocity;
}
vec3 color = vec3(0);
const int sampleCount = 16;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment