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

[#115] Fix motion vector visualisation

parent cba45803
No related branches found
No related tags found
1 merge request!100Resolve "Minor Indirect Dispatch fixes"
...@@ -21,7 +21,10 @@ void main(){ ...@@ -21,7 +21,10 @@ void main(){
if(any(greaterThanEqual(coord, outImageRes))) if(any(greaterThanEqual(coord, outImageRes)))
return; return;
vec2 motionVector = texelFetch(sampler2D(inMotion, textureSampler), coord / motionTileSize, 0).rg; vec2 uv = (coord + 0.5) / vec2(outImageRes);
ivec2 inTextureRes = textureSize(sampler2D(inMotion, textureSampler), 0);
vec2 motionVector = texelFetch(sampler2D(inMotion, textureSampler), ivec2(uv * inTextureRes), 0).rg;
vec2 motionVectorNormalized = clamp(motionVector / range, -1, 1); vec2 motionVectorNormalized = clamp(motionVector / range, -1, 1);
vec2 color = motionVectorNormalized * 0.5 + 0.5; vec2 color = motionVectorNormalized * 0.5 + 0.5;
......
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