Search Unity

subpixel texture offset in post processing

Discussion in 'Shaders' started by Epic_Cube, May 7, 2019.

  1. Epic_Cube

    Epic_Cube

    Joined:
    Jul 3, 2012
    Posts:
    100
    Hi all,
    I've released a postprocessing effect that uses a texture as a mask. This texture is a black/white texture with columns 1 pixel wide. I need to create an offset on it but, if I change the x offset of the texture, fractional values of the offset have no effect. When the offset is 1 or greater, the texture snaps 1 pixel. Is there any way to achieve a subpixel offset displacement?
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,352
    If the texture is set to use bilinear filtering, it should work fine. If it's set to use point filtering then only full pixel offsets will have an effect. You're going to have to give more information about what you're doing.
     
  3. Epic_Cube

    Epic_Cube

    Joined:
    Jul 3, 2012
    Posts:
    100
    Hi, your reply makes sense. I'll try