docs: 更新文档

This commit is contained in:
刘旭 2024-04-03 10:38:36 +08:00
commit 98e324fab6
6 changed files with 29 additions and 49 deletions

View file

@ -1,4 +1,4 @@
Magpie provides several capture methods. They have their pros and cons in different scenarios.
Magpie provides several capture methods. They have their pros and cons in different scenarios. For general purposes, it's recommended to use Graphics Capture, as it provides the best compatibility and smoothness.
| | Graphics Capture | Desktop Duplication | GDI | DwmSharedSurface |
| :---: | :---: | :---: | :---: |:---: |
@ -6,11 +6,9 @@ Magpie provides several capture methods. They have their pros and cons in differ
| Supports recording/streaming | No under extreme conditions<sup>[1]</sup> | No | Yes | Yes |
| Support the source window to span multiple screens | No under extreme conditions<sup>[1]</sup> | No | Yes | Yes |
| Ignores DPI virtualization<sup>[2]</sup> | No | No | Yes| Yes |
| Notes | The most recommended capture method | Requires Win10 v2004, suitable for games with more static frames<sup>[3]</sup>, could capture pop-ups | | Low VRAM usage |
| Notes | The most recommended capture method | Requires Win10 v2004 | | Low VRAM usage |
[1]: (1) The source window does not support regular window capture. (2) The operating system is Windows 11.
[2]: The system will perform bicubic interpolation upscaling to windows that do not support DPI scaling. The capture methods supporting this options captures the images before such scaling.
[3]: The Desktop Duplication mode effectively reduces the power consumption if there are many static frames.

View file

@ -2,23 +2,12 @@ MagpieFX is based on DirectX 11 compute shader
``` hlsl
//!MAGPIE EFFECT
//!VERSION 3
//!OUTPUT_WIDTH INPUT_WIDTH * 2
//!OUTPUT_HEIGHT INPUT_HEIGHT * 2
// Specify "USE_DYNAMIC" to use GetFrameCount or GetCursorPos.
//!VERSION 4
// Specify "USE_DYNAMIC" to use GetFrameCount.
//!USE_DYNAMIC
// Specifying "GENERIC_DOWNSCALER" indicates that this effect can be used as the "default downscaling effect".
//!GENERIC_DOWNSCALER
// Use "SORT_NAME" to specify the name used for sorting, otherwise the files will be sorted by their file names.
//!SORT_NAME test1
// Not specifying "OUTPUT_WIDTH" and "OUTPUT_HEIGHT" indicates that this effect supports outputting to any size.
// You can use some pre-defined constants when calculating texture size.
// INPUT_WIDTH
// INPUT_HEIGHT
// OUTPUT_WIDTH
// OUTPUT_HEIGHT
// Definition of parameters
//!PARAMETER
@ -33,13 +22,25 @@ float sharpness;
// Definition of textures
// "INPUT" is a special keyword.
// "INPUT" cannot be used as the output of a pass.
// Defining INPUT is optional, but it is recommended to define it explicitly for the sake of semantic completeness.
// "INPUT" and "OUTPUT" are special keywords.
// "INPUT" cannot be used as the output of a pass; "OUTPUT" cannot be used as the input of a pass.
// Defining INPUT/OUTPUT is optional, but it is recommended to define them explicitly for the sake of semantic completeness.
// The size of the OUTPUT represents the output size of this effect. Not specifying it indicates support for output of any size.
//!TEXTURE
Texture2D INPUT;
//!TEXTURE
//!WIDTH INPUT_WIDTH * 2
//!HEIGHT INPUT_HEIGHT * 2
Texture2D OUTPUT;
// You can use some pre-defined constants to calculate texture size.
// INPUT_WIDTH
// INPUT_HEIGHT
// OUTPUT_WIDTH
// OUTPUT_HEIGHT
// Supported texture formats:
// R32G32B32A32_FLOAT
// R16G16B16A16_FLOAT
@ -110,11 +111,10 @@ float4 Pass1(float2 pos) {
return float4(1, 1, 1, 1);
}
// The last pass does not support "OUT".
// If you are using the CS style, you must use "WriteToOutput" to output the result.
//!PASS 2
//!IN INPUT, tex1
// The output of the last pass must be "OUTPUT".
//!OUT OUTPUT
// "BLOACK_SIZE" specifies how large an area is processed in one dispatch.
// "BLOACK_SIZE" can have only one dimension, meaning that length and height are specified at the same time.
//!BLOCK_SIZE 16, 16
@ -123,18 +123,13 @@ float4 Pass1(float2 pos) {
//!NUM_THREADS 64, 1, 1
void Pass2(uint2 blockStart, uint3 threadId) {
// Render the cursor and then output.
// Available only in the last pass.
WriteToOutput(blockStart, float3(1,1,1));
// Write to OUPUT
OUTPUT[blockStart] = float4(1,1,1,1);
}
```
### Predefined functions
**void WriteToOutput(uint2 pos, float3 color)**: Only available in the last pass and is used to write results to the output texture.
**bool CheckViewport(uint2 pos)**: Only available in the last pass and is used to check whether the output coordinates are inside the viewport.
**uint2 GetInputSize()**: Retrieves the size of the input texture.
**float2 GetInputPt()**: Retrieves the size of pixel in the input texture.
@ -147,8 +142,6 @@ void Pass2(uint2 blockStart, uint3 threadId) {
**uint GetFrameCount()**: Retrieves the total number of frames rendered so far. When using this function, you must specify USE_DYNAMIC.
**uint2 GetCursorPos()**: Retrieves the current cursor position. When using this function, you must specify USE_DYNAMIC.
**uint2 Rmp8x8(uint id)**: Maps the values of 0 to 63 to coordinates in an 8x8 square in swizzle order, which can improve texture cache hit rate.
@ -164,10 +157,6 @@ void Pass2(uint2 blockStart, uint3 threadId) {
**MP_DEBUG**: Whether the shader is being compiled in debug mode (when compiling shaders in debug mode, they are not optimized and contain debug information).
**MP_LAST_PASS**: Whether the current pass is the last pass of the effect.
**MP_LAST_EFFECT**: Whether the effect is the last effect for the current scaling mode (the last effect needs to handle viewport and cursor rendering).
**MP_FP16**: Whether to use half-precision floating-point numbers (specifed by user).
**MF、MF1、MF2、...、MF4x4**: Floating-point data types that conform to MP_FP16. When half-precision is not specified, they are aliases for float..., otherwise they are aliases for min16float...

View file

@ -23,7 +23,7 @@ float sharpness;
// 纹理定义
// INPUT、OUTPUT 是特殊关键字
// INPUT 不能作为通道的输出,但 OUTPUT 可以作为通道的输入
// INPUT 不能作为通道的输出,OUTPUT 不能作为通道的输入
// 定义 INPUT 和 OUTPUT 是可选的,但为了保持语义的完整性,建议显式定义
// OUTPUT 的尺寸即为此效果的输出尺寸,不指定则表示支持任意尺寸的输出

View file

@ -8,8 +8,6 @@ If you cannot run some effects with high computing power requirements (e.g. Anim
1. Change to the variants with lower requirements. For example, Anime4K_Upscale_S is much faster than Anime4K_Upscale_L. CAS is much faster than AdaptiveSharpen. They can effectively improve the smoothness of the effects at the cost of some quality degradation.
2. Change the capture mode. We recommend you to try each of them.
3. Set the frame rate to "unlimited." This will turn off Vsync. It usually increases the frame rate substantially, but may causes the screen to tear.
4. Turn on "allow additional latency to improve performance" when Vsync is on. This will not lead to screen tearing and it also raises the frame rate. However, it will cause an extra 1-frame latency.
## Intermittent lagging
@ -25,6 +23,5 @@ If your graphics card is powerful enough, but you are still experiencing lagging
When you need to save electricity or reduce the heat generated, try the following:
1. Change the capture more. The Desktop Duplication capture mode effectively reduces the power consumption if there are a lot of static frames in the game.
2. Change the effects to their variants with lower requirements.
3. Limit the frame rate, which may cause screen tearing.
1. Limit the frame rate.
2. Opt for effects that require lower performance.

View file

@ -8,8 +8,6 @@
1. 更换为性能需求更低的效果。如 Anime4K_Upscale_S 比 Anime4K_Upscale_L 快的多CAS 比 AdaptiveSharpen 快的多,它们可以有效提高流畅度,代价是一定程度的画面质量损失。
2. 尝试更换捕获模式。建议你每种模式都尝试一下。
3. 关闭垂直同步。这通常可以大幅提高帧率,但可能造成画面撕裂。
4. 开启“垂直同步”并“允许额外的延迟以提高性能”。这个配置不会造成画面撕裂,同时也可以有效提高帧率。缺点是会引入一帧的延迟。
## 间歇性卡顿
@ -25,5 +23,5 @@
在需要节省电量或降低发热时,请尝试下面的操作:
1. 更换捕获模式。如果游戏的静止画面较多Desktop Duplication 捕获模式可以有效降低功耗
1. 限制帧率
2. 更换为性能需求更低的效果。

View file

@ -1,4 +1,4 @@
Magpie 提供数种捕获方式,根据使用场景,它们各有优劣。
Magpie 提供数种捕获方式,根据使用场景,它们各有优劣。无特殊需求应使用 Graphics Capture它提供最好的兼容性和流畅度。
| | Graphics Capture | Desktop Duplication | GDI | DwmSharedSurface |
| :---: | :---: | :---: | :---: |:---: |
@ -6,11 +6,9 @@ Magpie 提供数种捕获方式,根据使用场景,它们各有优劣。
| 支持录制/串流 | 特殊情况下不支持<sup>[1]</sup> | 否 | 是 | 是 |
| 支持源窗口跨越多个屏幕 | 特殊情况下不支持<sup>[1]</sup> | 否 | 是 | 是 |
| 无视 DPI 虚拟化<sup>[2]</sup> | 否 | 否 | 是| 是 |
| 备注 | 首选捕获方式 | 要求 Win10 v2004;适合静止帧较多的游戏<sup>[3]</sup>;可以捕获到弹窗 | | 占用的显存较少 |
| 备注 | 首选捕获方式 | 要求 Win10 v2004 | | 占用的显存较少 |
[1]: (1) 源窗口不支持常规的窗口捕获 (2) 操作系统为 Windows 11
[2]: 系统会对不支持 DPI 缩放的窗口进行双三次插值放大,支持此项的捕获方式可以捕获到放大前的图像
[3]: 如果窗口的静止帧较多,使用 Desktop Duplication 可以有效降低功耗