Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XBRZ之类的滤镜可以增加吗? #62

Closed
xuanyuanwu999 opened this issue Aug 14, 2021 · 11 comments
Closed

XBRZ之类的滤镜可以增加吗? #62

xuanyuanwu999 opened this issue Aug 14, 2021 · 11 comments
Labels
enhancement New feature or request

Comments

@xuanyuanwu999
Copy link

对2D老游戏的支持应该好过anime4k

@Blinue
Copy link
Owner

Blinue commented Aug 14, 2021

能放对比图吗,对于2D游戏FSRCNNX和ACNet都有很好的效果,如果XBRZ更好我会移植它。

@Blinue Blinue added the enhancement New feature or request label Aug 14, 2021
@xuanyuanwu999
Copy link
Author

xuanyuanwu999 commented Aug 14, 2021

能放对比图吗,对于2D游戏FSRCNNX和ACNet最好的效果,如果XBRZ更好的我会移植它。
主要是针对像素游戏的……
acnet
ACNET
fsr
FSR
xbrz6x
XBRZ

@Blinue
Copy link
Owner

Blinue commented Aug 14, 2021

Magpie确实缺少像素画的缩放算法,我会在v0.7里移植它。
暂时可以试试像素缩放,但只能放大整数倍。

@palxex
Copy link

palxex commented Aug 15, 2021

xbrz对老2D游戏的效果确实不错(除了对汉字字体)。提个建议,不知道有没有可能出一个shader规范(比如说通过一个单独的UserFilter Module),让用户像写userscript一样写新的filter?规范可以考虑参照RetroArch的Slang或者根据需要自己定制一个,另外它那里就有xbrz的实现

@Blinue
Copy link
Owner

Blinue commented Aug 15, 2021

这个功能太复杂了,而且只有极少数的用户能使用。对于需要自定义缩放效果的用户我会推荐向Magpie贡献代码或者实现自己的模块,因为Magpie所有的效果都是组织在模块里并在运行时动态加载的。

@palxex
Copy link

palxex commented Aug 15, 2021

原来如此,谢谢提点

@LightMu
Copy link

LightMu commented Aug 29, 2021

@Blinue
Copy link
Owner

Blinue commented Sep 1, 2021

我正在计划支持自定义着色器,使用自己的规范。下面是一个草稿

//!MAGPIE EFFECT
//!VERSION 1

//!CONSTANT
int2 INPUT_SIZE;

//!CONSTANT
int2 OUTPUT_SIZE;

//!CONSTANT
float2 INPUT_PT;

//!CONSTANT
float2 SCALE;

//!CONSTANT
//!DEFAULT 0
float sharpness;

//!TEXTURE
Texture2D INPUT;

//!TEXTURE
Texture2D OUTPUT;

//!TEXTURE
//!WIDTH INPUT.WIDTH
//!HEIGHT INPUT.HEIGHT
//!FORMAT B8G8R8A8
Texture2D tex1;

//!SAMPLER
//!FILTER LINEAR
SamplerState sam1;

//!SAMPLER
//!FILTER POINT
SamplerState sam2;

//!COMMON

#define PI 3.14159265359

//!PASS
//!BIND INPUT, sam1, sharpness
//!SAVE tex1

float func1() {

}

float4 Pass1(float2 pos) {

}

//!PASS
//!BIND tex1, sam2
//!SAVE OUTPUT

float4 Pass2(float2 pos) {

}

@Blinue
Copy link
Owner

Blinue commented Sep 1, 2021

基本使用mpv glsl hook的语法。几个要点:

  1. 是合法的hlsl
  2. 只需定义抽象的像素着色器(Pass)
  3. 定义了需要的所有资源(纹理,采样器,参数)
  4. 对资源的完全控制,这给予了着色器很大的优化空间

@Blinue
Copy link
Owner

Blinue commented Oct 29, 2021

已移植多种 xBRZ 效果,但它们不会有内置的预设,需要自定义缩放

@JinhuaYe
Copy link

能放对比图吗,对于2D游戏FSRCNNX和ACNet都有很好的效果,如果XBRZ更好我会移植它。
测试过官方得xBRZ,执行效率不行,需要优化,如果原始分辨率不高可以满足实时处理需求,比如304*224分辨率的拳皇,再高的话处理太耗时了。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants