@Z22 - I have had a look at the code you posted and I note the following
1) It is simple to merge the two loops, I did the following
float q;
for ( q=(-8.0); q<8.01; q+=1.0 )
{
vec4 G402 = texture2D ( texture0, vTexCoord.xy + Offset*vec2( q, 0.0 ) );
vec4 G403 = texture2D ( texture0, vTexCoord.xy + Offset*vec2( 0.0, q ) );
vec4 G404 = texture2D ( texture0, vTexCoord.xy + Offset*vec2( q*2.0, 0.0 ) );
vec4 G405 = texture2D ( texture0, vTexCoord.xy + Offset*vec2( 0.0, q*2.0 ) );
// rest of loop body
}
I suppose that you did something similar.
2) All of the conditions in the if statements contain a G401.r > G401.g*1.4 term. This can be moved out of the individual if statements and they all, and all but one of the texture2D calls, can be made dependant on this term so that they are only executed if G401.r > G401.g*1.4
3) Most of the stuff precceding the main function is only used if G401.r > G401.g*1.4 and can be moved into the body of the function to where it is only calculated if it is needed.
Doing this and couple of other ***** rearrangements gave me the code shown in the attached image (because this stupid forum system wont let me post it as text)
However after doing that I see that the statements
if ( G401.r > G403.r && G401.r < G405.r ) { Girl.r = GG1; }
if ( G401.r < G403.r && G401.r > G405.r ) { Girl.r = GG1; }
are a little suspect. In effect the first says If G401.r is in the open range G403.r and G405.r then set Girl.r to GG1 and the second says If G401.r is outside the same open range then set Girl.r to GG1
by "open range" I mean that the range does not include its endpoints.
This doesn't seem right as it is equivalent to saying if G401,r is not equal to G403.r and not equal to G405.r then set Girl.r to GG1 which is a funny thing to want to happen, but if that is what you really meant then just use
if ( G401,r != G403.r && G401.r != G405.r ) { Girl.r = GG1 };
Similar comments apply to the other pair of if statemements
However, it is now very late and I can not guarentee that I have not made a silly mistake in the above code.