summaryrefslogtreecommitdiff
path: root/Data/Sys
diff options
context:
space:
mode:
authoriwubcode <iwubcode@users.noreply.github.com>2025-11-18 00:21:38 -0600
committeriwubcode <iwubcode@users.noreply.github.com>2026-03-26 20:14:40 -0500
commitd8c8a04ab84da6562e97e5f80e4b60560e0c8bfb (patch)
tree533ca54b913d22c0bd65b177f5762191b1e9f78b /Data/Sys
parentdb7287752014f7ad769771ddbdfc3ec9bcd9906b (diff)
Data: add a blurred DOF feature
Diffstat (limited to 'Data/Sys')
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/all.txt0
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.ps.glsl45
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.rastershader23
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.vs.glsl4
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_horizontal.rastermaterial19
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_vertical.rastermaterial19
-rw-r--r--Data/Sys/Load/GraphicMods/All Games Blurred DOF/metadata.json41
7 files changed, 151 insertions, 0 deletions
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/all.txt b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/all.txt
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/all.txt
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.ps.glsl b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.ps.glsl
new file mode 100644
index 0000000000..3ad5cb5856
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.ps.glsl
@@ -0,0 +1,45 @@
+void process_fragment(in DolphinFragmentInput frag_input, out DolphinFragmentOutput frag_output)
+{
+ int layer = int(frag_input.tex0.z);
+ int r = int(efb_scale) * int(SPREAD_MULTIPLIER);
+ int coord;
+ int length;
+ int2 initial_coords = int2(frag_input.tex0.xy * source_resolution.xy);
+ vec4 brightness = float4(1.0, 1.0, 1.0, 1.0);
+ if (HORIZONTAL)
+ {
+ length = int(source_resolution.x);
+ coord = initial_coords.x;
+ brightness = BRIGHTNESS_MULTIPLIER * brightness;
+ }
+ else
+ {
+ length = int(source_resolution.y);
+ coord = initial_coords.y;
+ }
+
+ int offset;
+ vec4 count = vec4(0.0,0.0,0.0,0.0);
+ vec4 col = vec4(0.0,0.0,0.0,0.0);
+ for (offset = -r; offset <= r; offset++)
+ {
+ int pos = coord + offset;
+ if (pos <= length && pos >= 0)
+ {
+ int3 sample_coords;
+ if (HORIZONTAL)
+ {
+ sample_coords = int3(int2(pos, initial_coords.y), layer);
+ }
+ else
+ {
+ sample_coords = int3(int2(initial_coords.x, pos), layer);
+ }
+
+ col += texelFetch(samp0, sample_coords, 0);
+ count += vec4(1.0,1.0,1.0,1.0);
+ }
+ }
+ frag_output.main = col / count * brightness;
+
+}
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.rastershader b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.rastershader
new file mode 100644
index 0000000000..6c66f0b81e
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.rastershader
@@ -0,0 +1,23 @@
+{
+ "properties":[
+ {
+ "code_name": "HORIZONTAL",
+ "default": true,
+ "description": "Whether to apply the blur horizontally or vertically",
+ "type": "bool"
+ },
+ {
+ "code_name": "SPREAD_MULTIPLIER",
+ "default": 1.0,
+ "description": "How much to spread the blur",
+ "type": "float"
+ },
+ {
+ "code_name": "BRIGHTNESS_MULTIPLIER",
+ "default": 1.0,
+ "description": "How bright the blur is",
+ "type": "float"
+ }
+ ],
+ "samplers":[]
+}
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.vs.glsl b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.vs.glsl
new file mode 100644
index 0000000000..68d5c36778
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur.vs.glsl
@@ -0,0 +1,4 @@
+void process_vertex(in DolphinVertexInput vertex_input, out DolphinVertexOutput vertex_output)
+{
+ dolphin_process_emulated_vertex(vertex_input, vertex_output);
+}
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_horizontal.rastermaterial b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_horizontal.rastermaterial
new file mode 100644
index 0000000000..ca9887f082
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_horizontal.rastermaterial
@@ -0,0 +1,19 @@
+{
+ "next_material_asset":"dolphin_dof_blur_vertical",
+ "properties":[
+ {
+ "type": "bool",
+ "value": true
+ },
+ {
+ "type": "float",
+ "value": 1.0
+ },
+ {
+ "type": "float",
+ "value": 1.0
+ }
+ ],
+ "textures":[],
+ "shader_asset": "dolphin_dof_blur"
+}
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_vertical.rastermaterial b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_vertical.rastermaterial
new file mode 100644
index 0000000000..3934d7994f
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/blur_vertical.rastermaterial
@@ -0,0 +1,19 @@
+{
+ "next_material_asset":"",
+ "properties":[
+ {
+ "type": "bool",
+ "value": false
+ },
+ {
+ "type": "float",
+ "value": 1.0
+ },
+ {
+ "type": "float",
+ "value": 1.0
+ }
+ ],
+ "textures":[],
+ "shader_asset": "dolphin_dof_blur"
+}
diff --git a/Data/Sys/Load/GraphicMods/All Games Blurred DOF/metadata.json b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/metadata.json
new file mode 100644
index 0000000000..0eb0f4b8b0
--- /dev/null
+++ b/Data/Sys/Load/GraphicMods/All Games Blurred DOF/metadata.json
@@ -0,0 +1,41 @@
+{
+ "meta":
+ {
+ "title": "DOF Blurred",
+ "author": "Dolphin Team",
+ "description": "Modifies depth of field effects to blur them to their native resolution. Results in depth of field looking much more natural at higher resolutions but the blur may be too intense in some games."
+ },
+ "features":
+ [
+ {
+ "group": "DOF",
+ "action": "custom_pipeline",
+ "action_data":
+ {
+ "material_asset": "dolphin_dof_blur_horizontal"
+ }
+ }
+ ],
+ "assets": [
+ {
+ "data": {
+ "metadata": "blur.rastershader",
+ "pixel_shader": "blur.ps.glsl",
+ "vertex_shader": "blur.vs.glsl"
+ },
+ "name": "dolphin_dof_blur"
+ },
+ {
+ "data": {
+ "metadata": "blur_horizontal.rastermaterial"
+ },
+ "name": "dolphin_dof_blur_horizontal"
+ },
+ {
+ "data": {
+ "metadata": "blur_vertical.rastermaterial"
+ },
+ "name": "dolphin_dof_blur_vertical"
+ }
+ ]
+}