-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'upstream/develop' into develop
- Loading branch information
Showing
19 changed files
with
78 additions
and
832 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
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
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
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
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
54 changes: 54 additions & 0 deletions
54
Manual/contents/Settings/Texture_Information/Texture_Compression.htm
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,54 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<!DOCTYPE html> | ||
<html xmlns="http://www.w3.org/1999/xhtml"> | ||
<head> | ||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> | ||
<meta name="generator" content="Adobe RoboHelp 2022" /> | ||
<title>Texture Compression</title> | ||
<meta name="topic-status" content="Draft" /> | ||
<link rel="stylesheet" type="text/css" href="../../assets/css/default.css" /> | ||
<meta name="topic-comment" content="Overview page for texture compression" /> | ||
<meta name="template" content="../../assets/masterpages/Manual_Page.htt" /> | ||
<meta name="search-keywords" content="texture,compression,BCN,BC3,BC7,ASTC,GPU" /> | ||
<meta name="rh-index-keywords" content="Texture Compression" /> | ||
</head> | ||
<body> | ||
<h1><span data-field="title" data-format="default">Texture Compression</span></h1> | ||
<p>Texture compression is image compression applied to textures specifically.</p> | ||
<p>A game's textures can take up a large part of memory, in RAM as well as in VRAM.<span> For example, a texture image of 2048 x 2048 pixels that contains all four channels (R, G, B and A) takes up (2048 x 2048) pixels x 4 channels/pixel x 1 bytes/channel = 16777216 bytes, or 16MB of video memory. </span>All this data needs to be loaded into RAM and then sent to VRAM.</p> | ||
<p><span></span>Textures can be compressed to reduce their size, which minimises the amount of data that needs to be moved from RAM memory to VRAM when textures are prefetched (as the available "bandwidth" is limited). Additionally, if your game does many texture lookups and t<span>he platform it's running on does not have sufficient graphics memory bandwidth to handle the texture reading at a high frame rate, the game may slow down.</span></p> | ||
<p><span data-keyref="GameMaker Name">GameMaker</span> has two ways to allow for texture compression and decompression. Texture compression is set per <a href="../Texture_Groups.htm">texture group</a> and works differently according to the format used: </p> | ||
<ul class="colour"> | ||
<li><strong>BZ + </strong><strong>QOI</strong>, <strong>QOI</strong>, <strong>PNG</strong> - The asset compiler compresses all textures in the texture group to the given format and stores them with the game. When they are loaded from disk into RAM, they remain compressed while in RAM. When a texture from this texture group format is then fetched into VRAM, it is decompressed on the CPU and this decompressed data stored in VRAM.</li> | ||
<li><strong>Custom</strong> - GPU texture compression. The textures are generated at compile time using an external tool that compresses the textures to a format optimised for decompressing on the GPU and are then stored with the game. When a texture of this format is loaded into RAM, it remains compressed there. When it's fetched into VRAM, the texture data still remains compressed. The texture is decompressed by the GPU in real time when it performs texel lookups on the texture.</li> | ||
</ul> | ||
<p>The following image shows a comparison of different texture formats: </p> | ||
<figure><img alt="" class="center" height="314" src="../../assets/Images/Scripting_Reference/GML/Reference/Drawing/texture_compression_comparison_default_bcn7_bcn3.png" width="462" /> | ||
<figcaption>A comparison of different texture group formats.<br /> | ||
From left to right: BZ2 + QOI (no GPU texture compression), BC7 and BC3.</figcaption> | ||
</figure> | ||
<h3 id="gpu_compressed_textures">GPU Compressed Textures</h3> | ||
<p>The textures are stored in a compressed format in VRAM and are decompressed in real time by the GPU.</p> | ||
<p>Custom GPU texture compression is done using an extension: <a href="https://github.com/YoYoGames/GM-GPUTextureCompression">GM-GPUTextureCompression</a>. To generate GPU textures, you should first add this extension to your project.</p> | ||
<p>After adding the extension, to enable GPU compressed textures for a texture group: </p> | ||
<ul class="colour"> | ||
<li>Set the <a href="../Texture_Groups.htm#texture_group_format">Texture Group Format</a> to <strong>Custom</strong>.</li> | ||
<li>Enter the tool to use, along with the settings under <a href="../Texture_Groups.htm#custom_options">Custom Options</a>. For example, to generate medium quality BC7 compressed textures, set this to <span class="inline2">BCN -u2</span>.</li> | ||
</ul> | ||
<p>When the game is compiled, the textures are generated by the external tool, which is executed through the extension. The tool compresses the textures to a format optimised for decompressing on the GPU.</p> | ||
<p>For full information on the available texture formats that are supported, see the <a href="https://github.com/YoYoGames/GM-GPUTextureCompression/wiki/config">wiki</a>.</p> | ||
<p class="note"><span data-conref="../../assets/snippets/Tag_warning.hts"> </span> Certain texture formats are only supported on certain platforms. You should make sure to select an appropriate one for the platform that you're compiling to. An error message is shown in <a data-xref="{title}" href="../../Introduction/The_Output_Window.htm">The Output Window</a> if the extension isn't present or any of the settings is incorrect.</p> | ||
<p>GPU compressed textures are compressed using <em>block compression</em>. This is the most common form of GPU compression and is supported in some format on almost all modern platforms. When the GPU texture is generated from the original image using e.g. BCN compression, it is subdivided into fixed-size blocks of 4x4 pixels or texels (other compression algorithms support different block sizes). The information in the pixels in this block is converted to a 128 bit value. When the GPU reads back this value, it restores the colour value of the requested pixel from it as precisely as possible. See <a href="https://en.wikipedia.org/wiki/S3_Texture_Compression">S3_Texture_Compression</a> for more information.</p> | ||
<p> </p> | ||
<p> </p> | ||
<div class="footer"> | ||
<div class="buttons"> | ||
<div class="clear"> | ||
<div>Back: <a data-xref="{title}" href="../Texture_Groups.htm">Texture Groups</a></div> | ||
<div>Next: <a data-xref="{title}" href="Dynamic_Textures.htm">Dynamic Textures</a></div> | ||
</div> | ||
</div> | ||
<h5><span data-conref="../../assets/snippets/Copyright_Notice_AutoUpdate.hts"> </span></h5> | ||
</div> | ||
</body> | ||
</html> |
Binary file added
BIN
+70.6 KB
...ence/GML/Reference/Drawing/texture_compression_comparison_default_bcn7_bcn3.png
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.
Binary file added
BIN
+18.9 KB
Manual/contents/assets/Images/Settings/Texture_Groups_Settings_Custom_Format.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Oops, something went wrong.