return love.graphics.newShader[[ #pragma language glsl3 uniform int radius; uniform Image sailable; bool own( float x ) { if( x * 255.0 > 130.0 ){ return true; } else { return false; } } bool land( float x ) { if( x * 255.0 <= 60.0 ){ return true; } else { return false; } } bool placeable( Image tex, vec2 uv ) { return own(Texel(tex, uv).r) && land(Texel(sailable, uv).r); } vec4 effect( vec4 color, Image tex, vec2 texture_coords, vec2 screen_coords ) { for(int i = -radius; i <= radius; ++i) { for(int j = -radius; j <= radius; ++j) { vec2 offset = vec2( ivec2( i, j ) ) / vec2( textureSize(tex, 0) ); int r = ((i * i) + (j * j)); if ( (r < (radius * radius) ) && placeable( tex, texture_coords + offset )){ return color; } } } return vec4( 0.0, 0.0, 0.0, 0.0 ); } ]]