noobs 0.0.89 → 0.0.130
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/data/obs-plugins/obs-filters/LUTs/black_and_white.png +0 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/grayscale.cube +32769 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/grayscale.png +0 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/invert.png +0 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/original.cube +33 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/original.png +0 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/posterize.png +0 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/red_isolated.png +0 -0
- package/dist/data/obs-plugins/obs-filters/LUTs/teal_lows_orange_highs.png +0 -0
- package/dist/data/obs-plugins/obs-filters/blend_add_filter.effect +54 -0
- package/dist/data/obs-plugins/obs-filters/blend_mul_filter.effect +54 -0
- package/dist/data/obs-plugins/obs-filters/blend_sub_filter.effect +54 -0
- package/dist/data/obs-plugins/obs-filters/chroma_key_filter.effect +99 -0
- package/dist/data/obs-plugins/obs-filters/chroma_key_filter_v2.effect +111 -0
- package/dist/data/obs-plugins/obs-filters/color.effect +95 -0
- package/dist/data/obs-plugins/obs-filters/color_correction_filter.effect +74 -0
- package/dist/data/obs-plugins/obs-filters/color_grade_filter.effect +177 -0
- package/dist/data/obs-plugins/obs-filters/color_key_filter.effect +65 -0
- package/dist/data/obs-plugins/obs-filters/color_key_filter_v2.effect +77 -0
- package/dist/data/obs-plugins/obs-filters/crop_filter.effect +95 -0
- package/dist/data/obs-plugins/obs-filters/hdr_tonemap_filter.effect +97 -0
- package/dist/data/obs-plugins/obs-filters/locale/af-ZA.ini +89 -0
- package/dist/data/obs-plugins/obs-filters/locale/ar-SA.ini +133 -0
- package/dist/data/obs-plugins/obs-filters/locale/az-AZ.ini +1 -0
- package/dist/data/obs-plugins/obs-filters/locale/ba-RU.ini +19 -0
- package/dist/data/obs-plugins/obs-filters/locale/be-BY.ini +134 -0
- package/dist/data/obs-plugins/obs-filters/locale/bg-BG.ini +71 -0
- package/dist/data/obs-plugins/obs-filters/locale/bn-BD.ini +106 -0
- package/dist/data/obs-plugins/obs-filters/locale/ca-ES.ini +128 -0
- package/dist/data/obs-plugins/obs-filters/locale/cs-CZ.ini +130 -0
- package/dist/data/obs-plugins/obs-filters/locale/da-DK.ini +119 -0
- package/dist/data/obs-plugins/obs-filters/locale/de-DE.ini +113 -0
- package/dist/data/obs-plugins/obs-filters/locale/el-GR.ini +128 -0
- package/dist/data/obs-plugins/obs-filters/locale/en-GB.ini +12 -0
- package/dist/data/obs-plugins/obs-filters/locale/en-US.ini +138 -0
- package/dist/data/obs-plugins/obs-filters/locale/eo-UY.ini +1 -0
- package/dist/data/obs-plugins/obs-filters/locale/es-ES.ini +129 -0
- package/dist/data/obs-plugins/obs-filters/locale/et-EE.ini +132 -0
- package/dist/data/obs-plugins/obs-filters/locale/eu-ES.ini +127 -0
- package/dist/data/obs-plugins/obs-filters/locale/fa-IR.ini +137 -0
- package/dist/data/obs-plugins/obs-filters/locale/fi-FI.ini +127 -0
- package/dist/data/obs-plugins/obs-filters/locale/fil-PH.ini +111 -0
- package/dist/data/obs-plugins/obs-filters/locale/fr-FR.ini +124 -0
- package/dist/data/obs-plugins/obs-filters/locale/gd-GB.ini +94 -0
- package/dist/data/obs-plugins/obs-filters/locale/gl-ES.ini +132 -0
- package/dist/data/obs-plugins/obs-filters/locale/he-IL.ini +135 -0
- package/dist/data/obs-plugins/obs-filters/locale/hi-IN.ini +134 -0
- package/dist/data/obs-plugins/obs-filters/locale/hr-HR.ini +80 -0
- package/dist/data/obs-plugins/obs-filters/locale/hu-HU.ini +131 -0
- package/dist/data/obs-plugins/obs-filters/locale/hy-AM.ini +130 -0
- package/dist/data/obs-plugins/obs-filters/locale/id-ID.ini +112 -0
- package/dist/data/obs-plugins/obs-filters/locale/it-IT.ini +130 -0
- package/dist/data/obs-plugins/obs-filters/locale/ja-JP.ini +134 -0
- package/dist/data/obs-plugins/obs-filters/locale/ka-GE.ini +133 -0
- package/dist/data/obs-plugins/obs-filters/locale/kaa.ini +41 -0
- package/dist/data/obs-plugins/obs-filters/locale/kab-KAB.ini +56 -0
- package/dist/data/obs-plugins/obs-filters/locale/kmr-TR.ini +126 -0
- package/dist/data/obs-plugins/obs-filters/locale/ko-KR.ini +134 -0
- package/dist/data/obs-plugins/obs-filters/locale/ms-MY.ini +131 -0
- package/dist/data/obs-plugins/obs-filters/locale/nb-NO.ini +115 -0
- package/dist/data/obs-plugins/obs-filters/locale/nl-NL.ini +111 -0
- package/dist/data/obs-plugins/obs-filters/locale/nn-NO.ini +19 -0
- package/dist/data/obs-plugins/obs-filters/locale/pl-PL.ini +127 -0
- package/dist/data/obs-plugins/obs-filters/locale/pt-BR.ini +128 -0
- package/dist/data/obs-plugins/obs-filters/locale/pt-PT.ini +130 -0
- package/dist/data/obs-plugins/obs-filters/locale/ro-RO.ini +125 -0
- package/dist/data/obs-plugins/obs-filters/locale/ru-RU.ini +135 -0
- package/dist/data/obs-plugins/obs-filters/locale/si-LK.ini +44 -0
- package/dist/data/obs-plugins/obs-filters/locale/sk-SK.ini +131 -0
- package/dist/data/obs-plugins/obs-filters/locale/sl-SI.ini +133 -0
- package/dist/data/obs-plugins/obs-filters/locale/sr-CS.ini +90 -0
- package/dist/data/obs-plugins/obs-filters/locale/sr-SP.ini +97 -0
- package/dist/data/obs-plugins/obs-filters/locale/sv-SE.ini +129 -0
- package/dist/data/obs-plugins/obs-filters/locale/szl-PL.ini +94 -0
- package/dist/data/obs-plugins/obs-filters/locale/ta-IN.ini +28 -0
- package/dist/data/obs-plugins/obs-filters/locale/th-TH.ini +132 -0
- package/dist/data/obs-plugins/obs-filters/locale/tl-PH.ini +64 -0
- package/dist/data/obs-plugins/obs-filters/locale/tr-TR.ini +129 -0
- package/dist/data/obs-plugins/obs-filters/locale/tt-RU.ini +27 -0
- package/dist/data/obs-plugins/obs-filters/locale/ug-CN.ini +133 -0
- package/dist/data/obs-plugins/obs-filters/locale/uk-UA.ini +135 -0
- package/dist/data/obs-plugins/obs-filters/locale/vi-VN.ini +131 -0
- package/dist/data/obs-plugins/obs-filters/locale/zh-CN.ini +138 -0
- package/dist/data/obs-plugins/obs-filters/locale/zh-TW.ini +136 -0
- package/dist/data/obs-plugins/obs-filters/luma_key_filter.effect +52 -0
- package/dist/data/obs-plugins/obs-filters/luma_key_filter_v2.effect +54 -0
- package/dist/data/obs-plugins/obs-filters/mask_alpha_filter.effect +54 -0
- package/dist/data/obs-plugins/obs-filters/mask_color_filter.effect +55 -0
- package/dist/data/obs-plugins/obs-filters/rtx_greenscreen.effect +183 -0
- package/dist/data/obs-plugins/obs-filters/sharpness.effect +76 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ar-SA.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/be-BY.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/bg-BG.ini +2 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ca-ES.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/cs-CZ.ini +55 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/da-DK.ini +54 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/de-DE.ini +55 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/en-GB.ini +9 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/en-US.ini +75 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/es-ES.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/et-EE.ini +36 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/fa-IR.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/fi-FI.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/fr-FR.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/gl-ES.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/he-IL.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/hi-IN.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/hu-HU.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/id-ID.ini +55 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/is-IS.ini +2 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/it-IT.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ja-JP.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ka-GE.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/kaa.ini +13 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/kmr-TR.ini +20 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ko-KR.ini +58 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ms-MY.ini +58 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/nb-NO.ini +24 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/nl-NL.ini +54 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/nn-NO.ini +1 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/pl-PL.ini +55 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/pt-BR.ini +58 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/pt-PT.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ru-RU.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/sk-SK.ini +56 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/sv-SE.ini +58 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/th-TH.ini +59 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/tr-TR.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/tt-RU.ini +2 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/ug-CN.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/uk-UA.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/vi-VN.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/zh-CN.ini +60 -0
- package/dist/data/obs-plugins/obs-nvenc/locale/zh-TW.ini +60 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/af-ZA.ini +19 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ar-SA.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ba-RU.ini +2 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/be-BY.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/bg-BG.ini +7 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/bn-BD.ini +8 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ca-ES.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/cs-CZ.ini +19 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/da-DK.ini +19 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/de-DE.ini +19 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/el-GR.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/en-GB.ini +1 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/en-US.ini +21 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/es-ES.ini +19 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/et-EE.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/eu-ES.ini +11 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/fa-IR.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/fi-FI.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/fil-PH.ini +11 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/fr-FR.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/gd-GB.ini +8 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/gl-ES.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/he-IL.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/hi-IN.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/hr-HR.ini +14 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/hu-HU.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/hy-AM.ini +13 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/id-ID.ini +18 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/is-IS.ini +1 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/it-IT.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ja-JP.ini +16 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ka-GE.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/kaa.ini +10 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/kab-KAB.ini +5 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/kmr-TR.ini +12 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ko-KR.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ms-MY.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/nb-NO.ini +16 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/nl-NL.ini +18 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/nn-NO.ini +2 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/oc-FR.ini +1 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/pl-PL.ini +16 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/pt-BR.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/pt-PT.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ro-RO.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ru-RU.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/si-LK.ini +8 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/sk-SK.ini +19 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/sl-SI.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/sr-CS.ini +6 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/sr-SP.ini +10 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/sv-SE.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ta-IN.ini +2 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/th-TH.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/tl-PH.ini +5 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/tr-TR.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/tt-RU.ini +3 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/ug-CN.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/uk-UA.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/vi-VN.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/zh-CN.ini +20 -0
- package/dist/data/obs-plugins/obs-qsv11/locale/zh-TW.ini +20 -0
- package/dist/data/obs-plugins/win-capture/get-graphics-offsets32.exe +0 -0
- package/dist/data/obs-plugins/win-capture/get-graphics-offsets64.exe +0 -0
- package/dist/data/obs-plugins/win-capture/graphics-hook32.dll +0 -0
- package/dist/data/obs-plugins/win-capture/graphics-hook64.dll +0 -0
- package/dist/data/obs-plugins/win-capture/inject-helper32.exe +0 -0
- package/dist/data/obs-plugins/win-capture/inject-helper64.exe +0 -0
- package/dist/noobs.node +0 -0
- package/dist/obs-plugins/image-source.dll +0 -0
- package/dist/obs-plugins/obs-filters.dll +0 -0
- package/dist/obs-plugins/obs-nvenc.dll +0 -0
- package/dist/obs-plugins/obs-qsv11.dll +0 -0
- package/dist/obs-plugins/obs-x264.dll +0 -0
- package/dist/obs-plugins/win-capture.dll +0 -0
- package/dist/obs-plugins/win-wasapi.dll +0 -0
- package/index.d.ts +24 -18
- package/package.json +1 -1
- package/src/main.cpp +215 -33
- package/src/obs_interface.cpp +598 -288
- package/src/obs_interface.h +85 -38
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
LUT_1D_SIZE 32
|
|
2
|
+
0 0 0
|
|
3
|
+
0.0322581 0.0322581 0.0322581
|
|
4
|
+
0.0645161 0.0645161 0.0645161
|
|
5
|
+
0.0967742 0.0967742 0.0967742
|
|
6
|
+
0.129032 0.129032 0.129032
|
|
7
|
+
0.16129 0.16129 0.16129
|
|
8
|
+
0.193548 0.193548 0.193548
|
|
9
|
+
0.225806 0.225806 0.225806
|
|
10
|
+
0.258065 0.258065 0.258065
|
|
11
|
+
0.290323 0.290323 0.290323
|
|
12
|
+
0.322581 0.322581 0.322581
|
|
13
|
+
0.354839 0.354839 0.354839
|
|
14
|
+
0.387097 0.387097 0.387097
|
|
15
|
+
0.419355 0.419355 0.419355
|
|
16
|
+
0.451613 0.451613 0.451613
|
|
17
|
+
0.483871 0.483871 0.483871
|
|
18
|
+
0.516129 0.516129 0.516129
|
|
19
|
+
0.548387 0.548387 0.548387
|
|
20
|
+
0.580645 0.580645 0.580645
|
|
21
|
+
0.612903 0.612903 0.612903
|
|
22
|
+
0.645161 0.645161 0.645161
|
|
23
|
+
0.677419 0.677419 0.677419
|
|
24
|
+
0.709677 0.709677 0.709677
|
|
25
|
+
0.741935 0.741935 0.741935
|
|
26
|
+
0.774194 0.774194 0.774194
|
|
27
|
+
0.806452 0.806452 0.806452
|
|
28
|
+
0.83871 0.83871 0.83871
|
|
29
|
+
0.870968 0.870968 0.870968
|
|
30
|
+
0.903226 0.903226 0.903226
|
|
31
|
+
0.935484 0.935484 0.935484
|
|
32
|
+
0.967742 0.967742 0.967742
|
|
33
|
+
1 1 1
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
uniform float4x4 ViewProj;
|
|
2
|
+
uniform texture2d image;
|
|
3
|
+
|
|
4
|
+
uniform texture2d target;
|
|
5
|
+
uniform float4 color;
|
|
6
|
+
uniform float2 mul_val;
|
|
7
|
+
uniform float2 add_val;
|
|
8
|
+
|
|
9
|
+
sampler_state textureSampler {
|
|
10
|
+
Filter = Linear;
|
|
11
|
+
AddressU = Clamp;
|
|
12
|
+
AddressV = Clamp;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
struct VertDataIn {
|
|
16
|
+
float4 pos : POSITION;
|
|
17
|
+
float2 uv : TEXCOORD0;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
struct VertDataOut {
|
|
21
|
+
float4 pos : POSITION;
|
|
22
|
+
float2 uv : TEXCOORD0;
|
|
23
|
+
float2 uv2 : TEXCOORD1;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
VertDataOut VSDefault(VertDataIn v_in)
|
|
27
|
+
{
|
|
28
|
+
VertDataOut vert_out;
|
|
29
|
+
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj);
|
|
30
|
+
vert_out.uv = v_in.uv;
|
|
31
|
+
vert_out.uv2 = v_in.uv * mul_val + add_val;
|
|
32
|
+
return vert_out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
float4 PSAddImageRGBA(VertDataOut v_in) : TARGET
|
|
36
|
+
{
|
|
37
|
+
float4 rgba = image.Sample(textureSampler, v_in.uv);
|
|
38
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
39
|
+
rgba *= color;
|
|
40
|
+
|
|
41
|
+
float3 targetRGB = target.Sample(textureSampler, v_in.uv2).rgb;
|
|
42
|
+
rgba.rgb = saturate(rgba.rgb + targetRGB);
|
|
43
|
+
rgba.rgb *= rgba.a;
|
|
44
|
+
return rgba;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
technique Draw
|
|
48
|
+
{
|
|
49
|
+
pass
|
|
50
|
+
{
|
|
51
|
+
vertex_shader = VSDefault(v_in);
|
|
52
|
+
pixel_shader = PSAddImageRGBA(v_in);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
uniform float4x4 ViewProj;
|
|
2
|
+
uniform texture2d image;
|
|
3
|
+
|
|
4
|
+
uniform texture2d target;
|
|
5
|
+
uniform float4 color;
|
|
6
|
+
uniform float2 mul_val;
|
|
7
|
+
uniform float2 add_val;
|
|
8
|
+
|
|
9
|
+
sampler_state textureSampler {
|
|
10
|
+
Filter = Linear;
|
|
11
|
+
AddressU = Clamp;
|
|
12
|
+
AddressV = Clamp;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
struct VertDataIn {
|
|
16
|
+
float4 pos : POSITION;
|
|
17
|
+
float2 uv : TEXCOORD0;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
struct VertDataOut {
|
|
21
|
+
float4 pos : POSITION;
|
|
22
|
+
float2 uv : TEXCOORD0;
|
|
23
|
+
float2 uv2 : TEXCOORD1;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
VertDataOut VSDefault(VertDataIn v_in)
|
|
27
|
+
{
|
|
28
|
+
VertDataOut vert_out;
|
|
29
|
+
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj);
|
|
30
|
+
vert_out.uv = v_in.uv;
|
|
31
|
+
vert_out.uv2 = v_in.uv * mul_val + add_val;
|
|
32
|
+
return vert_out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
float4 PSMuliplyImageRGBA(VertDataOut v_in) : TARGET
|
|
36
|
+
{
|
|
37
|
+
float4 rgba = image.Sample(textureSampler, v_in.uv);
|
|
38
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
39
|
+
rgba *= color;
|
|
40
|
+
|
|
41
|
+
float3 targetRGB = target.Sample(textureSampler, v_in.uv2).rgb;
|
|
42
|
+
rgba.rgb = saturate(rgba.rgb * targetRGB);
|
|
43
|
+
rgba.rgb *= rgba.a;
|
|
44
|
+
return rgba;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
technique Draw
|
|
48
|
+
{
|
|
49
|
+
pass
|
|
50
|
+
{
|
|
51
|
+
vertex_shader = VSDefault(v_in);
|
|
52
|
+
pixel_shader = PSMuliplyImageRGBA(v_in);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
uniform float4x4 ViewProj;
|
|
2
|
+
uniform texture2d image;
|
|
3
|
+
|
|
4
|
+
uniform texture2d target;
|
|
5
|
+
uniform float4 color;
|
|
6
|
+
uniform float2 mul_val;
|
|
7
|
+
uniform float2 add_val;
|
|
8
|
+
|
|
9
|
+
sampler_state textureSampler {
|
|
10
|
+
Filter = Linear;
|
|
11
|
+
AddressU = Clamp;
|
|
12
|
+
AddressV = Clamp;
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
struct VertDataIn {
|
|
16
|
+
float4 pos : POSITION;
|
|
17
|
+
float2 uv : TEXCOORD0;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
struct VertDataOut {
|
|
21
|
+
float4 pos : POSITION;
|
|
22
|
+
float2 uv : TEXCOORD0;
|
|
23
|
+
float2 uv2 : TEXCOORD1;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
VertDataOut VSDefault(VertDataIn v_in)
|
|
27
|
+
{
|
|
28
|
+
VertDataOut vert_out;
|
|
29
|
+
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj);
|
|
30
|
+
vert_out.uv = v_in.uv;
|
|
31
|
+
vert_out.uv2 = v_in.uv * mul_val + add_val;
|
|
32
|
+
return vert_out;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
float4 PSSubtractImageRGBA(VertDataOut v_in) : TARGET
|
|
36
|
+
{
|
|
37
|
+
float4 rgba = image.Sample(textureSampler, v_in.uv);
|
|
38
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
39
|
+
rgba *= color;
|
|
40
|
+
|
|
41
|
+
float3 targetRGB = target.Sample(textureSampler, v_in.uv2).rgb;
|
|
42
|
+
rgba.rgb = saturate(rgba.rgb - targetRGB);
|
|
43
|
+
rgba.rgb *= rgba.a;
|
|
44
|
+
return rgba;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
technique Draw
|
|
48
|
+
{
|
|
49
|
+
pass
|
|
50
|
+
{
|
|
51
|
+
vertex_shader = VSDefault(v_in);
|
|
52
|
+
pixel_shader = PSSubtractImageRGBA(v_in);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
uniform float4x4 ViewProj;
|
|
2
|
+
uniform texture2d image;
|
|
3
|
+
|
|
4
|
+
uniform float4x4 yuv_mat = { 0.182586, 0.614231, 0.062007, 0.062745,
|
|
5
|
+
-0.100644, -0.338572, 0.439216, 0.501961,
|
|
6
|
+
0.439216, -0.398942, -0.040274, 0.501961,
|
|
7
|
+
0.000000, 0.000000, 0.000000, 1.000000};
|
|
8
|
+
|
|
9
|
+
uniform float4 color;
|
|
10
|
+
uniform float contrast;
|
|
11
|
+
uniform float brightness;
|
|
12
|
+
uniform float gamma;
|
|
13
|
+
|
|
14
|
+
uniform float2 chroma_key;
|
|
15
|
+
uniform float2 pixel_size;
|
|
16
|
+
uniform float similarity;
|
|
17
|
+
uniform float smoothness;
|
|
18
|
+
uniform float spill;
|
|
19
|
+
|
|
20
|
+
sampler_state textureSampler {
|
|
21
|
+
Filter = Linear;
|
|
22
|
+
AddressU = Clamp;
|
|
23
|
+
AddressV = Clamp;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
struct VertData {
|
|
27
|
+
float4 pos : POSITION;
|
|
28
|
+
float2 uv : TEXCOORD0;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
VertData VSDefault(VertData v_in)
|
|
32
|
+
{
|
|
33
|
+
VertData vert_out;
|
|
34
|
+
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj);
|
|
35
|
+
vert_out.uv = v_in.uv;
|
|
36
|
+
return vert_out;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
float4 CalcColor(float4 rgba)
|
|
40
|
+
{
|
|
41
|
+
return float4(pow(rgba.rgb, float3(gamma, gamma, gamma)) * contrast + brightness, rgba.a);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
float GetChromaDist(float3 rgb)
|
|
45
|
+
{
|
|
46
|
+
float4 yuvx = mul(float4(rgb.rgb, 1.0), yuv_mat);
|
|
47
|
+
return distance(chroma_key, yuvx.yz);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
float4 SampleTexture(float2 uv)
|
|
51
|
+
{
|
|
52
|
+
return image.Sample(textureSampler, uv);
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
float GetBoxFilteredChromaDist(float3 rgb, float2 texCoord)
|
|
56
|
+
{
|
|
57
|
+
float2 h_pixel_size = pixel_size / 2.0;
|
|
58
|
+
float2 point_0 = float2(pixel_size.x, h_pixel_size.y);
|
|
59
|
+
float2 point_1 = float2(h_pixel_size.x, -pixel_size.y);
|
|
60
|
+
float distVal = GetChromaDist(SampleTexture(texCoord-point_0).rgb);
|
|
61
|
+
distVal += GetChromaDist(SampleTexture(texCoord+point_0).rgb);
|
|
62
|
+
distVal += GetChromaDist(SampleTexture(texCoord-point_1).rgb);
|
|
63
|
+
distVal += GetChromaDist(SampleTexture(texCoord+point_1).rgb);
|
|
64
|
+
distVal *= 2.0;
|
|
65
|
+
distVal += GetChromaDist(rgb);
|
|
66
|
+
return distVal / 9.0;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
float4 ProcessChromaKey(float4 rgba, VertData v_in)
|
|
70
|
+
{
|
|
71
|
+
float chromaDist = GetBoxFilteredChromaDist(rgba.rgb, v_in.uv);
|
|
72
|
+
float baseMask = chromaDist - similarity;
|
|
73
|
+
float fullMask = pow(saturate(baseMask / smoothness), 1.5);
|
|
74
|
+
float spillVal = pow(saturate(baseMask / spill), 1.5);
|
|
75
|
+
|
|
76
|
+
rgba.rgba *= color;
|
|
77
|
+
rgba.a *= fullMask;
|
|
78
|
+
|
|
79
|
+
float desat = (rgba.r * 0.2126 + rgba.g * 0.7152 + rgba.b * 0.0722);
|
|
80
|
+
rgba.rgb = saturate(float3(desat, desat, desat)) * (1.0 - spillVal) + rgba.rgb * spillVal;
|
|
81
|
+
|
|
82
|
+
return CalcColor(rgba);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
float4 PSChromaKeyRGBA(VertData v_in) : TARGET
|
|
86
|
+
{
|
|
87
|
+
float4 rgba = image.Sample(textureSampler, v_in.uv);
|
|
88
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
89
|
+
return ProcessChromaKey(rgba, v_in);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
technique Draw
|
|
93
|
+
{
|
|
94
|
+
pass
|
|
95
|
+
{
|
|
96
|
+
vertex_shader = VSDefault(v_in);
|
|
97
|
+
pixel_shader = PSChromaKeyRGBA(v_in);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
uniform float4x4 ViewProj;
|
|
2
|
+
uniform texture2d image;
|
|
3
|
+
|
|
4
|
+
uniform float4 cb_v4 = { -0.100644, -0.338572, 0.439216, 0.501961 };
|
|
5
|
+
uniform float4 cr_v4 = { 0.439216, -0.398942, -0.040274, 0.501961 };
|
|
6
|
+
|
|
7
|
+
uniform float opacity;
|
|
8
|
+
uniform float contrast;
|
|
9
|
+
uniform float brightness;
|
|
10
|
+
uniform float gamma;
|
|
11
|
+
|
|
12
|
+
uniform float2 chroma_key;
|
|
13
|
+
uniform float2 pixel_size;
|
|
14
|
+
uniform float similarity;
|
|
15
|
+
uniform float smoothness;
|
|
16
|
+
uniform float spill;
|
|
17
|
+
|
|
18
|
+
sampler_state textureSampler {
|
|
19
|
+
Filter = Linear;
|
|
20
|
+
AddressU = Clamp;
|
|
21
|
+
AddressV = Clamp;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
struct VertData {
|
|
25
|
+
float4 pos : POSITION;
|
|
26
|
+
float2 uv : TEXCOORD0;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
VertData VSDefault(VertData v_in)
|
|
30
|
+
{
|
|
31
|
+
VertData vert_out;
|
|
32
|
+
vert_out.pos = mul(float4(v_in.pos.xyz, 1.0), ViewProj);
|
|
33
|
+
vert_out.uv = v_in.uv;
|
|
34
|
+
return vert_out;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
float4 CalcColor(float4 rgba)
|
|
38
|
+
{
|
|
39
|
+
return float4(pow(rgba.rgb, float3(gamma, gamma, gamma)) * contrast + brightness, rgba.a);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
float GetChromaDist(float3 rgb)
|
|
43
|
+
{
|
|
44
|
+
float cb = dot(rgb.rgb, cb_v4.xyz) + cb_v4.w;
|
|
45
|
+
float cr = dot(rgb.rgb, cr_v4.xyz) + cr_v4.w;
|
|
46
|
+
return distance(chroma_key, float2(cb, cr));
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
float GetNonlinearChannel(float u)
|
|
50
|
+
{
|
|
51
|
+
return (u <= 0.0031308) ? (12.92 * u) : ((1.055 * pow(u, 1.0 / 2.4)) - 0.055);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
float3 GetNonlinearColor(float3 rgb)
|
|
55
|
+
{
|
|
56
|
+
return float3(GetNonlinearChannel(rgb.r), GetNonlinearChannel(rgb.g), GetNonlinearChannel(rgb.b));
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
float3 SampleTexture(float2 uv)
|
|
60
|
+
{
|
|
61
|
+
float3 rgb = image.Sample(textureSampler, uv).rgb;
|
|
62
|
+
return GetNonlinearColor(rgb);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
float GetBoxFilteredChromaDist(float3 rgb, float2 texCoord)
|
|
66
|
+
{
|
|
67
|
+
float2 h_pixel_size = pixel_size / 2.0;
|
|
68
|
+
float2 point_0 = float2(pixel_size.x, h_pixel_size.y);
|
|
69
|
+
float2 point_1 = float2(h_pixel_size.x, -pixel_size.y);
|
|
70
|
+
float distVal = GetChromaDist(SampleTexture(texCoord-point_0));
|
|
71
|
+
distVal += GetChromaDist(SampleTexture(texCoord+point_0));
|
|
72
|
+
distVal += GetChromaDist(SampleTexture(texCoord-point_1));
|
|
73
|
+
distVal += GetChromaDist(SampleTexture(texCoord+point_1));
|
|
74
|
+
distVal *= 2.0;
|
|
75
|
+
distVal += GetChromaDist(GetNonlinearColor(rgb));
|
|
76
|
+
return distVal / 9.0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
float4 ProcessChromaKey(float4 rgba, VertData v_in)
|
|
80
|
+
{
|
|
81
|
+
float chromaDist = GetBoxFilteredChromaDist(rgba.rgb, v_in.uv);
|
|
82
|
+
float baseMask = chromaDist - similarity;
|
|
83
|
+
float fullMask = pow(saturate(baseMask / smoothness), 1.5);
|
|
84
|
+
float spillVal = pow(saturate(baseMask / spill), 1.5);
|
|
85
|
+
|
|
86
|
+
rgba.a *= opacity;
|
|
87
|
+
rgba.a *= fullMask;
|
|
88
|
+
|
|
89
|
+
float desat = dot(rgba.rgb, float3(0.2126, 0.7152, 0.0722));
|
|
90
|
+
rgba.rgb = lerp(float3(desat, desat, desat), rgba.rgb, spillVal);
|
|
91
|
+
|
|
92
|
+
return CalcColor(rgba);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
float4 PSChromaKeyRGBA(VertData v_in) : TARGET
|
|
96
|
+
{
|
|
97
|
+
float4 rgba = image.Sample(textureSampler, v_in.uv);
|
|
98
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
99
|
+
rgba = ProcessChromaKey(rgba, v_in);
|
|
100
|
+
rgba.rgb *= rgba.a;
|
|
101
|
+
return rgba;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
technique Draw
|
|
105
|
+
{
|
|
106
|
+
pass
|
|
107
|
+
{
|
|
108
|
+
vertex_shader = VSDefault(v_in);
|
|
109
|
+
pixel_shader = PSChromaKeyRGBA(v_in);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
float srgb_linear_to_nonlinear_channel(float u)
|
|
2
|
+
{
|
|
3
|
+
return (u <= 0.0031308) ? (12.92 * u) : ((1.055 * pow(u, 1. / 2.4)) - 0.055);
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
float3 srgb_linear_to_nonlinear(float3 v)
|
|
7
|
+
{
|
|
8
|
+
return float3(srgb_linear_to_nonlinear_channel(v.r), srgb_linear_to_nonlinear_channel(v.g), srgb_linear_to_nonlinear_channel(v.b));
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
float srgb_nonlinear_to_linear_channel(float u)
|
|
12
|
+
{
|
|
13
|
+
return (u <= 0.04045) ? (u / 12.92) : pow(mad(u, 1. / 1.055, .055 / 1.055), 2.4);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
float3 srgb_nonlinear_to_linear(float3 v)
|
|
17
|
+
{
|
|
18
|
+
return float3(srgb_nonlinear_to_linear_channel(v.r), srgb_nonlinear_to_linear_channel(v.g), srgb_nonlinear_to_linear_channel(v.b));
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
float3 rec709_to_rec2020(float3 v)
|
|
22
|
+
{
|
|
23
|
+
float r = dot(v, float3(0.62740389593469903, 0.32928303837788370, 0.043313065687417225));
|
|
24
|
+
float g = dot(v, float3(0.069097289358232075, 0.91954039507545871, 0.011362315566309178));
|
|
25
|
+
float b = dot(v, float3(0.016391438875150280, 0.088013307877225749, 0.89559525324762401));
|
|
26
|
+
return float3(r, g, b);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
float3 rec2020_to_rec709(float3 v)
|
|
30
|
+
{
|
|
31
|
+
float r = dot(v, float3(1.6604910021084345, -0.58764113878854951, -0.072849863319884883));
|
|
32
|
+
float g = dot(v, float3(-0.12455047452159074, 1.1328998971259603, -0.0083494226043694768));
|
|
33
|
+
float b = dot(v, float3(-0.018150763354905303, -0.10057889800800739, 1.1187296613629127));
|
|
34
|
+
return float3(r, g, b);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
float3 reinhard(float3 rgb)
|
|
38
|
+
{
|
|
39
|
+
rgb /= rgb + float3(1., 1., 1.);
|
|
40
|
+
rgb = saturate(rgb);
|
|
41
|
+
rgb = pow(rgb, float3(1. / 2.4, 1. / 2.4, 1. / 2.4));
|
|
42
|
+
rgb = srgb_nonlinear_to_linear(rgb);
|
|
43
|
+
return rgb;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
float linear_to_st2084_channel(float x)
|
|
47
|
+
{
|
|
48
|
+
float c = pow(abs(x), 0.1593017578);
|
|
49
|
+
return pow((0.8359375 + 18.8515625 * c) / (1. + 18.6875 * c), 78.84375);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
float st2084_to_linear_channel(float u)
|
|
53
|
+
{
|
|
54
|
+
float c = pow(abs(u), 1. / 78.84375);
|
|
55
|
+
return pow(abs(max(c - 0.8359375, 0.) / (18.8515625 - 18.6875 * c)), 1. / 0.1593017578);
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
float eetf_0_Lmax(float maxRGB1_pq, float Lw, float Lmax)
|
|
59
|
+
{
|
|
60
|
+
float Lw_pq = linear_to_st2084_channel(Lw / 10000.);
|
|
61
|
+
float E1 = saturate(maxRGB1_pq / Lw_pq); // Ensure normalization in case Lw is a lie
|
|
62
|
+
float maxLum = linear_to_st2084_channel(Lmax / 10000.) / Lw_pq;
|
|
63
|
+
float KS = (1.5 * maxLum) - 0.5;
|
|
64
|
+
float E2 = E1;
|
|
65
|
+
if (E1 > KS)
|
|
66
|
+
{
|
|
67
|
+
float T = (E1 - KS) / (1. - KS);
|
|
68
|
+
float Tsquared = T * T;
|
|
69
|
+
float Tcubed = Tsquared * T;
|
|
70
|
+
float P = (2. * Tcubed - 3. * Tsquared + 1.) * KS + (Tcubed - 2. * Tsquared + T) * (1. - KS) + (-2. * Tcubed + 3. * Tsquared) * maxLum;
|
|
71
|
+
E2 = P;
|
|
72
|
+
}
|
|
73
|
+
float E3 = E2;
|
|
74
|
+
float E4 = E3 * Lw_pq;
|
|
75
|
+
return E4;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
float3 maxRGB_eetf_internal(float3 rgb_linear, float maxRGB1_linear, float maxRGB1_pq, float Lw, float Lmax)
|
|
79
|
+
{
|
|
80
|
+
float maxRGB2_pq = eetf_0_Lmax(maxRGB1_pq, Lw, Lmax);
|
|
81
|
+
float maxRGB2_linear = st2084_to_linear_channel(maxRGB2_pq);
|
|
82
|
+
|
|
83
|
+
// avoid divide-by-zero possibility
|
|
84
|
+
maxRGB1_linear = max(6.10352e-5, maxRGB1_linear);
|
|
85
|
+
|
|
86
|
+
rgb_linear *= maxRGB2_linear / maxRGB1_linear;
|
|
87
|
+
return rgb_linear;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
float3 maxRGB_eetf_linear_to_linear(float3 rgb_linear, float Lw, float Lmax)
|
|
91
|
+
{
|
|
92
|
+
float maxRGB1_linear = max(max(rgb_linear.r, rgb_linear.g), rgb_linear.b);
|
|
93
|
+
float maxRGB1_pq = linear_to_st2084_channel(maxRGB1_linear);
|
|
94
|
+
return maxRGB_eetf_internal(rgb_linear, maxRGB1_linear, maxRGB1_pq, Lw, Lmax);
|
|
95
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*****************************************************************************
|
|
2
|
+
Copyright (C) 2016 by c3r1c3 <c3r1c3@nevermindonline.com>
|
|
3
|
+
|
|
4
|
+
This program is free software: you can redistribute it and/or modify
|
|
5
|
+
it under the terms of the GNU General Public License as published by
|
|
6
|
+
the Free Software Foundation, either version 2 of the License, or
|
|
7
|
+
(at your option) any later version.
|
|
8
|
+
|
|
9
|
+
This program is distributed in the hope that it will be useful,
|
|
10
|
+
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
11
|
+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
12
|
+
GNU General Public License for more details.
|
|
13
|
+
|
|
14
|
+
You should have received a copy of the GNU General Public License
|
|
15
|
+
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
16
|
+
*****************************************************************************/
|
|
17
|
+
|
|
18
|
+
uniform float4x4 ViewProj;
|
|
19
|
+
uniform texture2d image;
|
|
20
|
+
|
|
21
|
+
uniform float gamma;
|
|
22
|
+
|
|
23
|
+
/* Pre-Compute variables. */
|
|
24
|
+
uniform float4x4 color_matrix;
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
sampler_state textureSampler {
|
|
28
|
+
Filter = Linear;
|
|
29
|
+
AddressU = Clamp;
|
|
30
|
+
AddressV = Clamp;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
struct VertData {
|
|
34
|
+
float4 pos : POSITION;
|
|
35
|
+
float2 uv : TEXCOORD0;
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
VertData VSDefault(VertData vert_in)
|
|
39
|
+
{
|
|
40
|
+
VertData vert_out;
|
|
41
|
+
vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
|
|
42
|
+
vert_out.uv = vert_in.uv;
|
|
43
|
+
return vert_out;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
float4 PSColorFilterRGBA(VertData vert_in) : TARGET
|
|
47
|
+
{
|
|
48
|
+
/* Grab the current pixel to perform operations on. */
|
|
49
|
+
float4 currentPixel = image.Sample(textureSampler, vert_in.uv);
|
|
50
|
+
currentPixel.rgb *= (currentPixel.a > 0.) ? (1. / currentPixel.a) : 0.;
|
|
51
|
+
|
|
52
|
+
/* Always address the gamma first. */
|
|
53
|
+
currentPixel.rgb = pow(currentPixel.rgb, float3(gamma, gamma, gamma));
|
|
54
|
+
|
|
55
|
+
/* Much easier to manipulate pixels for these types of operations
|
|
56
|
+
* when in a matrix such as the below. See
|
|
57
|
+
* http://www.graficaobscura.com/matrix/index.html and
|
|
58
|
+
* https://docs.rainmeter.net/tips/colormatrix-guide/for more info.
|
|
59
|
+
*/
|
|
60
|
+
currentPixel = mul(color_matrix, currentPixel);
|
|
61
|
+
|
|
62
|
+
currentPixel.rgb *= currentPixel.a;
|
|
63
|
+
|
|
64
|
+
return currentPixel;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
technique Draw
|
|
68
|
+
{
|
|
69
|
+
pass
|
|
70
|
+
{
|
|
71
|
+
vertex_shader = VSDefault(vert_in);
|
|
72
|
+
pixel_shader = PSColorFilterRGBA(vert_in);
|
|
73
|
+
}
|
|
74
|
+
}
|