noobs 0.0.6
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/COPYING +339 -0
- package/README.md +46 -0
- package/bin/64bit/obs.lib +0 -0
- package/binding.gyp +23 -0
- package/dist/bin/Qt6Core.dll +0 -0
- package/dist/bin/Qt6Gui.dll +0 -0
- package/dist/bin/Qt6Network.dll +0 -0
- package/dist/bin/Qt6Svg.dll +0 -0
- package/dist/bin/Qt6Widgets.dll +0 -0
- package/dist/bin/Qt6Xml.dll +0 -0
- package/dist/bin/avcodec-61.dll +0 -0
- package/dist/bin/avdevice-61.dll +0 -0
- package/dist/bin/avfilter-10.dll +0 -0
- package/dist/bin/avformat-61.dll +0 -0
- package/dist/bin/avutil-59.dll +0 -0
- package/dist/bin/datachannel.dll +0 -0
- package/dist/bin/libcurl.dll +0 -0
- package/dist/bin/libobs-d3d11.dll +0 -0
- package/dist/bin/libobs-opengl.dll +0 -0
- package/dist/bin/libobs-winrt.dll +0 -0
- package/dist/bin/librist.dll +0 -0
- package/dist/bin/libx264-164.dll +0 -0
- package/dist/bin/lua51.dll +0 -0
- package/dist/bin/obs-amf-test.exe +0 -0
- package/dist/bin/obs-ffmpeg-mux.exe +0 -0
- package/dist/bin/obs-frontend-api.dll +0 -0
- package/dist/bin/obs-scripting.dll +0 -0
- package/dist/bin/obs.dll +0 -0
- package/dist/bin/srt.dll +0 -0
- package/dist/bin/swresample-5.dll +0 -0
- package/dist/bin/swscale-8.dll +0 -0
- package/dist/bin/w32-pthreads.dll +0 -0
- package/dist/bin/zlib.dll +0 -0
- package/dist/effects/area.effect +250 -0
- package/dist/effects/bicubic_scale.effect +236 -0
- package/dist/effects/bilinear_lowres_scale.effect +123 -0
- package/dist/effects/color.effect +172 -0
- package/dist/effects/default.effect +254 -0
- package/dist/effects/default_rect.effect +84 -0
- package/dist/effects/deinterlace_base.effect +325 -0
- package/dist/effects/deinterlace_blend.effect +21 -0
- package/dist/effects/deinterlace_blend_2x.effect +21 -0
- package/dist/effects/deinterlace_discard.effect +21 -0
- package/dist/effects/deinterlace_discard_2x.effect +21 -0
- package/dist/effects/deinterlace_linear.effect +21 -0
- package/dist/effects/deinterlace_linear_2x.effect +21 -0
- package/dist/effects/deinterlace_yadif.effect +21 -0
- package/dist/effects/deinterlace_yadif_2x.effect +21 -0
- package/dist/effects/format_conversion.effect +1823 -0
- package/dist/effects/lanczos_scale.effect +292 -0
- package/dist/effects/opaque.effect +159 -0
- package/dist/effects/premultiplied_alpha.effect +38 -0
- package/dist/effects/repeat.effect +36 -0
- package/dist/effects/solid.effect +80 -0
- package/dist/noobs.node +0 -0
- package/dist/plugins/obs-ffmpeg.dll +0 -0
- package/dist/plugins/obs-x264.dll +0 -0
- package/dist/plugins/win-capture.dll +0 -0
- package/include/audio-monitoring/osx/mac-helpers.h +13 -0
- package/include/audio-monitoring/pulse/pulseaudio-wrapper.h +212 -0
- package/include/audio-monitoring/win32/wasapi-output.h +22 -0
- package/include/callback/calldata.h +195 -0
- package/include/callback/decl.h +61 -0
- package/include/callback/proc.h +52 -0
- package/include/callback/signal.h +73 -0
- package/include/graphics/axisang.h +65 -0
- package/include/graphics/bounds.h +108 -0
- package/include/graphics/device-exports.h +177 -0
- package/include/graphics/effect-parser.h +290 -0
- package/include/graphics/effect.h +190 -0
- package/include/graphics/graphics-internal.h +335 -0
- package/include/graphics/graphics.h +1024 -0
- package/include/graphics/half.h +100 -0
- package/include/graphics/image-file.h +124 -0
- package/include/graphics/input.h +34 -0
- package/include/graphics/libnsgif/libnsgif.h +142 -0
- package/include/graphics/math-defs.h +45 -0
- package/include/graphics/math-extra.h +61 -0
- package/include/graphics/matrix3.h +98 -0
- package/include/graphics/matrix4.h +102 -0
- package/include/graphics/plane.h +85 -0
- package/include/graphics/quat.h +170 -0
- package/include/graphics/shader-parser.h +273 -0
- package/include/graphics/srgb.h +177 -0
- package/include/graphics/vec2.h +148 -0
- package/include/graphics/vec3.h +224 -0
- package/include/graphics/vec4.h +241 -0
- package/include/media-io/audio-io.h +228 -0
- package/include/media-io/audio-math.h +43 -0
- package/include/media-io/audio-resampler.h +44 -0
- package/include/media-io/format-conversion.h +50 -0
- package/include/media-io/frame-rate.h +29 -0
- package/include/media-io/media-io-defs.h +20 -0
- package/include/media-io/media-remux.h +37 -0
- package/include/media-io/video-frame.h +64 -0
- package/include/media-io/video-io.h +338 -0
- package/include/media-io/video-scaler.h +43 -0
- package/include/obs-audio-controls.h +250 -0
- package/include/obs-av1.h +47 -0
- package/include/obs-avc.h +55 -0
- package/include/obs-config.h +52 -0
- package/include/obs-data.h +311 -0
- package/include/obs-defs.h +52 -0
- package/include/obs-encoder.h +361 -0
- package/include/obs-ffmpeg-compat.h +13 -0
- package/include/obs-hevc.h +81 -0
- package/include/obs-hotkey.h +271 -0
- package/include/obs-hotkeys.h +653 -0
- package/include/obs-interaction.h +56 -0
- package/include/obs-internal.h +1459 -0
- package/include/obs-missing-files.h +53 -0
- package/include/obs-module.h +181 -0
- package/include/obs-nal.h +37 -0
- package/include/obs-nix-platform.h +53 -0
- package/include/obs-nix-wayland.h +24 -0
- package/include/obs-nix-x11.h +22 -0
- package/include/obs-nix.h +42 -0
- package/include/obs-output.h +96 -0
- package/include/obs-properties.h +364 -0
- package/include/obs-scene.h +127 -0
- package/include/obs-service.h +115 -0
- package/include/obs-source.h +568 -0
- package/include/obs.h +2608 -0
- package/include/obsconfig.h +13 -0
- package/include/obsversion.h +5 -0
- package/include/util/apple/cfstring-utils.h +16 -0
- package/include/util/array-serializer.h +37 -0
- package/include/util/base.h +97 -0
- package/include/util/bitstream.h +28 -0
- package/include/util/bmem.h +94 -0
- package/include/util/buffered-file-serializer.h +32 -0
- package/include/util/c99defs.h +75 -0
- package/include/util/cf-lexer.h +199 -0
- package/include/util/cf-parser.h +281 -0
- package/include/util/circlebuf.h +319 -0
- package/include/util/config-file.h +103 -0
- package/include/util/crc32.h +29 -0
- package/include/util/curl/curl-helper.h +35 -0
- package/include/util/darray.h +606 -0
- package/include/util/deque.h +319 -0
- package/include/util/dstr.h +320 -0
- package/include/util/file-serializer.h +34 -0
- package/include/util/lexer.h +273 -0
- package/include/util/pipe.h +52 -0
- package/include/util/platform.h +223 -0
- package/include/util/profiler.h +97 -0
- package/include/util/serializer.h +158 -0
- package/include/util/simde/check.h +285 -0
- package/include/util/simde/debug-trap.h +117 -0
- package/include/util/simde/hedley.h +2123 -0
- package/include/util/simde/simde-align.h +481 -0
- package/include/util/simde/simde-arch.h +537 -0
- package/include/util/simde/simde-common.h +918 -0
- package/include/util/simde/simde-constify.h +925 -0
- package/include/util/simde/simde-detect-clang.h +114 -0
- package/include/util/simde/simde-diagnostic.h +447 -0
- package/include/util/simde/simde-features.h +550 -0
- package/include/util/simde/simde-math.h +1858 -0
- package/include/util/simde/x86/mmx.h +2456 -0
- package/include/util/simde/x86/sse.h +4479 -0
- package/include/util/simde/x86/sse2.h +7549 -0
- package/include/util/source-profiler.h +66 -0
- package/include/util/sse-intrin.h +32 -0
- package/include/util/task.h +22 -0
- package/include/util/text-lookup.h +45 -0
- package/include/util/threading-posix.h +77 -0
- package/include/util/threading-windows.h +142 -0
- package/include/util/threading.h +103 -0
- package/include/util/utf8.h +35 -0
- package/include/util/uthash.h +34 -0
- package/include/util/util_uint128.h +108 -0
- package/include/util/util_uint64.h +34 -0
- package/include/util/windows/device-enum.h +14 -0
- package/include/util/windows/obfuscate.h +16 -0
- package/include/util/windows/win-registry.h +37 -0
- package/include/util/windows/win-version.h +57 -0
- package/include/util/windows/window-helpers.h +47 -0
- package/index.d.ts +38 -0
- package/index.js +8 -0
- package/package.json +31 -0
- package/src/main.cpp +321 -0
- package/src/obs_interface.cpp +605 -0
- package/src/obs_interface.h +74 -0
- package/src/utils.cpp +80 -0
- package/src/utils.h +3 -0
|
@@ -0,0 +1,172 @@
|
|
|
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 d65p3_to_rec709(float3 v)
|
|
30
|
+
{
|
|
31
|
+
float r = dot(v, float3(1.2249401762805598, -0.22494017628055996, 0.));
|
|
32
|
+
float g = dot(v, float3(-0.042056954709688163, 1.0420569547096881, 0.));
|
|
33
|
+
float b = dot(v, float3(-0.019637554590334432, -0.078636045550631889, 1.0982736001409663));
|
|
34
|
+
return float3(r, g, b);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
float3 rec2020_to_rec709(float3 v)
|
|
38
|
+
{
|
|
39
|
+
float r = dot(v, float3(1.6604910021084345, -0.58764113878854951, -0.072849863319884883));
|
|
40
|
+
float g = dot(v, float3(-0.12455047452159074, 1.1328998971259603, -0.0083494226043694768));
|
|
41
|
+
float b = dot(v, float3(-0.018150763354905303, -0.10057889800800739, 1.1187296613629127));
|
|
42
|
+
return float3(r, g, b);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
float3 reinhard(float3 rgb)
|
|
46
|
+
{
|
|
47
|
+
rgb /= rgb + float3(1., 1., 1.);
|
|
48
|
+
rgb = saturate(rgb);
|
|
49
|
+
rgb = pow(rgb, float3(1. / 2.4, 1. / 2.4, 1. / 2.4));
|
|
50
|
+
rgb = srgb_nonlinear_to_linear(rgb);
|
|
51
|
+
return rgb;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
float linear_to_st2084_channel(float x)
|
|
55
|
+
{
|
|
56
|
+
float c = pow(abs(x), 0.1593017578);
|
|
57
|
+
return pow((0.8359375 + 18.8515625 * c) / (1. + 18.6875 * c), 78.84375);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
float3 linear_to_st2084(float3 rgb)
|
|
61
|
+
{
|
|
62
|
+
return float3(linear_to_st2084_channel(rgb.r), linear_to_st2084_channel(rgb.g), linear_to_st2084_channel(rgb.b));
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
float st2084_to_linear_channel(float u)
|
|
66
|
+
{
|
|
67
|
+
float c = pow(abs(u), 1. / 78.84375);
|
|
68
|
+
return pow(abs(max(c - 0.8359375, 0.) / (18.8515625 - 18.6875 * c)), 1. / 0.1593017578);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
float3 st2084_to_linear(float3 rgb)
|
|
72
|
+
{
|
|
73
|
+
return float3(st2084_to_linear_channel(rgb.r), st2084_to_linear_channel(rgb.g), st2084_to_linear_channel(rgb.b));
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
float eetf_0_Lmax(float maxRGB1_pq, float Lw, float Lmax)
|
|
77
|
+
{
|
|
78
|
+
float Lw_pq = linear_to_st2084_channel(Lw / 10000.);
|
|
79
|
+
float E1 = saturate(maxRGB1_pq / Lw_pq); // Ensure normalization in case Lw is a lie
|
|
80
|
+
float maxLum = linear_to_st2084_channel(Lmax / 10000.) / Lw_pq;
|
|
81
|
+
float KS = (1.5 * maxLum) - 0.5;
|
|
82
|
+
float E2 = E1;
|
|
83
|
+
if (E1 > KS)
|
|
84
|
+
{
|
|
85
|
+
float T = (E1 - KS) / (1. - KS);
|
|
86
|
+
float Tsquared = T * T;
|
|
87
|
+
float Tcubed = Tsquared * T;
|
|
88
|
+
float P = (2. * Tcubed - 3. * Tsquared + 1.) * KS + (Tcubed - 2. * Tsquared + T) * (1. - KS) + (-2. * Tcubed + 3. * Tsquared) * maxLum;
|
|
89
|
+
E2 = P;
|
|
90
|
+
}
|
|
91
|
+
float E3 = E2;
|
|
92
|
+
float E4 = E3 * Lw_pq;
|
|
93
|
+
return E4;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
float3 maxRGB_eetf_internal(float3 rgb_linear, float maxRGB1_linear, float maxRGB1_pq, float Lw, float Lmax)
|
|
97
|
+
{
|
|
98
|
+
float maxRGB2_pq = eetf_0_Lmax(maxRGB1_pq, Lw, Lmax);
|
|
99
|
+
float maxRGB2_linear = st2084_to_linear_channel(maxRGB2_pq);
|
|
100
|
+
|
|
101
|
+
// avoid divide-by-zero possibility
|
|
102
|
+
maxRGB1_linear = max(6.10352e-5, maxRGB1_linear);
|
|
103
|
+
|
|
104
|
+
rgb_linear *= maxRGB2_linear / maxRGB1_linear;
|
|
105
|
+
return rgb_linear;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
float3 maxRGB_eetf_pq_to_linear(float3 rgb_pq, float Lw, float Lmax)
|
|
109
|
+
{
|
|
110
|
+
float3 rgb_linear = st2084_to_linear(rgb_pq);
|
|
111
|
+
float maxRGB1_linear = max(max(rgb_linear.r, rgb_linear.g), rgb_linear.b);
|
|
112
|
+
float maxRGB1_pq = max(max(rgb_pq.r, rgb_pq.g), rgb_pq.b);
|
|
113
|
+
return maxRGB_eetf_internal(rgb_linear, maxRGB1_linear, maxRGB1_pq, Lw, Lmax);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
float3 maxRGB_eetf_linear_to_linear(float3 rgb_linear, float Lw, float Lmax)
|
|
117
|
+
{
|
|
118
|
+
float maxRGB1_linear = max(max(rgb_linear.r, rgb_linear.g), rgb_linear.b);
|
|
119
|
+
float maxRGB1_pq = linear_to_st2084_channel(maxRGB1_linear);
|
|
120
|
+
return maxRGB_eetf_internal(rgb_linear, maxRGB1_linear, maxRGB1_pq, Lw, Lmax);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
float3 st2084_to_linear_eetf(float3 rgb, float Lw, float Lmax)
|
|
124
|
+
{
|
|
125
|
+
return (Lw > Lmax) ? maxRGB_eetf_pq_to_linear(rgb, Lw, Lmax) : st2084_to_linear(rgb);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
float linear_to_hlg_channel(float u)
|
|
129
|
+
{
|
|
130
|
+
float ln2_i = 1. / log(2.);
|
|
131
|
+
float m = 0.17883277 / ln2_i;
|
|
132
|
+
return (u <= (1. / 12.)) ? sqrt(3. * u) : ((log2((12. * u) - 0.28466892) * m) + 0.55991073);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
float3 linear_to_hlg(float3 rgb, float Lw)
|
|
136
|
+
{
|
|
137
|
+
rgb = saturate(rgb);
|
|
138
|
+
|
|
139
|
+
if (Lw > 1000.)
|
|
140
|
+
{
|
|
141
|
+
rgb = maxRGB_eetf_linear_to_linear(rgb, Lw, 1000.);
|
|
142
|
+
rgb *= 10000. / Lw;
|
|
143
|
+
}
|
|
144
|
+
else
|
|
145
|
+
{
|
|
146
|
+
rgb *= 10.;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
float Yd = dot(rgb, float3(0.2627, 0.678, 0.0593));
|
|
150
|
+
|
|
151
|
+
// avoid inf from pow(0., negative) by using smallest positive normal number
|
|
152
|
+
Yd = max(6.10352e-5, Yd);
|
|
153
|
+
|
|
154
|
+
rgb *= pow(Yd, -1. / 6.);
|
|
155
|
+
return float3(linear_to_hlg_channel(rgb.r), linear_to_hlg_channel(rgb.g), linear_to_hlg_channel(rgb.b));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
float hlg_to_linear_channel(float u)
|
|
159
|
+
{
|
|
160
|
+
float ln2_i = 1. / log(2.);
|
|
161
|
+
float m = ln2_i / 0.17883277;
|
|
162
|
+
float a = -ln2_i * 0.55991073 / 0.17883277;
|
|
163
|
+
return (u <= 0.5) ? ((u * u) / 3.) : ((exp2(u * m + a) + 0.28466892) / 12.);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
float3 hlg_to_linear(float3 v, float exponent)
|
|
167
|
+
{
|
|
168
|
+
float3 rgb = float3(hlg_to_linear_channel(v.r), hlg_to_linear_channel(v.g), hlg_to_linear_channel(v.b));
|
|
169
|
+
float Ys = dot(rgb, float3(0.2627, 0.678, 0.0593));
|
|
170
|
+
rgb *= pow(Ys, exponent);
|
|
171
|
+
return rgb;
|
|
172
|
+
}
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
#include "color.effect"
|
|
2
|
+
|
|
3
|
+
uniform float4x4 ViewProj;
|
|
4
|
+
uniform texture2d image;
|
|
5
|
+
uniform float multiplier;
|
|
6
|
+
|
|
7
|
+
sampler_state def_sampler {
|
|
8
|
+
Filter = Linear;
|
|
9
|
+
AddressU = Clamp;
|
|
10
|
+
AddressV = Clamp;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
struct VertInOut {
|
|
14
|
+
float4 pos : POSITION;
|
|
15
|
+
float2 uv : TEXCOORD0;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
VertInOut VSDefault(VertInOut vert_in)
|
|
19
|
+
{
|
|
20
|
+
VertInOut vert_out;
|
|
21
|
+
vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
|
|
22
|
+
vert_out.uv = vert_in.uv;
|
|
23
|
+
return vert_out;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
float4 PSDrawBare(VertInOut vert_in) : TARGET
|
|
27
|
+
{
|
|
28
|
+
return image.Sample(def_sampler, vert_in.uv);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
float4 PSDrawAlphaDivide(VertInOut vert_in) : TARGET
|
|
32
|
+
{
|
|
33
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
34
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
35
|
+
return rgba;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
float4 PSDrawAlphaDivideTonemap(VertInOut vert_in) : TARGET
|
|
39
|
+
{
|
|
40
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
41
|
+
rgba.rgb *= (rgba.a > 0.) ? (1. / rgba.a) : 0.;
|
|
42
|
+
rgba.rgb = rec709_to_rec2020(rgba.rgb);
|
|
43
|
+
rgba.rgb = reinhard(rgba.rgb);
|
|
44
|
+
rgba.rgb = rec2020_to_rec709(rgba.rgb);
|
|
45
|
+
return rgba;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
float4 PSDrawAlphaDivideR10L(VertInOut vert_in) : TARGET
|
|
49
|
+
{
|
|
50
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
51
|
+
rgba.rgb *= (rgba.a > 0.) ? (multiplier / rgba.a) : 0.;
|
|
52
|
+
rgba.rgb = rec709_to_rec2020(rgba.rgb);
|
|
53
|
+
rgba.rgb = linear_to_st2084(rgba.rgb);
|
|
54
|
+
uint3 rgb1023 = uint3(mad(rgba.rgb, 876., 64.5));
|
|
55
|
+
uint b = (rgb1023.b & 0x3Fu) << 2;
|
|
56
|
+
uint g = ((rgb1023.b & 0x3C0u) >> 6) | ((rgb1023.g & 0xFu) << 4);
|
|
57
|
+
uint r = ((rgb1023.g & 0x3F0u) >> 4) | ((rgb1023.r & 0x3u) << 6);
|
|
58
|
+
uint a = ((rgb1023.r & 0x3FCu) >> 2);
|
|
59
|
+
return float4(uint4(r, g, b, a)) / 255.;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
float4 PSDrawNonlinearAlpha(VertInOut vert_in) : TARGET
|
|
63
|
+
{
|
|
64
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
65
|
+
rgba.rgb = srgb_linear_to_nonlinear(rgba.rgb);
|
|
66
|
+
rgba.rgb *= rgba.a;
|
|
67
|
+
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
|
68
|
+
return rgba;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
float4 PSDrawNonlinearAlphaMultiply(VertInOut vert_in) : TARGET
|
|
72
|
+
{
|
|
73
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
74
|
+
rgba.rgb = srgb_linear_to_nonlinear(rgba.rgb);
|
|
75
|
+
rgba.rgb *= rgba.a;
|
|
76
|
+
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
|
77
|
+
rgba.rgb *= multiplier;
|
|
78
|
+
return rgba;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
float4 PSDrawSrgbDecompress(VertInOut vert_in) : TARGET
|
|
82
|
+
{
|
|
83
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
84
|
+
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
|
85
|
+
return rgba;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
float4 PSDrawSrgbDecompressMultiply(VertInOut vert_in) : TARGET
|
|
89
|
+
{
|
|
90
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
91
|
+
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
|
92
|
+
rgba.rgb *= multiplier;
|
|
93
|
+
return rgba;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
float4 PSDrawMultiply(VertInOut vert_in) : TARGET
|
|
97
|
+
{
|
|
98
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
99
|
+
rgba.rgb *= multiplier;
|
|
100
|
+
return rgba;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
float4 PSDrawTonemap(VertInOut vert_in) : TARGET
|
|
104
|
+
{
|
|
105
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
106
|
+
rgba.rgb = rec709_to_rec2020(rgba.rgb);
|
|
107
|
+
rgba.rgb = reinhard(rgba.rgb);
|
|
108
|
+
rgba.rgb = rec2020_to_rec709(rgba.rgb);
|
|
109
|
+
return rgba;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
float4 PSDrawMultiplyTonemap(VertInOut vert_in) : TARGET
|
|
113
|
+
{
|
|
114
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
115
|
+
rgba.rgb *= multiplier;
|
|
116
|
+
rgba.rgb = rec709_to_rec2020(rgba.rgb);
|
|
117
|
+
rgba.rgb = reinhard(rgba.rgb);
|
|
118
|
+
rgba.rgb = rec2020_to_rec709(rgba.rgb);
|
|
119
|
+
return rgba;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
float4 PSDrawPQ(VertInOut vert_in) : TARGET
|
|
123
|
+
{
|
|
124
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
125
|
+
rgba.rgb = st2084_to_linear(rgba.rgb) * multiplier;
|
|
126
|
+
rgba.rgb = rec2020_to_rec709(rgba.rgb);
|
|
127
|
+
return rgba;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
float4 PSDrawTonemapPQ(VertInOut vert_in) : TARGET
|
|
131
|
+
{
|
|
132
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
133
|
+
rgba.rgb = st2084_to_linear(rgba.rgb) * multiplier;
|
|
134
|
+
rgba.rgb = reinhard(rgba.rgb);
|
|
135
|
+
rgba.rgb = rec2020_to_rec709(rgba.rgb);
|
|
136
|
+
return rgba;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
technique Draw
|
|
140
|
+
{
|
|
141
|
+
pass
|
|
142
|
+
{
|
|
143
|
+
vertex_shader = VSDefault(vert_in);
|
|
144
|
+
pixel_shader = PSDrawBare(vert_in);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
technique DrawAlphaDivide
|
|
149
|
+
{
|
|
150
|
+
pass
|
|
151
|
+
{
|
|
152
|
+
vertex_shader = VSDefault(vert_in);
|
|
153
|
+
pixel_shader = PSDrawAlphaDivide(vert_in);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
technique DrawAlphaDivideTonemap
|
|
158
|
+
{
|
|
159
|
+
pass
|
|
160
|
+
{
|
|
161
|
+
vertex_shader = VSDefault(vert_in);
|
|
162
|
+
pixel_shader = PSDrawAlphaDivideTonemap(vert_in);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
technique DrawAlphaDivideR10L
|
|
167
|
+
{
|
|
168
|
+
pass
|
|
169
|
+
{
|
|
170
|
+
vertex_shader = VSDefault(vert_in);
|
|
171
|
+
pixel_shader = PSDrawAlphaDivideR10L(vert_in);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
technique DrawNonlinearAlpha
|
|
176
|
+
{
|
|
177
|
+
pass
|
|
178
|
+
{
|
|
179
|
+
vertex_shader = VSDefault(vert_in);
|
|
180
|
+
pixel_shader = PSDrawNonlinearAlpha(vert_in);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
technique DrawNonlinearAlphaMultiply
|
|
185
|
+
{
|
|
186
|
+
pass
|
|
187
|
+
{
|
|
188
|
+
vertex_shader = VSDefault(vert_in);
|
|
189
|
+
pixel_shader = PSDrawNonlinearAlphaMultiply(vert_in);
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
technique DrawSrgbDecompress
|
|
194
|
+
{
|
|
195
|
+
pass
|
|
196
|
+
{
|
|
197
|
+
vertex_shader = VSDefault(vert_in);
|
|
198
|
+
pixel_shader = PSDrawSrgbDecompress(vert_in);
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
technique DrawSrgbDecompressMultiply
|
|
203
|
+
{
|
|
204
|
+
pass
|
|
205
|
+
{
|
|
206
|
+
vertex_shader = VSDefault(vert_in);
|
|
207
|
+
pixel_shader = PSDrawSrgbDecompressMultiply(vert_in);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
technique DrawMultiply
|
|
212
|
+
{
|
|
213
|
+
pass
|
|
214
|
+
{
|
|
215
|
+
vertex_shader = VSDefault(vert_in);
|
|
216
|
+
pixel_shader = PSDrawMultiply(vert_in);
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
technique DrawTonemap
|
|
221
|
+
{
|
|
222
|
+
pass
|
|
223
|
+
{
|
|
224
|
+
vertex_shader = VSDefault(vert_in);
|
|
225
|
+
pixel_shader = PSDrawTonemap(vert_in);
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
technique DrawMultiplyTonemap
|
|
230
|
+
{
|
|
231
|
+
pass
|
|
232
|
+
{
|
|
233
|
+
vertex_shader = VSDefault(vert_in);
|
|
234
|
+
pixel_shader = PSDrawMultiplyTonemap(vert_in);
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
technique DrawPQ
|
|
239
|
+
{
|
|
240
|
+
pass
|
|
241
|
+
{
|
|
242
|
+
vertex_shader = VSDefault(vert_in);
|
|
243
|
+
pixel_shader = PSDrawPQ(vert_in);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
technique DrawTonemapPQ
|
|
248
|
+
{
|
|
249
|
+
pass
|
|
250
|
+
{
|
|
251
|
+
vertex_shader = VSDefault(vert_in);
|
|
252
|
+
pixel_shader = PSDrawTonemapPQ(vert_in);
|
|
253
|
+
}
|
|
254
|
+
}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
#include "color.effect"
|
|
2
|
+
|
|
3
|
+
uniform float4x4 ViewProj;
|
|
4
|
+
uniform texture_rect image;
|
|
5
|
+
|
|
6
|
+
sampler_state def_sampler {
|
|
7
|
+
Filter = Linear;
|
|
8
|
+
AddressU = Clamp;
|
|
9
|
+
AddressV = Clamp;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
struct VertInOut {
|
|
13
|
+
float4 pos : POSITION;
|
|
14
|
+
float2 uv : TEXCOORD0;
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
VertInOut VSDefault(VertInOut vert_in)
|
|
18
|
+
{
|
|
19
|
+
VertInOut vert_out;
|
|
20
|
+
vert_out.pos = mul(float4(vert_in.pos.xyz, 1.0), ViewProj);
|
|
21
|
+
vert_out.uv = vert_in.uv;
|
|
22
|
+
return vert_out;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
float4 PSDrawBare(VertInOut vert_in) : TARGET
|
|
26
|
+
{
|
|
27
|
+
return image.Sample(def_sampler, vert_in.uv);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
float4 PSDrawD65P3(VertInOut vert_in) : TARGET
|
|
31
|
+
{
|
|
32
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
33
|
+
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
|
34
|
+
rgba.rgb = d65p3_to_rec709(rgba.rgb);
|
|
35
|
+
return rgba;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
float4 PSDrawOpaque(VertInOut vert_in) : TARGET
|
|
39
|
+
{
|
|
40
|
+
return float4(image.Sample(def_sampler, vert_in.uv).rgb, 1.0);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
float4 PSDrawSrgbDecompress(VertInOut vert_in) : TARGET
|
|
44
|
+
{
|
|
45
|
+
float4 rgba = image.Sample(def_sampler, vert_in.uv);
|
|
46
|
+
rgba.rgb = srgb_nonlinear_to_linear(rgba.rgb);
|
|
47
|
+
return rgba;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
technique Draw
|
|
51
|
+
{
|
|
52
|
+
pass
|
|
53
|
+
{
|
|
54
|
+
vertex_shader = VSDefault(vert_in);
|
|
55
|
+
pixel_shader = PSDrawBare(vert_in);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
technique DrawD65P3
|
|
60
|
+
{
|
|
61
|
+
pass
|
|
62
|
+
{
|
|
63
|
+
vertex_shader = VSDefault(vert_in);
|
|
64
|
+
pixel_shader = PSDrawD65P3(vert_in);
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
technique DrawOpaque
|
|
69
|
+
{
|
|
70
|
+
pass
|
|
71
|
+
{
|
|
72
|
+
vertex_shader = VSDefault(vert_in);
|
|
73
|
+
pixel_shader = PSDrawOpaque(vert_in);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
technique DrawSrgbDecompress
|
|
78
|
+
{
|
|
79
|
+
pass
|
|
80
|
+
{
|
|
81
|
+
vertex_shader = VSDefault(vert_in);
|
|
82
|
+
pixel_shader = PSDrawSrgbDecompress(vert_in);
|
|
83
|
+
}
|
|
84
|
+
}
|