Water threshhold added, now it's actually waterlike
This commit is contained in:
@@ -45,6 +45,8 @@ void main()
|
||||
float hstep = dir.x;
|
||||
float vstep = dir.y;
|
||||
|
||||
float Threshhold = 0.1;
|
||||
|
||||
//apply filter using a 9 tap filter with predefined gaussian weights
|
||||
|
||||
sum += texture(WaterTexture, vec2(tc.x - 4.0*blur*hstep, tc.y - 4.0*blur*vstep)) * 0.0162162162;
|
||||
@@ -59,5 +61,10 @@ void main()
|
||||
sum += texture(WaterTexture, vec2(tc.x + 3.0*blur*hstep, tc.y + 3.0*blur*vstep)) * 0.0540540541;
|
||||
sum += texture(WaterTexture, vec2(tc.x + 4.0*blur*hstep, tc.y + 4.0*blur*vstep)) * 0.0162162162;
|
||||
|
||||
frag_Diffuse = vec4(sum.rgb, 1.0) * vec4(0.0, 0.3, 1.0, 1.0);
|
||||
frag_Diffuse = vec4(sum.rgb, 1.0) * vec4(0.0, 0.6, 1.5, 1.0);
|
||||
float avgColor = frag_Diffuse.r + frag_Diffuse.g + frag_Diffuse.b;
|
||||
avgColor = avgColor/3;
|
||||
if ( avgColor*dir.y > Threshhold ){
|
||||
frag_Diffuse = vec4(0.0, 0.6, 1.0, 1.0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user