-
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
In your fragment shader you used: let color = textureLoad(input_tex, vec2<i32>(in.clip_position.xy), 0).rgb; You're taking pixel/texel coordinates of the render target ( You should replace your As to translation, you should be getting translation, because |
Beta Was this translation helpful? Give feedback.
In your fragment shader you used:
You're taking pixel/texel coordinates of the render target (
@builtin(position)
under the namein.clip_position
) and using them as texel coordinates of theinput_tex
. So, no scaling can ever happen — this is always a 1:1 mapping of texels. Notice that you haven't usedin.uv
at all!You should replace your
textureLoad
call withtextureSample(input_tex, sampler, in.uv)
, withsampler
being a sampler you've created with appropriate filtering settings for your desired result (probably linear filtering). Technically, you could do the arithmetic yourself and keep usingtextureLoad
, but…