a stupid question about full screen post effects

shuipi

Newcomer
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?
 
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.
 
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?
 
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?

Yes
 
Back
Top