The Sobel filter is computing the local derivates of the intensity map. In this example we show to include source from other files. The following figure shows how the convolution tool works : it reads a local window of 3x3 pixels over the current location, multiplying (element-wise) the value by two 3x3 matrices :
The matrices are :
First, the convolution tool convolution.ppl :
SOURCE:convolutionSource
{
mat3 readPatch(in sampler2D s, in ivec2 pos, in vec4 projection)