Compare commits

...

3 Commits

Author SHA1 Message Date
c69340f7b9 Merge branch 'master' of http://git.axibug.com/alienjack/AxibugEmuOnline
# Conflicts:
#	AxibugEmuOnline.Client/Assets/Script/AppMain/AxiPlayerPrefs/AxiPlayerPrefsForFileSystem.cs.meta
2025-06-25 17:31:35 +08:00
f4af119cdb CRT_easymode format 2025-06-25 17:30:58 +08:00
45d075722b 帮皓月搽屁股 2025-06-25 17:30:31 +08:00
2 changed files with 55 additions and 56 deletions

View File

@ -3,23 +3,23 @@ Shader "Filter/crt-easymode"
{ {
Properties Properties
{ {
BRIGHT_BOOST("BRIGHT_BOOST",Float) = 1.2 BRIGHT_BOOST("BRIGHT_BOOST", Float) = 1.2
DILATION("DILATION",Float) = 1.0 DILATION("DILATION", Float) = 1.0
GAMMA_INPUT("GAMMA_INPUT",Float) = 2.0 GAMMA_INPUT("GAMMA_INPUT", Float) = 2.0
GAMMA_OUTPUT("GAMMA_OUTPUT",Float) = 1.8 GAMMA_OUTPUT("GAMMA_OUTPUT", Float) = 1.8
MASK_SIZE("MASK_SIZE",Float) = 1.0 MASK_SIZE("MASK_SIZE", Float) = 1.0
MASK_STAGGER("MASK_STAGGER",Float) = 0.0 MASK_STAGGER("MASK_STAGGER", Float) = 0.0
MASK_STRENGTH("MASK_STRENGTH",Float) = 0.3 MASK_STRENGTH("MASK_STRENGTH", Float) = 0.3
MASK_DOT_HEIGHT("MASK_DOT_HEIGHT",Float) = 1.0 MASK_DOT_HEIGHT("MASK_DOT_HEIGHT", Float) = 1.0
MASK_DOT_WIDTH("MASK_DOT_WIDTH",Float) = 1.0 MASK_DOT_WIDTH("MASK_DOT_WIDTH", Float) = 1.0
SCANLINE_CUTOFF("SCANLINE_CUTOFF",Float) = 400.0 SCANLINE_CUTOFF("SCANLINE_CUTOFF", Float) = 400.0
SCANLINE_BEAM_WIDTH_MAX("SCANLINE_BEAM_WIDTH_MAX",Float) = 1.5 SCANLINE_BEAM_WIDTH_MAX("SCANLINE_BEAM_WIDTH_MAX", Float) = 1.5
SCANLINE_BEAM_WIDTH_MIN("SCANLINE_BEAM_WIDTH_MIN",Float) = 1.5 SCANLINE_BEAM_WIDTH_MIN("SCANLINE_BEAM_WIDTH_MIN", Float) = 1.5
SCANLINE_BRIGHT_MAX("SCANLINE_BRIGHT_MAX",Float) = 0.65 SCANLINE_BRIGHT_MAX("SCANLINE_BRIGHT_MAX", Float) = 0.65
SCANLINE_BRIGHT_MIN("SCANLINE_BRIGHT_MIN",Float) = 0.35 SCANLINE_BRIGHT_MIN("SCANLINE_BRIGHT_MIN", Float) = 0.35
SCANLINE_STRENGTH("SCANLINE_STRENGTH",Float) = 1.0 SCANLINE_STRENGTH("SCANLINE_STRENGTH", Float) = 1.0
SHARPNESS_H("SHARPNESS_H",Float) = 0.5 SHARPNESS_H("SHARPNESS_H", Float) = 0.5
SHARPNESS_V("SHARPNESS_V",Float) = 1.0 SHARPNESS_V("SHARPNESS_V", Float) = 1.0
} }
SubShader SubShader
{ {
@ -60,8 +60,7 @@ Shader "Filter/crt-easymode"
vec4 dilate(vec4 col) vec4 dilate(vec4 col)
{ {
vec4 x = mix(vec4(1.0,1.0,1.0,1.0), col, DILATION); vec4 x = mix(vec4(1.0, 1.0, 1.0, 1.0), col, DILATION);
return col * x; return col * x;
} }
@ -69,8 +68,8 @@ Shader "Filter/crt-easymode"
{ {
/* /*
apply half-circle s-curve to distance for sharper (more pixelated) interpolation apply half - circle s - curve to distance for sharper (more pixelated) interpolation
single line formula for Graph Toy: single line formula for Graph Toy :
0.5 - sqrt(0.25 - (x - step(0.5, x)) * (x - step(0.5, x))) * sign(0.5 - x) 0.5 - sqrt(0.25 - (x - step(0.5, x)) * (x - step(0.5, x))) * sign(0.5 - x)
*/ */
@ -82,12 +81,13 @@ Shader "Filter/crt-easymode"
mat4x4 get_color_matrix(vec2 co, vec2 dx) mat4x4 get_color_matrix(vec2 co, vec2 dx)
{ {
return mat4x4(TEX2D(co - dx), TEX2D(co), TEX2D(co + dx), TEX2D(co + 2.0 * dx)); return mat4x4(TEX2D(co - dx), TEX2D(co), TEX2D(co + dx), TEX2D(co + 2.0 * dx));
} }
vec3 filter_lanczos(vec4 coeffs, mat4x4 color_matrix) vec3 filter_lanczos(vec4 coeffs, mat4x4 color_matrix)
{ {
vec4 col = mul(color_matrix,coeffs); vec4 col = mul(color_matrix, coeffs);
vec4 sample_min = min(color_matrix[1], color_matrix[2]); vec4 sample_min = min(color_matrix[1], color_matrix[2]);
vec4 sample_max = max(color_matrix[1], color_matrix[2]); vec4 sample_max = max(color_matrix[1], color_matrix[2]);
@ -125,7 +125,7 @@ Shader "Filter/crt-easymode"
#endif #endif
col = mix(col, col2, curve_distance(dist.y, SHARPNESS_V)); col = mix(col, col2, curve_distance(dist.y, SHARPNESS_V));
col = pow(col, vec3(GAMMA_INPUT / (DILATION + 1.0),GAMMA_INPUT / (DILATION + 1.0),GAMMA_INPUT / (DILATION + 1.0))); col = pow(col, vec3(GAMMA_INPUT / (DILATION + 1.0), GAMMA_INPUT / (DILATION + 1.0), GAMMA_INPUT / (DILATION + 1.0)));
float luma = dot(vec3(0.2126, 0.7152, 0.0722), col); float luma = dot(vec3(0.2126, 0.7152, 0.0722), col);
float bright = (max(col.r, max(col.g, col.b)) + luma) * 0.5; float bright = (max(col.r, max(col.g, col.b)) + luma) * 0.5;
@ -146,12 +146,12 @@ Shader "Filter/crt-easymode"
scan_weight = 1.0; scan_weight = 1.0;
col2 = col.rgb; col2 = col.rgb;
col *= vec3(scan_weight,scan_weight,scan_weight); col *= vec3(scan_weight, scan_weight, scan_weight);
col = mix(col, col2, scan_bright); col = mix(col, col2, scan_bright);
col *= mask_weight; col *= mask_weight;
col = pow(col, vec3(1.0 / GAMMA_OUTPUT,1.0 / GAMMA_OUTPUT,1.0 / GAMMA_OUTPUT)); col = pow(col, vec3(1.0 / GAMMA_OUTPUT, 1.0 / GAMMA_OUTPUT, 1.0 / GAMMA_OUTPUT));
col = col* BRIGHT_BOOST; col = col * BRIGHT_BOOST;
vec4 FragColor = vec4(col, 1.0); vec4 FragColor = vec4(col, 1.0);
@ -161,6 +161,3 @@ Shader "Filter/crt-easymode"
} }
} }
} }

View File

@ -9,8 +9,9 @@
"com.unity.ext.nunit": { "com.unity.ext.nunit": {
"version": "2.0.5", "version": "2.0.5",
"depth": 1, "depth": 1,
"source": "builtin", "source": "registry",
"dependencies": {} "dependencies": {},
"url": "https://packages.unity.cn"
}, },
"com.unity.ide.visualstudio": { "com.unity.ide.visualstudio": {
"version": "2.0.22", "version": "2.0.22",
@ -19,7 +20,7 @@
"dependencies": { "dependencies": {
"com.unity.test-framework": "1.1.9" "com.unity.test-framework": "1.1.9"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.cn"
}, },
"com.unity.inputsystem": { "com.unity.inputsystem": {
"version": "1.11.2", "version": "1.11.2",
@ -28,14 +29,14 @@
"dependencies": { "dependencies": {
"com.unity.modules.uielements": "1.0.0" "com.unity.modules.uielements": "1.0.0"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.cn"
}, },
"com.unity.sysroot": { "com.unity.sysroot": {
"version": "2.0.10", "version": "2.0.10",
"depth": 1, "depth": 1,
"source": "registry", "source": "registry",
"dependencies": {}, "dependencies": {},
"url": "https://packages.unity.com" "url": "https://packages.unity.cn"
}, },
"com.unity.sysroot.linux-x86_64": { "com.unity.sysroot.linux-x86_64": {
"version": "2.0.9", "version": "2.0.9",
@ -44,17 +45,18 @@
"dependencies": { "dependencies": {
"com.unity.sysroot": "2.0.10" "com.unity.sysroot": "2.0.10"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.cn"
}, },
"com.unity.test-framework": { "com.unity.test-framework": {
"version": "1.5.1", "version": "1.4.5",
"depth": 0, "depth": 0,
"source": "builtin", "source": "registry",
"dependencies": { "dependencies": {
"com.unity.ext.nunit": "2.0.3", "com.unity.ext.nunit": "2.0.3",
"com.unity.modules.imgui": "1.0.0", "com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0" "com.unity.modules.jsonserialize": "1.0.0"
} },
"url": "https://packages.unity.cn"
}, },
"com.unity.toolchain.win-x86_64-linux-x86_64": { "com.unity.toolchain.win-x86_64-linux-x86_64": {
"version": "2.0.10", "version": "2.0.10",
@ -64,7 +66,7 @@
"com.unity.sysroot": "2.0.10", "com.unity.sysroot": "2.0.10",
"com.unity.sysroot.linux-x86_64": "2.0.9" "com.unity.sysroot.linux-x86_64": "2.0.9"
}, },
"url": "https://packages.unity.com" "url": "https://packages.unity.cn"
}, },
"com.unity.ugui": { "com.unity.ugui": {
"version": "2.0.0", "version": "2.0.0",