a stupid question about full screen post effects

Discussion in 'Rendering Technology and APIs' started by shuipi, Jun 8, 2009.

  1. shuipi

    Newcomer

    Joined:
    Mar 16, 2004
    Messages:
    73
    Likes Received:
    0
    Location:
    Beijing, China
    when you're doing full screen effects, if the texture size you're sampling and the RT size is different, like 1 / 2 or 2 times on each side. when you pass half texel size into the PS, do you pass the half texel size or half RT size?
     
  2. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Are we talking about the DX9s odd half pixel offset? If so, the shift is on the coordinates of the pixel centers. So it's the RT size that matters, not the texture you're sampling from.
     
  3. shuipi

    Newcomer

    Joined:
    Mar 16, 2004
    Messages:
    73
    Likes Received:
    0
    Location:
    Beijing, China
    oh it's not necessarily half texel size. Sorry for the confusion. Let's say I just want to know the texel size in the pixel shader so I can sample neighbor texels.

    In the case where I'm sampling from a, say, downscaled2x2 texture, and the RT is full screen size, and in the shader I want to sample neighbor texels, in this case the texel size should be 1.f / texWidth, instead of 1.f / RTWidth, right?
     
  4. Humus

    Humus Crazy coder
    Veteran

    Joined:
    Feb 6, 2002
    Messages:
    3,217
    Likes Received:
    77
    Location:
    Stockholm, Sweden
    Yes
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...