Skip to content

How to create Graphic Packs

Michael edited this page Jul 19, 2021 · 12 revisions

Graphic packs are like upscaling 3D in emulators but with more features. 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, and different games can be activated at the same time. You can mix and match according to your own personal preference.

What graphic packs are able to do:

  • Change the game's internal resolution
  • Increase the resolution and quality of shadows
  • Modify or remove post-processing effects
  • Workarounds for graphic bugs until there's a proper solution
  • Change lighting related aspects of the game
  • Custom Anti-Aliasing
  • Better LOD Bias
  • Modify game files
  • Run 30fps games in 60fps (via Cemuhook)
  • Modify aspect ratio (via Cemuhook)
  • And much more...

From a technical standpoint, graphic packs allow the following:

  • Overwrite certain texture properties (like the resolution)
  • Overwrite shaders (very powerful since almost everything that gets drawn on the screen uses shaders)
  • Replace game files (such as replacing Link with Zelda)
  • Modify game code (via Cemuhook)

Create a graphic pack

A graphic pack is a folder with the the name of the game. This graphic pack repository exclusively uses pascal case, suffixed by the graphic packs function, separated by an underscore. For example: NameOfGame_Resolution. It'll always need to have a rules.txt included with this. Optionally, this folder can also contain custom shaders (files ending with _vs.txt or _ps.txt) or a patches.txt file (which are used by Cemuhook).

Rules

This is the core file of any graphic pack, since rules.txt contains information about the graphic pack, the games it is applied to. Optionally, you can also find presets or texture redefines here that can modify texture properties. Everything after a # character is considered a comment. There's also the singular vsyncFrequency rule, which is used in some graphic packs that deal with framerates.

An example from a section of a resolution pack

[Definition]
titleIds = 00050000101C9300,00050000101C9400,00050000101C9500
name = Resolution
path = "Minecraft: Wii U Edition/Graphics/Resolution"
description = Changes the game's resolution.
version = 7

[Preset]
name = 1280x720 (Default)
$width = 1280
$height = 720
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 3840x2160
$width = 3840
$height = 2160
$gameWidth = 1280
$gameHeight = 720

# TV Resolution

[TextureRedefine]
width = 1280
height = 720
formats = 0x0000001a,0x00000011,0x00000820
overwriteWidth = ($width/$gameWidth) * 1280 # This basically calculates a modifier value by dividing the target resolution by the game's native resolution.
overwriteHeight = ($height/$gameHeight) * 720

Customize output shader

Since 1.15.2 it's possible to customize the output/scale shader.

Works by putting a fragment shader with a fixed file name in the gfx pack folder:

upscaling.glsl (for upscaling)
downscaling.glsl (for downscaling)
output.glsl (if you want both in one)

There are new settings in rules.txt to toggle texture filtering between nearest and linear when a custom shader is provided.

[OutputShader]
upscaleMagFilter = NearestNeighbor
downscaleMagFilter = Linear

Default is Linear.

Usage of each section

There are the four sections: [Definition], [Preset], [Control] and [TextureRedefine]. Let's take a closer look at each one of these.

[Definition]

name description
titleIds List of one or multiple titleIds (unique game indentifier) which are used to determine for which games this pack is active.
name Name which appears in Cemu's "Graphic packs" window. Setting it to a short, identifiable name is recommended. (ex: Resolution)
path Path which appears in Cemu's "Graphic packs" window. Setting it with the game's name is recommended, followed by it's category and name, all separated by slashes (ex: "The Legend of Zelda: Breath of the Wild/Graphics/Resolution")
description The description of what the pack does.
vendorFilter Limits the pack to a specific vendor. <amd/intel/mesa/nvidia>
rendererFilter Limits the pack to a specific renderer. <opengl/vulkan>
version Version 4 is used since Cemu 1.16.0 and must always be set.

[Preset]

name description
name The name of this preset, which appears in this graphic pack's preset dropdown in Cemu's "Graphic packs" window.
$[variable] A set variable for the preset. Can be width, height, scale multiply, bloom strength, etc. (ex: $width, $height, $multiply, $strength). You can have multiple variables in each preset of course.

[Control]

name description
vsyncFrequency Sets the VSync frequency to any value that you want.

[TextureRedefine]

name description
width The width of the texture that you want to modify.
height The height of the texture that you want to modify.
depth The depth of the texture that you want to modify. Applies to 2D array textures, cubemap arrays (the number of layers in the array) and 3D textures. For everything else it's always 1.
formats The formats of the textures must match any of these ('0x' prefix denotes hexadecimal format, can contain multiple formats separated by comma).
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.
tilemodes Allowed texture tiling modes. Similar to 'formats' parameter, can contain multiple entries. 1 is linear aka no tiling, a strong indicator for direct CPU access to a texture.
tileModesExcluded "tileModesExcluded = 1" Skips CPU-generated textures like video frames, generally used by videos (ex. Xenoblade Chronicles X, Bayonetta 2).
overwriteLodBias Overwrites the game's lod bias. Typical valid values are in range -16.0 to 16.0.
overwriteRelativeLodBias Add value to game's lod bias rather than overwriting it. Typical valid values are in range -16.0 to 16.0.
overwriteFormat Replaces all the formats under this resolution (unless included/excluded via formats/excludeFormats) with the one defined here.
overwriteDepth Unknown usage
overwriteWidth Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the width but not the height etc.
overwriteHeight Like filter settings you can omit individual overwrite settings. This allows to selectively overwrite the height but not the width etc.

Possible formats

Texture Name Code
R8_UNORM 0x001
R8_UINT 0x101
R8_SNORM 0x201
R8_SINT 0x301
R4_G4_UNORM 0x002
R16_UNORM 0x005
R16_UINT 0x105
R16_SNORM 0x205
R16_SINT 0x305
R16_FLOAT 0x806
R8_G8_UNORM 0x007
R8_G8_UINT 0x107
R8_G8_SNORM 0x207
R8_G8_SINT 0x307
R5_G6_B5_UNORM 0x008
R5_G5_B5_A1_UNORM 0x00a
R4_G4_B4_A4_UNORM 0x00b
A1_B5_G5_R5_UNORM 0x00c
R32_UINT 0x10d
R32_SINT 0x30d
R32_FLOAT 0x80e
R16_G16_UNORM 0x00f
R16_G16_UINT 0x10f
R16_G16_SNORM 0x20f
R16_G16_SINT 0x30f
R16_G16_FLOAT 0x810
D24_S8_UNORM 0x011
X24_G8_UINT 0x111
D24_S8_FLOAT 0x811
R11_G11_B10_FLOAT 0x816
R10_G10_B10_A2_UNORM 0x019
R10_G10_B10_A2_UINT 0x119
R10_G10_B10_A2_SNORM 0x219
R10_G10_B10_A2_SINT 0x319
R10_G10_B10_A2_SRGB 0x419
R8_G8_B8_A8_UNORM 0x01a
R8_G8_B8_A8_UINT 0x11a
R8_G8_B8_A8_SNORM 0x21a
R8_G8_B8_A8_SINT 0x31a
R8_G8_B8_A8_SRGB 0x41a
A2_B10_G10_R10_UNORM 0x01b
A2_B10_G10_R10_UINT 0x11b
D32_FLOAT_S8_UINT_X24 0x81c
X32_G8_UINT_X24 0x11c
R32_G32_UINT 0x11d
R32_G32_SINT 0x31d
R32_G32_FLOAT 0x81e
R16_G16_B16_A16_UNORM 0x01f
R16_G16_B16_A16_UINT 0x11f
R16_G16_B16_A16_SNORM 0x21f
R16_G16_B16_A16_SINT 0x31f
R16_G16_B16_A16_FLOAT 0x820
R32_G32_B32_A32_UINT 0x122
R32_G32_B32_A32_SINT 0x322
R32_G32_B32_A32_FLOAT 0x823
BC1_UNORM 0x031
BC1_SRGB 0x431
BC2_UNORM 0x032
BC2_SRGB 0x432
BC3_UNORM 0x033
BC3_SRGB 0x433
BC4_UNORM 0x034
BC4_SNORM 0x234
BC5_UNORM 0x035
BC5_SNORM 0x235

Presets for games that are 1280x720

[Preset]
name = 1280x720 (Default)
$width = 1280
$height = 720
$gameWidth = 1280
$gameHeight = 720

# Performance

[Preset]
name = 640x360
$width = 640
$height = 360
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 960x540
$width = 960
$height = 540
$gameWidth = 1280
$gameHeight = 720

# Common HD Resolutions

[Preset]
name = 1600x900
$width = 1600
$height = 900
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 1920x1080
$width = 1920
$height = 1080
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 2560x1440
$width = 2560
$height = 1440
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 3200x1800
$width = 3200
$height = 1800
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 3840x2160
$width = 3840
$height = 2160
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 5120x2880
$width = 5120
$height = 2880
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 7680x4320
$width = 7680
$height = 4320
$gameWidth = 1280
$gameHeight = 720

## THE FOLLOWING REQUIRE A GAME PATCH (patches.txt) FOR CUSTOM ASPECT RATIOS, DON'T ADD THESE IF THE GAME PATCH DOESN'T EXIST

# Common Ultrawide Resolutions

[Preset]
name = 2560x1080 (Ultrawide)
$width = 2560
$height = 1080
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 3440x1440 (Ultrawide)
$width = 3440
$height = 1440
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 5120x2160 (Ultrawide)
$width = 5120
$height = 2160
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 6880x2880 (Ultrawide)
$width = 6880
$height = 2880
$gameWidth = 1280
$gameHeight = 720

[Preset]
name = 10240x4320 (Ultrawide)
$width = 10240
$height = 4320
$gameWidth = 1280
$gameHeight = 720

Presets for games that are 1920x1080

[Preset]
name = 1920x1080 (Default)
$width = 1920
$height = 1080
$gameWidth = 1920
$gameHeight = 1080

# Performance

[Preset]
name = 640x360
$width = 640
$height = 360
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 960x540
$width = 960
$height = 540
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 1280x720
$width = 1280
$height = 720
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 1600x900
$width = 1600
$height = 900
$gameWidth = 1920
$gameHeight = 1080

# Common HD Resolutions

[Preset]
name = 2560x1440
$width = 2560
$height = 1440
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 3200x1800
$width = 3200
$height = 1800
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 3840x2160
$width = 3840
$height = 2160
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 5120x2880
$width = 5120
$height = 2880
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 7680x4320
$width = 7680
$height = 4320
$gameWidth = 1920
$gameHeight = 1080

## THE FOLLOWING REQUIRE A GAME PATCH (patches.txt) FOR CUSTOM ASPECT RATIOS, DON'T ADD THESE IF THE GAME PATCH DOESN'T EXIST

# Common Ultrawide Resolutions

[Preset]
name = 2560x1080 (Ultrawide)
$width = 2560
$height = 1080
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 3440x1440 (Ultrawide)
$width = 3440
$height = 1440
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 5120x2160 (Ultrawide)
$width = 5120
$height = 2160
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 6880x2880 (Ultrawide)
$width = 6880
$height = 2880
$gameWidth = 1920
$gameHeight = 1080

[Preset]
name = 10240x4320 (Ultrawide)
$width = 10240
$height = 4320
$gameWidth = 1920
$gameHeight = 1080