From eb66f85d0537caef8aa160fe30215508ccecaa75 Mon Sep 17 00:00:00 2001
From: Alex Kiri <alexchirila87@gmail.com>
Date: Mon, 4 Dec 2017 22:54:57 +0200
Subject: [PATCH] [BotW] Added back DoF blur shader for Battle, Camera and
 Scope

---
 .../cb0e6e8cbec4502a_0000000000000079_ps.txt  | 33 +++++++++++++++++++
 1 file changed, 33 insertions(+)
 create mode 100644 Source/BreathOfTheWild/cb0e6e8cbec4502a_0000000000000079_ps.txt

diff --git a/Source/BreathOfTheWild/cb0e6e8cbec4502a_0000000000000079_ps.txt b/Source/BreathOfTheWild/cb0e6e8cbec4502a_0000000000000079_ps.txt
new file mode 100644
index 00000000..d8f39fcc
--- /dev/null
+++ b/Source/BreathOfTheWild/cb0e6e8cbec4502a_0000000000000079_ps.txt
@@ -0,0 +1,33 @@
+<?php
+include 'Source/functions.php';
+$fullHeight = $argv[2];
+$scaleFactorY = always_decimal_format($fullHeight / 720.0);
+?>
+#version 420
+#extension GL_ARB_texture_gather : enable
+#extension GL_ARB_arrays_of_arrays : enable
+// shader cb0e6e8cbec4502a 
+// DoF blur effect - Battle, Camera, Scope
+layout(binding = 0) uniform sampler2D textureUnitPS0;// Tex0 addr 0xf5c7b800 res 1280x720x1 dim 1 tm: 4 format 0816 compSel: 0 1 2 5 mipView: 0x0 (num 0x1) sliceView: 0x0 (num 0x1) Sampler0 ClampX/Y/Z: 2 2 2 border: 1
+layout(location = 0) in vec4 passParameterSem3;
+layout(location = 0) out vec4 passPixelColor0;
+uniform vec2 uf_fragCoordScale;
+
+const float resScale = <?=$scaleFactorY?>;
+const int radius = int(2*resScale);
+
+void main() {
+	vec2 center = (passParameterSem3.xy + passParameterSem3.zw) / 2;
+	vec2 step = passParameterSem3.xw - passParameterSem3.zy;
+	vec4 result = vec4(0.0);
+	float count = 0.0;
+	for (int x = -radius; x <= radius; x++) {
+		for (int y = -radius; y <= radius; y++) {
+			if (length(vec2(x, y)) <= radius) {
+				result += texture(textureUnitPS0, center + vec2(x, y)*step);
+				count += 1.0;
+			}
+		}
+	}
+	passPixelColor0 = result / count;
+}
\ No newline at end of file