Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Data: update built-in graphics mods to use 2.0 features
- Loading branch information
Showing
21 changed files
with
626 additions
and
317 deletions.
There are no files selected for viewing
35 changes: 21 additions & 14 deletions
35
Data/Sys/Load/GraphicMods/All Games Bloom Removal/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
33
Data/Sys/Load/GraphicMods/All Games DOF Removal/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
34
Data/Sys/Load/GraphicMods/All Games HUD Removal/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
] | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
Data/Sys/Load/GraphicMods/All Games Native Resolution Bloom/bloom.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
4 changes: 4 additions & 0 deletions
4
Data/Sys/Load/GraphicMods/All Games Native Resolution Bloom/bloom.material
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"shader_asset": "bloom_shader", | ||
"values": [] | ||
} |
3 changes: 3 additions & 0 deletions
3
Data/Sys/Load/GraphicMods/All Games Native Resolution Bloom/bloom.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"properties": [] | ||
} |
60 changes: 41 additions & 19 deletions
60
Data/Sys/Load/GraphicMods/All Games Native Resolution Bloom/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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
66
Data/Sys/Load/GraphicMods/All Games Native Resolution DOF/dof.glsl
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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; | ||
} |
4 changes: 4 additions & 0 deletions
4
Data/Sys/Load/GraphicMods/All Games Native Resolution DOF/dof.material
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"shader_asset": "dof_shader", | ||
"values": [] | ||
} |
3 changes: 3 additions & 0 deletions
3
Data/Sys/Load/GraphicMods/All Games Native Resolution DOF/dof.shader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"properties": [] | ||
} |
58 changes: 40 additions & 18 deletions
58
Data/Sys/Load/GraphicMods/All Games Native Resolution DOF/metadata.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 | ||
] | ||
} | ||
} |
Oops, something went wrong.