AI: Using Shaders to Compute a potential field/Influence map

Hi
I have often heard talks of running a potential field through the gpu.
Influence Map,
Potential Fields
Considering most of what is going on is very much image processing (blurring and splatting) I considered doing this through unity’s shaders as the texture processing would be much faster than doing a 2d for loop.

I found out how to combine texture Here
but I do not know how to save that modified data as a separate texture.

Shader "Examples/2 Alpha Blended Textures" {
    Properties {
        _MainTex ("Base (RGB)", 2D) = "white" {}
        _BlendTex ("Alpha Blended (RGBA) ", 2D) = "white" {}
    }
    SubShader {
        Pass {
            // Apply base texture
            SetTexture [_MainTex] {
                combine texture
            }
            // Blend in the alpha texture using the lerp operator
            SetTexture [_BlendTex] {
                combine texture lerp (texture) previous
            }
        }
    }
}

I need to be able to manually control the update frequency.
Also I do not want to do a simple lerp, in some cases I want the maximum value at that pixel to be selected as the new pixel value.
I have looked at the compiled shader to see if there is any access to the combination function but it is exactly the same as the base (shader lab) code

I dont usually mess with shaders, so I would like to learn the bare minimum for this working. Or a nudge in the general direction.

Before i look like a complete idiot, I did see this

But how do I apply it on a single channel (R,G,B,A) if I want to?
And how can make it trigger only when the lerped value > threshold

c =  lerp(a,b,0.5f);
if(c  > 0.7f)
{
 c = Max(a,b);
}

Simply by using e.g.; c.a= Max(a.r,b.g)
You can refer to any seperate or rgb channels. Im not sure on i.e. referring to a.gb though

You can split individual channels, either in a way like texture.r or with a mask.

The conditional logic I think you’re wanting is called ‘step’, takes 3 values; if (a>b, c=1) or (a<b, c=0). Or it might be the other way around with the c value, I forget.