Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing a Dolphin graphics mod editor #12280

Draft
wants to merge 100 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
100 commits
Select commit Hold shift + click to select a range
e9a8829
Core: add GraphicsModEditor::EditorMain to System
iwubcode Jul 23, 2023
31b3952
temp add all new files in one go
iwubcode Jul 23, 2023
9eaf070
Common / Core: add a new location for dumping meshes
iwubcode Jan 13, 2024
6142844
VideoCommon: add graphics mod editor types
iwubcode Jul 24, 2023
f17204b
VideoCommon: add graphics mod editor events
iwubcode Jul 24, 2023
267e827
VideoCommon: add graphics mod editor state
iwubcode Jul 24, 2023
69c5270
VideoCommon: add graphics mod editor functionality to determine if a …
iwubcode Jun 17, 2024
638b873
VideoCommon: add active target panel
iwubcode Jul 24, 2023
6dfa5f4
VideoCommon: add graphics mod editor properties panel
iwubcode Jul 24, 2023
4a9962f
VideoCommon: add graphics mod editor asset browser panel
iwubcode Jul 24, 2023
88979f3
VideoCommon: add graphics mod editor main
iwubcode Jul 24, 2023
d1e7f94
VideoCommon: add editor backend
iwubcode Mar 14, 2024
123e1fc
VideoCommon: draw editor UI on screen when it is enabled
iwubcode Jul 25, 2023
85ec372
VideoCommon: update graphics mod action interface with details needed…
iwubcode Jul 25, 2023
2a87628
VideoCommon: Initialize editor in ui....
iwubcode Jul 25, 2023
ef7622b
VideoCommon: add SHIFT and CTRL keys to be visible to imgui
iwubcode Jul 30, 2023
e7f297a
VideoCommon: add logic to generate materials from textures using a ma…
iwubcode Jun 2, 2024
cad801f
VideoCommon: add logic to generate shader using a shader template and…
iwubcode Jan 19, 2025
47cf77a
VideoCommon: add asset library source for the graphics mod editor tha…
iwubcode Aug 17, 2023
43babc5
VideoCommon: add graphics mod editor control for displaying an asset
iwubcode Nov 5, 2023
08360a8
VideoCommon: add graphics mod editor control for texture assets
iwubcode Aug 17, 2023
e7f63d4
VideoCommon: add graphics mod editor control for material assets
iwubcode Aug 17, 2023
3fe755a
VideoCommon: add graphics mod editor control for shader assets
iwubcode Aug 17, 2023
df8f322
VideoCommon: add graphics mod editor control for extracting meshes fr…
iwubcode Jan 13, 2024
6f276bd
VideoCommon: add graphics mod editor control for converting a GLTF me…
iwubcode Jan 21, 2024
0385a44
VideoCommon: add graphics mod editor control for mesh assets
iwubcode Dec 30, 2023
937d2de
VideoCommon: add graphics mod editor control for displaying a selecti…
iwubcode Apr 9, 2024
aab9e6f
VideoCommon: add graphics mod editor control for displaying a colored…
iwubcode Apr 9, 2024
3826a78
VideoCommon: add graphics mod editor window control for generating a …
iwubcode Jun 2, 2024
565e483
VideoCommon: fix TextureCacheBase so that an invalid asset won't caus…
iwubcode Sep 25, 2023
204768e
VideoCommon: support resetting custom asset loader
iwubcode Nov 4, 2023
f87f231
VideoCommon: add support for serializing graphics mod actions to json…
iwubcode Nov 4, 2023
f19a905
Common: add define for graphics mod editor directory name
iwubcode Nov 4, 2023
6b197d2
Temp for IMGUI development
iwubcode Nov 4, 2023
1e914fd
Data: add graphics mod editor highlight pipeline action for highlight…
iwubcode Nov 6, 2023
9b7525c
Data: add graphics mod editor light visualization pipeline action for…
iwubcode Jun 19, 2024
ef036a8
Data: add graphics mod editor templates used when creating materials …
iwubcode Nov 6, 2023
ab0f7a8
Data: add graphics mod editor temporary textures for various operatio…
iwubcode Nov 6, 2023
477d39b
VideoCommon: update the scale action to support the graphics mod editor
iwubcode Nov 10, 2023
78fc457
Externals: add missing helper cpp to imgui
iwubcode Nov 10, 2023
8a2646c
Update imgui to 1.90.8
iwubcode Nov 16, 2023
3ca8a3f
VideoCommon: expose index generator data so it can be hashed
iwubcode Dec 3, 2023
f9f05a1
VideoCommon: add graphics mod light action callback
iwubcode Dec 3, 2023
e3af2d7
VideoCommon: update skip action to be able to skip lights
iwubcode Dec 3, 2023
af1d58c
VideoCommon: add an action to modify an existing game light
iwubcode Dec 3, 2023
ceef9c3
VideoCommon: add a graphics mod action that allows you to render a se…
iwubcode Dec 30, 2023
568db8e
graphics mod data for custom meshes
iwubcode Dec 30, 2023
6d7e0d7
custom transform changes
iwubcode Feb 2, 2024
44026f5
VideoCommon: add an object called 'SceneDumper' that allows someone t…
iwubcode Jan 13, 2024
05498d9
VideoCommon: update the IndexGenerator logic to take a flag that avoi…
iwubcode Jan 13, 2024
393d9c1
video backend changes for custom meshes
iwubcode Feb 2, 2024
3488ca2
Temporary (?) shader cache changes to disable caching of shaders
iwubcode Jan 21, 2024
0483f63
CustomShaderCache temporary (?) changes to support mesh shaders that …
iwubcode Jan 21, 2024
cbe4aeb
Likely temporary (?) change to XFMemory to support passing through te…
iwubcode Jan 21, 2024
3d99954
Vertex shader gen changes to use passthrough texture gen mode for cus…
iwubcode Jan 21, 2024
6d8eee7
VideoCommon: custom pipeline, add serialize/imgui/factory logic
iwubcode Jan 27, 2024
67925bd
Add transform to graphics mod action data
iwubcode Feb 4, 2024
8ee1aaf
VideoCommon: add a transform action that allows the user to move/scal…
iwubcode Feb 4, 2024
948efb7
add transform to graphics mod action factory
iwubcode Feb 4, 2024
3457c33
VideoCommon: add mesh action to the graphics mod factory
iwubcode Jun 17, 2024
84e6e52
VideoCommon: move graphics mod common types to a specific file that c…
iwubcode Dec 3, 2023
b28f614
VideoCommon: graphics mods 2.0!
iwubcode Apr 10, 2024
089288c
graphics mod action (get/set id)
iwubcode Apr 10, 2024
e68bc46
VideoCommon: update system to add graphics mod system manager
iwubcode Mar 14, 2024
7e95ece
DolphinQt: update for graphics mod 2.0
iwubcode Mar 14, 2024
a3272c6
Android: update UI for graphics mods 2.0
iwubcode Apr 14, 2024
5c67515
VideoCommon: update videoconfig for graphics mod 2.0
iwubcode Mar 14, 2024
4701a0e
VideoCommon: update emulation classes for graphics mod 2.0
iwubcode Jul 25, 2023
0068299
Data: update built-in graphics mods to use 2.0 features
iwubcode Apr 9, 2024
bc70f51
VideoCommon: add material asset utility function to set material prop…
iwubcode Jun 2, 2024
46ff431
VideoCommon: add a custom texture cache for graphics mods
iwubcode Jun 8, 2024
77d91fe
Remove custom pipeline, it is replaced by the ResourceManager
iwubcode Jun 17, 2024
b604e44
texture cache base
iwubcode Jun 17, 2024
1601d7e
VideoCommon: revamp asset loading system to: run with multiple worke…
iwubcode Jun 24, 2024
e2f90b0
VideoCommon: texture cache update for new asset system...
iwubcode Jun 24, 2024
13bd582
custom pipeline action...
iwubcode Jun 30, 2024
3739a1a
Externals: add watcher, a library used to watch a filesystem location…
iwubcode Jul 4, 2024
f73fc20
VideoCommon: watch texture pack folder for texture reloads
iwubcode Jul 4, 2024
8c02cec
VideoCommon: add types file for assets, will be expanded later
iwubcode Jul 4, 2024
d22ef65
Rework material asset for new material system
iwubcode Jul 21, 2024
e9743ca
Rework shader asset for new material system
iwubcode Jul 21, 2024
235af45
VideoCommon: add structure for the texture value for materials, this …
iwubcode Jul 21, 2024
9cc600d
graphics mod action data
iwubcode Jul 21, 2024
e84c455
Core: add 'clear' method to SmallVector
iwubcode Jan 10, 2025
5575f45
direct asset library
iwubcode Jan 10, 2025
b6cbd40
custom asset library
iwubcode Jan 11, 2025
38b3dcf
lighting shadergen
iwubcode Jan 11, 2025
9f05c19
pixel shader gen
iwubcode Jan 11, 2025
0158de9
vertex shader gen
iwubcode Jan 11, 2025
62bee51
VideoCommon: set explicit values for AbstractTextureType, add fmt for…
iwubcode Jan 11, 2025
5da8633
NEW asset loader...
iwubcode Jan 18, 2025
b64b5ab
NEW texture cache
iwubcode Jan 18, 2025
ad79039
NEW custom shader cache
iwubcode Jan 18, 2025
269dd4d
VideoCommon: add a resource manager
iwubcode Jan 18, 2025
ba559e8
system
iwubcode Jan 18, 2025
ce63f5b
VideoCommon: make custom pixel shader uniforms const...
iwubcode Jan 18, 2025
a0c68a3
Video backend base changes for resource manager
iwubcode Jan 18, 2025
e96b9e7
graphics mod action factory
iwubcode Jan 19, 2025
38efb10
remove custom shader cache
iwubcode Jan 19, 2025
db20ed1
video config
iwubcode Jan 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -84,3 +84,6 @@
[submodule "Externals/Vulkan-Headers"]
path = Externals/Vulkan-Headers
url = https://github.com/KhronosGroup/Vulkan-Headers.git
[submodule "Externals/watcher/watcher"]
path = Externals/watcher/watcher
url = https://github.com/e-dant/watcher
2 changes: 2 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ if (USE_RETRO_ACHIEVEMENTS)
add_subdirectory(Externals/rcheevos)
endif()

add_subdirectory(Externals/watcher)

########################################
# Pre-build events: Define configuration variables and write SCM info header
#
Expand Down
8 changes: 8 additions & 0 deletions Data/Sys/GraphicsModEditor/Pipelines/highlight/color.ps.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
void fragment(in DolphinFragmentInput frag_input, out DolphinFragmentOutput frag_output)
{
dolphin_emulated_fragment(frag_input, frag_output);
vec3 tint_color = vec3(0.0, 0.0, 1.0);
vec3 input_color = frag_output.main.rgb / 255.0;
vec3 output_color = (0.5 * input_color) + (0.5 * tint_color.rgb);
frag_output.main.rgb = ivec3(output_color * 255);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pixel_properties":[],
"pixel_samplers":[],
"vertex_properties":[]
}
4 changes: 4 additions & 0 deletions Data/Sys/GraphicsModEditor/Pipelines/highlight/color.vs.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void vertex(in DolphinVertexInput vertex_input, out DolphinVertexOutput vertex_output)
{
dolphin_emulated_vertex(vertex_input, vertex_output);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"next_material_asset":"",
"pixel_properties":[],
"pixel_textures":[],
"shader_asset": "highlight_shader",
"vertex_properties":[]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
void fragment(in DolphinFragmentInput frag_input, out DolphinFragmentOutput frag_output)
{
if (frag_input.normal.xyz == vec3(0, 0, 0))
{
dolphin_emulated_fragment(frag_input, frag_output);
}
else
{
vec4 output_color = dolphin_calculate_lighting_chn0(frag_input.color_0, vec4(frag_input.position, 1), frag_input.normal);
frag_output.main = ivec4(output_color * 255.0);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"next_material_asset":"",
"pixel_properties":[],
"pixel_textures":[],
"shader_asset": "simple_light_visualization_shader",
"vertex_properties":[]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pixel_properties":[],
"pixel_samplers":[],
"vertex_properties":[]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void vertex(in DolphinVertexInput vertex_input, out DolphinVertexOutput vertex_output)
{
dolphin_emulated_vertex(vertex_input, vertex_output);
}
7 changes: 7 additions & 0 deletions Data/Sys/GraphicsModEditor/Templates/raster_material.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"shader_asset": "",
"pixel_properties": [],
"vertex_properties": [],
"next_material_asset": "",
"pixel_textures": []
}
5 changes: 5 additions & 0 deletions Data/Sys/GraphicsModEditor/Templates/raster_shader.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"pixel_properties": [],
"pixel_samplers": [],
"vertex_properties": []
}
4 changes: 4 additions & 0 deletions Data/Sys/GraphicsModEditor/Templates/raster_shader.ps.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void fragment(in DolphinFragmentInput frag_input, out DolphinFragmentOutput frag_output)
{
dolphin_emulated_fragment(frag_input, frag_output);
}
4 changes: 4 additions & 0 deletions Data/Sys/GraphicsModEditor/Templates/raster_shader.vs.glsl
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
void vertex(in DolphinVertexInput vertex_input, out DolphinVertexOutput vertex_output)
{
dolphin_emulated_vertex(vertex_input, vertex_output);
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
35 changes: 21 additions & 14 deletions Data/Sys/Load/GraphicMods/All Games Bloom Removal/metadata.json
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 Data/Sys/Load/GraphicMods/All Games DOF Removal/metadata.json
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 Data/Sys/Load/GraphicMods/All Games HUD Removal/metadata.json
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
]
}
}
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;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"shader_asset": "bloom_shader",
"values": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"properties": []
}
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
]
}
}
Loading