# 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.


[Definition]
titleIds = 0005000011111111,0005000022222222 # List of one or multiple titleIds (unique game indentifier) which are used to determine for which games this pack is active
name = "Example pack 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"

# 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.

# TextureRedefine:
# 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)

[TextureRedefine] # <-- Rule type
# filter:
width = 1280
height = 720
formats = 0x20,0x1A # Texture format must match any of these ('0x' prefix denotes hexadecimal format, can contain multiple formats separated by comma)
#formatsExcluded = 0x31,0x32,0x33,0x34,0x35 #  
# 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.

# overwrite with:
overwriteWidth = 1920
overwriteHeight = 1080
# 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.