The main thing in the code I am not able to understand is vec3 outputPixel = sample(image, samplerTransform(image, d + refractVector.xy)).rgb;
Will you able to help me understand this line? As my output highly differs from the expectation and because I have converted the whole Kernel code into GLSL code and this line into highp vec3 outputPixel = texture2D(inputImageTexture, uv+refractVector.xy).rgb;
Want to implement Caustic Refraction filter from https://github.com/FlexMonkey/Filterpedia/blob/master/Filterpedia/customFilters/CausticRefraction.swift. I am able to write GLSL code and able to generate caustic noise image as well.
Caustic Noise Image
But when I write caustic refraction GLSL code, I get wrong output.
Output Image
The main thing in the code I am not able to understand is
vec3 outputPixel = sample(image, samplerTransform(image, d + refractVector.xy)).rgb;
Will you able to help me understand this line? As my output highly differs from the expectation and because I have converted the whole Kernel code into GLSL code and this line into
highp vec3 outputPixel = texture2D(inputImageTexture, uv+refractVector.xy).rgb;
Your help is appreciated. Thanks.