Jump to content
  • Advertisement
Sign in to follow this  

OpenGL Need help with SMAA T2X

This topic is 753 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello guys, I'm trying to integrate SMAA T2X (in OpenGL) in my project.


I got the SMAA 1x working very fast. However, I'm struggling to make the SMAA T2X version to work.


I have a set of 2 framebuffers representing the "previous" and "current" neighbourhood blending pass, just like in the SMAA DX10 demo  (https://github.com/iryoku/smaa/tree/master/Demo/DX10).

The documentation of the shader tells to render the geometry using subpixel jitters (https://github.com/iryoku/smaa/blob/master/SMAA.hlsl). For this, I create a jittering matrix which I apply in this way 



MVP = Projection * View * Model * JitteringMatrix;

glm::vec2 jitter = getJitter();
glm::mat4 jitter_mat = glm::translate(glm::mat4(), glm::vec3(2.0f * jitter.x / float(width_), 2.0f * jitter.y / float(height_), 0.0f));

the getJitter function returns the jittering depending on the current frame of SMAA

glm::vec2 jitters[] = {
        glm::vec2(-0.25f,  -0.25f),
        glm::vec2( 0.25f, 0.25f)
return jitters[frame_index_];
However, the jittering matrix seems to be moving some geometry of my scene a little too much. Some objects start to shake after I apply this matrix. But this shouldn't happen since the jittering matrix should move the geometry less than a pixel (subpixel) so it shouldn't be noticeable.

Here's a short video showing the problem. I don't really know if the jittering process is causing the problem or if I'm doing something wrong in another step.
Thank you very much for your help!
EDIT: I think I solved the error. I should multiply the jittering matrix on the left side (JitteringMatrix * P * V * M); doing this solved the problem. However at low framerates the whole image starts to jitter (only a bit), is this normal? 
Edited by Sytto

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!