I am implementing a simple (post process) distortion shader: the image in render texture A is distorted by the displacement in render texture B. The material has two texture samplers, one for render texture A and one for render texture B. The fragment shader is just the following lines:
vec4 tint_pm = vec4(tint.xyz * tint.w, tint.w);
vec2 dist = (texture2D(tex1, var_texcoord0).xy - vec2(0.5, 0.5)) * dist_scale.xy;
vec4 color = texture2D(tex0, var_texcoord0.xy + dist) * tint_pm;
gl_FragColor = vec4(color);
I have precision issue with this shader and it seems to me that the material is ignoring the sampler filter settings: linear / nearest has no influence in the output.
Any help? thanks!