Skip to content

Commit

Permalink
Data: update built-in graphics mods to use 2.0 features
Browse files Browse the repository at this point in the history
  • Loading branch information
iwubcode committed Apr 14, 2024
1 parent 5b56c62 commit 97ef422
Show file tree
Hide file tree
Showing 21 changed files with 626 additions and 317 deletions.
35 changes: 21 additions & 14 deletions Data/Sys/Load/GraphicMods/All Games Bloom Removal/metadata.json
@@ -1,15 +1,22 @@
{
"meta":
{
"title": "Bloom Removal",
"author": "Dolphin Team",
"description": "Skips drawing bloom effects. May be preferable when using a bloom solution from Dolphin's post processing shaders or a third party tool."
},
"features":
[
{
"group": "Bloom",
"action": "skip"
}
]
}
"actions": [
{
"data": {},
"factory_name": "skip"
}
],
"assets": [
],
"meta": {
"author": "Dolphin Team",
"description": "Skips drawing bloom effects. May be preferable when using a bloom solution from Dolphin's post processing shaders or a third party tool.",
"mod_version": "1.0.0",
"schema_version": 1,
"title": "Bloom Removal"
},
"tag_to_actions": {
"Bloom": [
0
]
}
}
33 changes: 20 additions & 13 deletions Data/Sys/Load/GraphicMods/All Games DOF Removal/metadata.json
@@ -1,15 +1,22 @@
{
"meta":
{
"title": "DOF Removal",
"author": "Dolphin Team",
"description": "Skips drawing DOF effects. May be preferable when using a DOF solution from Dolphin's post processing shaders or a third party tool."
},
"features":
[
{
"group": "DOF",
"action": "skip"
}
]
"actions": [
{
"data": {},
"factory_name": "skip"
}
],
"assets": [
],
"meta": {
"author": "Dolphin Team",
"description": "Skips drawing DOF effects. May be preferable when using a DOF solution from Dolphin's post processing shaders or a third party tool.",
"mod_version": "1.0.0",
"schema_version": 1,
"title": "DOF Removal"
},
"tag_to_actions": {
"Depth of Field": [
0
]
}
}
34 changes: 21 additions & 13 deletions Data/Sys/Load/GraphicMods/All Games HUD Removal/metadata.json
@@ -1,14 +1,22 @@
{
"meta":
{
"title": "Remove HUD",
"author": "Dolphin Team",
"description": "Skips drawing elements designated as the HUD. Can be used for taking screenshots or increasing immersion."
},
"features": [
{
"group": "HUD",
"action": "skip"
}
]
}
"actions": [
{
"data": {},
"factory_name": "skip"
}
],
"assets": [
],
"meta": {
"author": "Dolphin Team",
"description": "Skips drawing elements designated as the HUD. Can be used for taking screenshots or increasing immersion.",
"mod_version": "1.0.0",
"schema_version": 1,
"title": "Remove HUD"
},
"tag_to_actions": {
"User Interface": [
0
]
}
}
@@ -0,0 +1,66 @@
float4 SampleTexmap(uint texmap, float3 coords)
{
for (uint i = 0; i < 8; i++)
{
if (texmap == i)
{
return texture(samp[i], coords);
}
}
return float4(0, 0, 0, 1);
}

float2 GetTextureSize(uint texmap)
{
for (uint i = 0; i < 8; i++)
{
if (texmap == i)
{
return float2(textureSize(samp[i], 0));
}
}
return float2(0, 0);
}

vec4 custom_main( in CustomShaderData data )
{
if (data.texcoord_count == 0)
{
return data.final_color;
}

if (data.tev_stage_count == 0)
{
return data.final_color;
}

uint efb = data.tev_stages[0].texmap;
float3 coords = data.texcoord[0];
float4 out_color = SampleTexmap(efb, coords);
float2 size = GetTextureSize(efb);

// If options are added to the UI, include custom radius and intensity, radius should be around IR - 1.
// Small values decrease bloom area, but can lead to broken bloom if too small.
float intensity = 1.0;

float radius = 3;
float dx = 1.0/size.x;
float dy = 1.0/size.y;
float x;
float y;
float count = 1.0;
float4 color = float4(0.0, 0.0, 0.0, 0.0);

for (x = -radius; x <= radius; x++)
{
for (y = -radius; y <= radius; y++)
{
count += 1.0;
float3 off_coords = float3(coords.x + x*dx, coords.y + y*dy, coords.z);
color += SampleTexmap(efb, off_coords);
}
}

out_color = color / count * intensity;
return out_color;
}
@@ -0,0 +1,4 @@
{
"shader_asset": "bloom_shader",
"values": []
}
@@ -0,0 +1,3 @@
{
"properties": []
}
@@ -1,20 +1,42 @@
{
"meta":
{
"title": "Native Resolution Bloom",
"author": "Dolphin Team",
"description": "Scales bloom effects to draw at their native resolution, regardless of internal resolution. Results in bloom looking much more natural at higher resolutions but may cause shimmering."
},
"features":
[
{
"group": "Bloom",
"action": "scale",
"action_data": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0
}
}
]
}
"actions": [
{
"data": {
"active": true,
"passes": [
{
"pixel_material_asset": "bloom_material"
}
]
},
"factory_name": "custom_pipeline"
}
],
"assets": [
{
"data": {
"metadata": "bloom.shader",
"shader": "bloom.glsl"
},
"id": "bloom_shader"
},
{
"data": {
"metadata": "bloom.material"
},
"id": "bloom_material"
}
],
"meta": {
"author": "Dolphin Team",
"description": "Scales bloom effects to draw at their native resolution, regardless of internal resolution. Results in bloom looking much more natural at higher resolutions.",
"mod_version": "1.0.0",
"schema_version": 1,
"title": "Native Resolution Bloom"
},
"tag_to_actions": {
"Bloom": [
0
]
}
}
66 changes: 66 additions & 0 deletions Data/Sys/Load/GraphicMods/All Games Native Resolution DOF/dof.glsl
@@ -0,0 +1,66 @@
float4 SampleTexmap(uint texmap, float3 coords)
{
for (uint i = 0; i < 8; i++)
{
if (texmap == i)
{
return texture(samp[i], coords);
}
}
return float4(0, 0, 0, 1);
}

float2 GetTextureSize(uint texmap)
{
for (uint i = 0; i < 8; i++)
{
if (texmap == i)
{
return float2(textureSize(samp[i], 0));
}
}
return float2(0, 0);
}

vec4 custom_main( in CustomShaderData data )
{
if (data.texcoord_count == 0)
{
return data.final_color;
}

if (data.tev_stage_count == 0)
{
return data.final_color;
}

uint efb = data.tev_stages[0].texmap;
float3 coords = data.texcoord[0];
float4 out_color = SampleTexmap(efb, coords);
float2 size = GetTextureSize(efb);

// If options are added to the UI, include custom radius and intensity, radius should be around IR - 1.
// Small values decrease bloom area, but can lead to broken bloom if too small.
float intensity = 1.0;

float radius = 3;
float dx = 1.0/size.x;
float dy = 1.0/size.y;
float x;
float y;
float count = 1.0;
float4 color = float4(0.0, 0.0, 0.0, 0.0);

for (x = -radius; x <= radius; x++)
{
for (y = -radius; y <= radius; y++)
{
count += 1.0;
float3 off_coords = float3(coords.x + x*dx, coords.y + y*dy, coords.z);
color += SampleTexmap(efb, off_coords);
}
}

out_color = color / count * intensity;
return out_color;
}
@@ -0,0 +1,4 @@
{
"shader_asset": "dof_shader",
"values": []
}
@@ -0,0 +1,3 @@
{
"properties": []
}
@@ -1,20 +1,42 @@
{
"meta":
{
"title": "Native Resolution DOF",
"author": "Dolphin Team",
"description": "Scales DOF effects to draw at their native resolution, regardless of internal resolution. Results in DOF looking much more natural at higher resolutions but may cause shimmering."
},
"features":
[
{
"group": "DOF",
"action": "scale",
"action_data": {
"X": 1.0,
"Y": 1.0,
"Z": 1.0
}
}
]
"actions": [
{
"data": {
"active": true,
"passes": [
{
"pixel_material_asset": "dof_material"
}
]
},
"factory_name": "custom_pipeline"
}
],
"assets": [
{
"data": {
"metadata": "dof.shader",
"shader": "dof.glsl"
},
"id": "dof_shader"
},
{
"data": {
"metadata": "dof.material"
},
"id": "dof_material"
}
],
"meta": {
"author": "Dolphin Team",
"description": "Scales depth of field (dof) effects to draw at their native resolution, regardless of internal resolution. Results for dof looking much more natural at higher resolutions.",
"mod_version": "1.0.0",
"schema_version": 1,
"title": "Native Resolution DOF"
},
"tag_to_actions": {
"Depth of Field": [
0
]
}
}

0 comments on commit 97ef422

Please sign in to comment.