Professional Documents
Culture Documents
Cb0e6e8cbec4502a 0000000000000079 Ps
Cb0e6e8cbec4502a 0000000000000079 Ps
// shader cb0e6e8cbec4502a
// Used for: 1 pass Battle, Camera and Scope Depth of Field Blur
void main() {
vec2 center = ( passParameterSem3.xy + passParameterSem3.zw ) / 2.0 ;
vec3 result = vec3(0.0);
float count = 0.0;
for ( int x = 1-radius; x <= radius-1; x+=2 ) {
for ( int y = 1-radius; y <= radius-1; y+=2 ) {
if ( length(vec2(x, y)) <= radius ) {
result += texture( textureUnitPS0, center + vec2(x,
y)/resolution ).xyz ;
count += 1.0;
}
}
}
passPixelColor0 = vec4( result / count, 0.0 );
}
void main() {
passPixelColor0 = texture(textureUnitPS0, passParameterSem3.xy);
}
#endif