In order to edit this wiki, you must register and verify your account.

Graphic packs creation: Difference between revisions

From Cemu Wiki
Jump to:navigation Jump to:search
No edit summary
No edit summary
Line 1: Line 1:
[[Tutorial:Graphic pack|graphic packs]] behave like graphic mods. Anyone can make one (assuming they have the necessary know-how) and users can download and install them. In the options of Cemu individual graphic packs can then be enabled or disabled. Additionally, multiple graphic packs can be active for the same game as long as they don't interfere with each other. You can mix and match according to your own personal preference.
A [[Tutorial:Graphic pack|graphic pack]] is a folder with the the name of the game, without spaces and at the end the resolution. For example:<code>NameOfGame_1080p</code>
A [[Tutorial:Graphic pack|graphic pack]] is a folder with the the name of the game, without spaces and at the end the resolution. For example:<code>NameOfGame_1080p</code>


Line 19: Line 21:
In this folder are the txt file <code>rules.txt</code>. [[Tutorial:Graphic pack|Click here to learn how to install a graphic pack]]
In this folder are the txt file <code>rules.txt</code>. [[Tutorial:Graphic pack|Click here to learn how to install a graphic pack]]


==rules.txt==
===rules.txt===
rules.txt contains information about the graphic pack, the games it is applied to and one or multiple rules that can modify texture properties. Everything after a <code>#</code> character is considered a comment.
rules.txt contains information about the graphic pack, the games it is applied to and one or multiple rules that can modify texture properties. Everything after a <code>#</code> character is considered a comment.


Line 40: Line 42:
There are the two Section [Definition] and [TextureRedefine] and under this section are some variables that can be changed
There are the two Section [Definition] and [TextureRedefine] and under this section are some variables that can be changed


===Section: [Definition]===
====Section: [Definition]====
====Variable: titleIds====
=====Variable: titleIds=====
List of one or multiple titleIds (unique game indentifier) which are used to determine for which games this pack is active.
List of one or multiple titleIds (unique game indentifier) which are used to determine for which games this pack is active.
====Variable: name====
=====Variable: name=====
Name which appears in Cemu's "Graphic packs" window. We recommend a "gamename - effect" style naming scheme. E.g. "Mario Kart 8 - 1080p resolution".
Name which appears in Cemu's "Graphic packs" window. We recommend a "gamename - effect" style naming scheme. E.g. "Mario Kart 8 - 1080p resolution".


===Section: [TextureRedefine]===
====Section: [TextureRedefine]====
After the [Definition] section one or multiple texture rules can follow. Currently there is only one type of rule supported, called 'TextureRedefine'. Below is a description of what it does and how it works.
After the [Definition] section one or multiple texture rules can follow. Currently there is only one type of rule supported, called 'TextureRedefine'. Below is a description of what it does and how it works.


Line 54: Line 56:
Note that texture rules are applied upon creation of the texture. Multiple rules can apply to the same textures as long as they don't interfere with each other (e.g. one rule to set the width/height and another rule to set the format)
Note that texture rules are applied upon creation of the texture. Multiple rules can apply to the same textures as long as they don't interfere with each other (e.g. one rule to set the width/height and another rule to set the format)


===Filter settings===
====Filter settings====
====Variable: width====
=====Variable: width=====
====Variable: height====
=====Variable: height=====
====Variable: formats====
=====Variable: formats=====
Texture format must match any of these ('0x' prefix denotes hexadecimal format, can contain multiple formats separated by comma)
Texture format must match any of these ('0x' prefix denotes hexadecimal format, can contain multiple formats separated by comma)
====Variable: formatsExcluded====
=====Variable: formatsExcluded=====
If any of the filter settings above are omitted they are not evaluated. This allows you to write a rule that, for example, only filters for the width of a texture but not the height.
If any of the filter settings above are omitted they are not evaluated. This allows you to write a rule that, for example, only filters for the width of a texture but not the height.


====Variable: overwriteWidth====
=====Variable: overwriteWidth=====
Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.
Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.
====Variable: overwriteHeight====
=====Variable: overwriteHeight=====
Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.
Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.


== Common use case example: ==
=== Common use case example: ===
Many games run in 1280x720 resolution and we would like to use a textureRule to upscale those games to 1920x1080. <br>
Many games run in 1280x720 resolution and we would like to use a textureRule to upscale those games to 1920x1080. <br>
Here is how it would look:
Here is how it would look:
Line 77: Line 79:
This rule applies to all textures that have a resolution of 1280x720 and overwrites their resolution to be 1920x1080. Depending on the game, this might suffice for simple upscaling. However, since the filter settings in this example are very loose (only width and height is checked) the rule might catch unwanted textures. Some games use background or splash screen textures that have the same resolution as the intended screen resolution. Since Cemu resets the contents of a texture if any rule is applied, you would end up with a black background. A workaround for this is to use the texture dump feature of Cemu and figure out more exact filters.
This rule applies to all textures that have a resolution of 1280x720 and overwrites their resolution to be 1920x1080. Depending on the game, this might suffice for simple upscaling. However, since the filter settings in this example are very loose (only width and height is checked) the rule might catch unwanted textures. Some games use background or splash screen textures that have the same resolution as the intended screen resolution. Since Cemu resets the contents of a texture if any rule is applied, you would end up with a black background. A workaround for this is to use the texture dump feature of Cemu and figure out more exact filters.


==Shader replacement==
===Shader replacement===
Wii U's GPU supports a fully programmable pipeline. Meaning each drawcall is associated with a vertex and pixel shader and an optional geometry shader.
Wii U's GPU supports a fully programmable pipeline. Meaning each drawcall is associated with a vertex and pixel shader and an optional geometry shader.
Cemu's graphic pack feature allows to overwrite individual shaders giving control over many aspects of a game's render pipeline. For an example see the 'TheWindWaker_reducedBloom' graphic pack.
Cemu's graphic pack feature allows to overwrite individual shaders giving control over many aspects of a game's render pipeline. For an example see the 'TheWindWaker_reducedBloom' graphic pack.

Revision as of 16:47, 18 March 2017

graphic packs behave like graphic mods. Anyone can make one (assuming they have the necessary know-how) and users can download and install them. In the options of Cemu individual graphic packs can then be enabled or disabled. Additionally, multiple graphic packs can be active for the same game as long as they don't interfere with each other. You can mix and match according to your own personal preference.

A graphic pack is a folder with the the name of the game, without spaces and at the end the resolution. For example:NameOfGame_1080p

Resolutions are for example:

  • 360p
  • 540p
  • 720p
  • 1080p
  • 2160p
  • 2880p
  • 4320p
  • 5760p

In this folder are the txt file rules.txt. Click here to learn how to install a graphic pack

rules.txt

rules.txt contains information about the graphic pack, the games it is applied to and one or multiple rules that can modify texture properties. Everything after a # character is considered a comment.

Note: While not necessary, knowledge about engines, rendering concepts, graphic effects etc. is helpful when trying to create your own graphic packs.

Here is a example of a rules.txt

[Definition]
titleIds = 000500001010ec00,0005000e1010ed00,0005000e1010eb00
name = "Mario Kart 8 - 2160p (4K)"

[TextureRedefine]
width = 1280
height = 720
formatsExcluded = 0x41A # exclude the intro background texture
overwriteWidth = 3840
overwriteHeight = 2160

There are the two Section [Definition] and [TextureRedefine] and under this section are some variables that can be changed

Section: [Definition]

Variable: titleIds

List of one or multiple titleIds (unique game indentifier) which are used to determine for which games this pack is active.

Variable: name

Name which appears in Cemu's "Graphic packs" window. We recommend a "gamename - effect" style naming scheme. E.g. "Mario Kart 8 - 1080p resolution".

Section: [TextureRedefine]

After the [Definition] section one or multiple texture rules can follow. Currently there is only one type of rule supported, called 'TextureRedefine'. Below is a description of what it does and how it works.

This rule type can be used to overwrite certain texture properties, like the resolution or format. There are two parts to each 'TextureRedefine' rule:
The filter settings. The rule will only apply to textures when the original texture properties match the values given by the filter settings. The overwrite settings. If a texture matches the filter, these properties are applied. The idea is that via these rules you can tell Cemu which textures to modify and how to modify them.

Note that texture rules are applied upon creation of the texture. Multiple rules can apply to the same textures as long as they don't interfere with each other (e.g. one rule to set the width/height and another rule to set the format)

Filter settings

Variable: width
Variable: height
Variable: formats

Texture format must match any of these ('0x' prefix denotes hexadecimal format, can contain multiple formats separated by comma)

Variable: formatsExcluded

If any of the filter settings above are omitted they are not evaluated. This allows you to write a rule that, for example, only filters for the width of a texture but not the height.

Variable: overwriteWidth

Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.

Variable: overwriteHeight

Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.

Common use case example:

Many games run in 1280x720 resolution and we would like to use a textureRule to upscale those games to 1920x1080.
Here is how it would look:

[TextureRedefine]
width = 1280
height = 720
overwriteWidth = 1920
overwriteHeight = 1080 

This rule applies to all textures that have a resolution of 1280x720 and overwrites their resolution to be 1920x1080. Depending on the game, this might suffice for simple upscaling. However, since the filter settings in this example are very loose (only width and height is checked) the rule might catch unwanted textures. Some games use background or splash screen textures that have the same resolution as the intended screen resolution. Since Cemu resets the contents of a texture if any rule is applied, you would end up with a black background. A workaround for this is to use the texture dump feature of Cemu and figure out more exact filters.

Shader replacement

Wii U's GPU supports a fully programmable pipeline. Meaning each drawcall is associated with a vertex and pixel shader and an optional geometry shader. Cemu's graphic pack feature allows to overwrite individual shaders giving control over many aspects of a game's render pipeline. For an example see the 'TheWindWaker_reducedBloom' graphic pack.

In order to get access to the shaders that are used by Cemu you can enable the debug option 'Dump shaders' before or while a game is running. Make sure to delete the contents of the shaderCache/ dirctory first as Cemu will not dump shaders that are already cached. Since the shaders generated by Cemu are translated from low-level binary instructions they contain little to no human-readable information. You likely won't be able to figure out what a shader does just by looking at it's source. Therefore it is recommended to use third-party tools like NVIDIA's NSIGHT or AMD's GPU PerfStudio to do realtime graphics debugging while a game is running in Cemu. (Again make sure to delete the contents of shaderCache/ beforehand)

Once you have located a shader that you want to edit, you can copy it from the dump/shaders/ directory into your graphics pack. You then can make any adjustments you want to the shader source. Any GLSL compilation errors will be written to log.txt