You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I read the code properly, ViewportInfo should be a vec4 in the form of {1.0/original_tex_w, 1.0/original_tex_h, original_tex_w, original_tex_h}.
I'll let the original authors confirm but from my tests it works when I use those values.
Explanation (based on the glsl code) for the curious (others can stop reading here):
l.85 highp vec2 imgCoord = ((in_TEXCOORD0.xy*ViewportInfo[0].zw)+vec2(-0.5,0.5));
The multiply here is used to transform from the current texture UV space to the "Viewport" space (i.e. the original low res texture). This basically maps the current uv to a pixel in the original texture and shifts this pixel coordinate by (-0.5, 0.5) to get the center of the pixel.
l.96 vec4 right = textureGather(ps0,coord + highp vec2(ViewportInfo[0].x, 0.0), mode);
The coord + vec2(ViewportInfo[0].x, 0.0 shifts the pixel coordinate coord to the right by adding 1/width.
Because we're sampling ps0 (the original low res texture) the width used as to be the width of that texture.
The rest of the code makes sense when you take those 4 variables and the code seems to work.
Hope this helps.
how to choose the best parameter to set ViewportInfo for gsr?
The text was updated successfully, but these errors were encountered: