format_conversion.effect 28 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178
  1. /******************************************************************************
  2. Copyright (C) 2014 by Hugh Bailey <[email protected]>
  3. This program is free software: you can redistribute it and/or modify
  4. it under the terms of the GNU General Public License as published by
  5. the Free Software Foundation, either version 2 of the License, or
  6. (at your option) any later version.
  7. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. ******************************************************************************/
  14. #include "color.effect"
  15. uniform float width;
  16. uniform float height;
  17. uniform float width_i;
  18. uniform float height_i;
  19. uniform float width_d2;
  20. uniform float height_d2;
  21. uniform float width_x2_i;
  22. uniform float maximum_over_sdr_white_nits;
  23. uniform float sdr_white_nits_over_maximum;
  24. uniform float hlg_exponent;
  25. uniform float hdr_lw;
  26. uniform float hdr_lmax;
  27. uniform float4 color_vec0;
  28. uniform float4 color_vec1;
  29. uniform float4 color_vec2;
  30. uniform float3 color_range_min = {0.0, 0.0, 0.0};
  31. uniform float3 color_range_max = {1.0, 1.0, 1.0};
  32. uniform texture2d image;
  33. uniform texture2d image1;
  34. uniform texture2d image2;
  35. uniform texture2d image3;
  36. sampler_state def_sampler {
  37. Filter = Linear;
  38. AddressU = Clamp;
  39. AddressV = Clamp;
  40. };
  41. struct FragPos {
  42. float4 pos : POSITION;
  43. };
  44. struct VertTexPos {
  45. float2 uv : TEXCOORD0;
  46. float4 pos : POSITION;
  47. };
  48. struct VertPosWide {
  49. float3 pos_wide : TEXCOORD0;
  50. float4 pos : POSITION;
  51. };
  52. struct VertTexPosWide {
  53. float3 uuv : TEXCOORD0;
  54. float4 pos : POSITION;
  55. };
  56. struct VertTexPosWideWide {
  57. float4 uuvv : TEXCOORD0;
  58. float4 pos : POSITION;
  59. };
  60. struct FragTex {
  61. float2 uv : TEXCOORD0;
  62. };
  63. struct FragPosWide {
  64. float3 pos_wide : TEXCOORD0;
  65. };
  66. struct FragTexWide {
  67. float3 uuv : TEXCOORD0;
  68. };
  69. struct FragTexWideWide {
  70. float4 uuvv : TEXCOORD0;
  71. };
  72. FragPos VSPos(uint id : VERTEXID)
  73. {
  74. float idHigh = float(id >> 1);
  75. float idLow = float(id & uint(1));
  76. float x = idHigh * 4.0 - 1.0;
  77. float y = idLow * 4.0 - 1.0;
  78. FragPos vert_out;
  79. vert_out.pos = float4(x, y, 0.0, 1.0);
  80. return vert_out;
  81. }
  82. VertTexPosWide VSTexPos_Left(uint id : VERTEXID)
  83. {
  84. float idHigh = float(id >> 1);
  85. float idLow = float(id & uint(1));
  86. float x = idHigh * 4.0 - 1.0;
  87. float y = idLow * 4.0 - 1.0;
  88. float u_right = idHigh * 2.0;
  89. float u_left = u_right - width_i;
  90. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  91. VertTexPosWide vert_out;
  92. vert_out.uuv = float3(u_left, u_right, v);
  93. vert_out.pos = float4(x, y, 0.0, 1.0);
  94. return vert_out;
  95. }
  96. VertTexPosWideWide VSTexPos_TopLeft(uint id : VERTEXID)
  97. {
  98. float idHigh = float(id >> 1);
  99. float idLow = float(id & uint(1));
  100. float x = idHigh * 4.0 - 1.0;
  101. float y = idLow * 4.0 - 1.0;
  102. float u_right = idHigh * 2.0;
  103. float u_left = u_right - width_i;
  104. float v_bottom;
  105. float v_top;
  106. if (obs_glsl_compile) {
  107. v_bottom = idLow * 2.0;
  108. v_top = v_bottom + height_i;
  109. } else {
  110. v_bottom = 1.0 - idLow * 2.0;
  111. v_top = v_bottom - height_i;
  112. }
  113. VertTexPosWideWide vert_out;
  114. vert_out.uuvv = float4(u_left, u_right, v_top, v_bottom);
  115. vert_out.pos = float4(x, y, 0.0, 1.0);
  116. return vert_out;
  117. }
  118. VertTexPos VSTexPosHalf_Reverse(uint id : VERTEXID)
  119. {
  120. float idHigh = float(id >> 1);
  121. float idLow = float(id & uint(1));
  122. float x = idHigh * 4.0 - 1.0;
  123. float y = idLow * 4.0 - 1.0;
  124. float u = idHigh * 2.0;
  125. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  126. VertTexPos vert_out;
  127. vert_out.uv = float2(width_d2 * u, height * v);
  128. vert_out.pos = float4(x, y, 0.0, 1.0);
  129. return vert_out;
  130. }
  131. VertTexPos VSTexPosHalfHalf_Reverse(uint id : VERTEXID)
  132. {
  133. float idHigh = float(id >> 1);
  134. float idLow = float(id & uint(1));
  135. float x = idHigh * 4.0 - 1.0;
  136. float y = idLow * 4.0 - 1.0;
  137. float u = idHigh * 2.0;
  138. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  139. VertTexPos vert_out;
  140. vert_out.uv = float2(width_d2 * u, height_d2 * v);
  141. vert_out.pos = float4(x, y, 0.0, 1.0);
  142. return vert_out;
  143. }
  144. VertPosWide VSPosWide_Reverse(uint id : VERTEXID)
  145. {
  146. float idHigh = float(id >> 1);
  147. float idLow = float(id & uint(1));
  148. float x = idHigh * 4.0 - 1.0;
  149. float y = idLow * 4.0 - 1.0;
  150. float u = idHigh * 2.0;
  151. float v = obs_glsl_compile ? (idLow * 2.0) : (1.0 - idLow * 2.0);
  152. VertPosWide vert_out;
  153. vert_out.pos_wide = float3(float2(width, width_d2) * u, height * v);
  154. vert_out.pos = float4(x, y, 0.0, 1.0);
  155. return vert_out;
  156. }
  157. float PS_Y(FragPos frag_in) : TARGET
  158. {
  159. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  160. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  161. return y;
  162. }
  163. float PS_P010_PQ_Y_709_2020(FragPos frag_in) : TARGET
  164. {
  165. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  166. rgb = rec709_to_rec2020(rgb);
  167. rgb = linear_to_st2084(rgb);
  168. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  169. y = floor(saturate(y) * 1023. + 0.5) * (64. / 65535.);
  170. return y;
  171. }
  172. float PS_P010_HLG_Y_709_2020(FragPos frag_in) : TARGET
  173. {
  174. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  175. rgb = rec709_to_rec2020(rgb);
  176. rgb = linear_to_hlg(rgb, hdr_lw);
  177. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  178. y = floor(saturate(y) * 1023. + 0.5) * (64. / 65535.);
  179. return y;
  180. }
  181. float PS_P010_SRGB_Y(FragPos frag_in) : TARGET
  182. {
  183. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  184. rgb = srgb_linear_to_nonlinear(rgb);
  185. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  186. y = floor(saturate(y) * 1023. + 0.5) * (64. / 65535.);
  187. return y;
  188. }
  189. float PS_I010_PQ_Y_709_2020(FragPos frag_in) : TARGET
  190. {
  191. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  192. rgb = rec709_to_rec2020(rgb);
  193. rgb = linear_to_st2084(rgb);
  194. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  195. return y * (1023. / 65535.);
  196. }
  197. float PS_I010_HLG_Y_709_2020(FragPos frag_in) : TARGET
  198. {
  199. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb * sdr_white_nits_over_maximum;
  200. rgb = rec709_to_rec2020(rgb);
  201. rgb = linear_to_hlg(rgb, hdr_lw);
  202. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  203. return y * (1023. / 65535.);
  204. }
  205. float PS_I010_SRGB_Y(FragPos frag_in) : TARGET
  206. {
  207. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  208. rgb = srgb_linear_to_nonlinear(rgb);
  209. float y = dot(color_vec0.xyz, rgb) + color_vec0.w;
  210. return y * (1023. / 65535.);
  211. }
  212. float2 PS_UV_Wide(FragTexWide frag_in) : TARGET
  213. {
  214. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  215. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  216. float3 rgb = (rgb_left + rgb_right) * 0.5;
  217. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  218. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  219. return float2(u, v);
  220. }
  221. float2 PS_P010_PQ_UV_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  222. {
  223. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  224. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  225. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  226. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  227. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  228. rgb = rec709_to_rec2020(rgb);
  229. rgb = linear_to_st2084(rgb);
  230. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  231. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  232. float2 uv = float2(u, v);
  233. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  234. return uv;
  235. }
  236. float2 PS_P010_HLG_UV_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  237. {
  238. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  239. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  240. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  241. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  242. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  243. rgb = rec709_to_rec2020(rgb);
  244. rgb = linear_to_hlg(rgb, hdr_lw);
  245. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  246. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  247. float2 uv = float2(u, v);
  248. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  249. return uv;
  250. }
  251. float2 PS_P010_SRGB_UV_Wide(FragTexWide frag_in) : TARGET
  252. {
  253. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  254. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  255. float3 rgb = (rgb_left + rgb_right) * 0.5;
  256. rgb = srgb_linear_to_nonlinear(rgb);
  257. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  258. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  259. float2 uv = float2(u, v);
  260. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  261. return uv;
  262. }
  263. float PS_U(FragPos frag_in) : TARGET
  264. {
  265. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  266. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  267. return u;
  268. }
  269. float PS_V(FragPos frag_in) : TARGET
  270. {
  271. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  272. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  273. return v;
  274. }
  275. float PS_U_Wide(FragTexWide frag_in) : TARGET
  276. {
  277. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  278. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  279. float3 rgb = (rgb_left + rgb_right) * 0.5;
  280. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  281. return u;
  282. }
  283. float PS_V_Wide(FragTexWide frag_in) : TARGET
  284. {
  285. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  286. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  287. float3 rgb = (rgb_left + rgb_right) * 0.5;
  288. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  289. return v;
  290. }
  291. float PS_I010_PQ_U_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  292. {
  293. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  294. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  295. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  296. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  297. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  298. rgb = rec709_to_rec2020(rgb);
  299. rgb = linear_to_st2084(rgb);
  300. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  301. return u * (1023. / 65535.);
  302. }
  303. float PS_I010_HLG_U_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  304. {
  305. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  306. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  307. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  308. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  309. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  310. rgb = rec709_to_rec2020(rgb);
  311. rgb = linear_to_hlg(rgb, hdr_lw);
  312. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  313. return u * (1023. / 65535.);
  314. }
  315. float PS_I010_SRGB_U_Wide(FragTexWide frag_in) : TARGET
  316. {
  317. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  318. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  319. float3 rgb = (rgb_left + rgb_right) * 0.5;
  320. rgb = srgb_linear_to_nonlinear(rgb);
  321. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  322. return u * (1023. / 65535.);
  323. }
  324. float PS_I010_PQ_V_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  325. {
  326. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  327. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  328. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  329. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  330. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  331. rgb = rec709_to_rec2020(rgb);
  332. rgb = linear_to_st2084(rgb);
  333. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  334. return v * (1023. / 65535.);
  335. }
  336. float PS_I010_HLG_V_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  337. {
  338. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  339. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  340. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  341. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  342. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  343. rgb = rec709_to_rec2020(rgb);
  344. rgb = linear_to_hlg(rgb, hdr_lw);
  345. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  346. return v * (1023. / 65535.);
  347. }
  348. float PS_I010_SRGB_V_Wide(FragTexWide frag_in) : TARGET
  349. {
  350. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  351. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  352. float3 rgb = (rgb_left + rgb_right) * 0.5;
  353. rgb = srgb_linear_to_nonlinear(rgb);
  354. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  355. return v * (1023. / 65535.);
  356. }
  357. float3 YUV_to_RGB(float3 yuv)
  358. {
  359. yuv = clamp(yuv, color_range_min, color_range_max);
  360. float r = dot(color_vec0.xyz, yuv) + color_vec0.w;
  361. float g = dot(color_vec1.xyz, yuv) + color_vec1.w;
  362. float b = dot(color_vec2.xyz, yuv) + color_vec2.w;
  363. return float3(r, g, b);
  364. }
  365. float3 PSUYVY_Reverse(FragTex frag_in) : TARGET
  366. {
  367. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  368. float2 y01 = y2uv.yw;
  369. float2 cbcr = y2uv.zx;
  370. float leftover = frac(frag_in.uv.x);
  371. float y = (leftover < 0.5) ? y01.x : y01.y;
  372. float3 yuv = float3(y, cbcr);
  373. float3 rgb = YUV_to_RGB(yuv);
  374. return rgb;
  375. }
  376. float3 PSYUY2_Reverse(FragTex frag_in) : TARGET
  377. {
  378. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  379. float2 y01 = y2uv.zx;
  380. float2 cbcr = y2uv.yw;
  381. float leftover = frac(frag_in.uv.x);
  382. float y = (leftover < 0.5) ? y01.x : y01.y;
  383. float3 yuv = float3(y, cbcr);
  384. float3 rgb = YUV_to_RGB(yuv);
  385. return rgb;
  386. }
  387. float3 PSYVYU_Reverse(FragTex frag_in) : TARGET
  388. {
  389. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  390. float2 y01 = y2uv.zx;
  391. float2 cbcr = y2uv.wy;
  392. float leftover = frac(frag_in.uv.x);
  393. float y = (leftover < 0.5) ? y01.x : y01.y;
  394. float3 yuv = float3(y, cbcr);
  395. float3 rgb = YUV_to_RGB(yuv);
  396. return rgb;
  397. }
  398. float3 PSPlanar420_Reverse(VertTexPos frag_in) : TARGET
  399. {
  400. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  401. int3 xy0_chroma = int3(frag_in.uv, 0);
  402. float cb = image1.Load(xy0_chroma).x;
  403. float cr = image2.Load(xy0_chroma).x;
  404. float3 yuv = float3(y, cb, cr);
  405. float3 rgb = YUV_to_RGB(yuv);
  406. return rgb;
  407. }
  408. float4 PSPlanar420_PQ_Reverse(VertTexPos frag_in) : TARGET
  409. {
  410. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  411. int3 xy0_chroma = int3(frag_in.uv, 0);
  412. float cb = image1.Load(xy0_chroma).x;
  413. float cr = image2.Load(xy0_chroma).x;
  414. float3 yuv = float3(y, cb, cr);
  415. float3 pq = YUV_to_RGB(yuv);
  416. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  417. float3 rgb = rec2020_to_rec709(hdr2020);
  418. return float4(rgb, 1.);
  419. }
  420. float4 PSPlanar420_HLG_Reverse(VertTexPos frag_in) : TARGET
  421. {
  422. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  423. int3 xy0_chroma = int3(frag_in.uv, 0);
  424. float cb = image1.Load(xy0_chroma).x;
  425. float cr = image2.Load(xy0_chroma).x;
  426. float3 yuv = float3(y, cb, cr);
  427. float3 hlg = YUV_to_RGB(yuv);
  428. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  429. float3 rgb = rec2020_to_rec709(hdr2020);
  430. return float4(rgb, 1.);
  431. }
  432. float4 PSPlanar420A_Reverse(VertTexPos frag_in) : TARGET
  433. {
  434. int3 xy0_luma = int3(frag_in.pos.xy, 0);
  435. float y = image.Load(xy0_luma).x;
  436. int3 xy0_chroma = int3(frag_in.uv, 0);
  437. float cb = image1.Load(xy0_chroma).x;
  438. float cr = image2.Load(xy0_chroma).x;
  439. float alpha = image3.Load(xy0_luma).x;
  440. float3 yuv = float3(y, cb, cr);
  441. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  442. return rgba;
  443. }
  444. float3 PSPlanar422_Reverse(FragPosWide frag_in) : TARGET
  445. {
  446. float y = image.Load(int3(frag_in.pos_wide.xz, 0)).x;
  447. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  448. float cb = image1.Load(xy0_chroma).x;
  449. float cr = image2.Load(xy0_chroma).x;
  450. float3 yuv = float3(y, cb, cr);
  451. float3 rgb = YUV_to_RGB(yuv);
  452. return rgb;
  453. }
  454. float4 PSPlanar422_10LE_Reverse(FragPosWide frag_in) : TARGET
  455. {
  456. float y = image.Load(int3(frag_in.pos_wide.xz, 0)).x;
  457. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  458. float cb = image1.Load(xy0_chroma).x;
  459. float cr = image2.Load(xy0_chroma).x;
  460. float3 yuv = float3(y, cb, cr);
  461. yuv *= 65535. / 1023.;
  462. float3 rgb = YUV_to_RGB(yuv);
  463. rgb = srgb_nonlinear_to_linear(rgb);
  464. return float4(rgb, 1.);
  465. }
  466. float4 PSPlanar422A_Reverse(FragPosWide frag_in) : TARGET
  467. {
  468. int3 xy0_luma = int3(frag_in.pos_wide.xz, 0);
  469. float y = image.Load(xy0_luma).x;
  470. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  471. float cb = image1.Load(xy0_chroma).x;
  472. float cr = image2.Load(xy0_chroma).x;
  473. float alpha = image3.Load(xy0_luma).x;
  474. float3 yuv = float3(y, cb, cr);
  475. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  476. return rgba;
  477. }
  478. float3 PSPlanar444_Reverse(FragPos frag_in) : TARGET
  479. {
  480. int3 xy0 = int3(frag_in.pos.xy, 0);
  481. float y = image.Load(xy0).x;
  482. float cb = image1.Load(xy0).x;
  483. float cr = image2.Load(xy0).x;
  484. float3 yuv = float3(y, cb, cr);
  485. float3 rgb = YUV_to_RGB(yuv);
  486. return rgb;
  487. }
  488. float4 PSPlanar444_12LE_Reverse(FragPos frag_in) : TARGET
  489. {
  490. int3 xy0 = int3(frag_in.pos.xy, 0);
  491. float y = image.Load(xy0).x;
  492. float cb = image1.Load(xy0).x;
  493. float cr = image2.Load(xy0).x;
  494. float3 yuv = float3(y, cb, cr);
  495. yuv *= 65535. / 4095.;
  496. float3 rgb = YUV_to_RGB(yuv);
  497. rgb = srgb_nonlinear_to_linear(rgb);
  498. return float4(rgb, 1.);
  499. }
  500. float4 PSPlanar444A_Reverse(FragPos frag_in) : TARGET
  501. {
  502. int3 xy0 = int3(frag_in.pos.xy, 0);
  503. float y = image.Load(xy0).x;
  504. float cb = image1.Load(xy0).x;
  505. float cr = image2.Load(xy0).x;
  506. float alpha = image3.Load(xy0).x;
  507. float3 yuv = float3(y, cb, cr);
  508. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  509. return rgba;
  510. }
  511. float4 PSPlanar444A_12LE_Reverse(FragPos frag_in) : TARGET
  512. {
  513. int3 xy0 = int3(frag_in.pos.xy, 0);
  514. float y = image.Load(xy0).x;
  515. float cb = image1.Load(xy0).x;
  516. float cr = image2.Load(xy0).x;
  517. float alpha = image3.Load(xy0).x * 16.;
  518. float3 yuv = float3(y, cb, cr);
  519. yuv *= 65535. / 4095.;
  520. float3 rgb = YUV_to_RGB(yuv);
  521. rgb = srgb_nonlinear_to_linear(rgb);
  522. return float4(rgb, alpha);
  523. }
  524. float4 PSAYUV_Reverse(FragPos frag_in) : TARGET
  525. {
  526. float4 yuva = image.Load(int3(frag_in.pos.xy, 0));
  527. float4 rgba = float4(YUV_to_RGB(yuva.xyz), yuva.a);
  528. return rgba;
  529. }
  530. float3 PSNV12_Reverse(VertTexPos frag_in) : TARGET
  531. {
  532. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  533. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  534. float3 yuv = float3(y, cbcr);
  535. float3 rgb = YUV_to_RGB(yuv);
  536. return rgb;
  537. }
  538. float4 PSI010_SRGB_Reverse(VertTexPos frag_in) : TARGET
  539. {
  540. float ratio = 65535. / 1023.;
  541. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  542. int3 xy0_chroma = int3(frag_in.uv, 0);
  543. float cb = image1.Load(xy0_chroma).x * ratio;
  544. float cr = image2.Load(xy0_chroma).x * ratio;
  545. float3 yuv = float3(y, cb, cr);
  546. float3 rgb = YUV_to_RGB(yuv);
  547. rgb = srgb_nonlinear_to_linear(rgb);
  548. return float4(rgb, 1.);
  549. }
  550. float4 PSI010_PQ_2020_709_Reverse(VertTexPos frag_in) : TARGET
  551. {
  552. float ratio = 65535. / 1023.;
  553. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  554. int3 xy0_chroma = int3(frag_in.uv, 0);
  555. float cb = image1.Load(xy0_chroma).x * ratio;
  556. float cr = image2.Load(xy0_chroma).x * ratio;
  557. float3 yuv = float3(y, cb, cr);
  558. float3 pq = YUV_to_RGB(yuv);
  559. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  560. float3 rgb = rec2020_to_rec709(hdr2020);
  561. return float4(rgb, 1.);
  562. }
  563. float4 PSI010_HLG_2020_709_Reverse(VertTexPos frag_in) : TARGET
  564. {
  565. float ratio = 65535. / 1023.;
  566. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  567. int3 xy0_chroma = int3(frag_in.uv, 0);
  568. float cb = image1.Load(xy0_chroma).x * ratio;
  569. float cr = image2.Load(xy0_chroma).x * ratio;
  570. float3 yuv = float3(y, cb, cr);
  571. float3 hlg = YUV_to_RGB(yuv);
  572. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  573. float3 rgb = rec2020_to_rec709(hdr2020);
  574. return float4(rgb, 1.);
  575. }
  576. float4 PSP010_SRGB_Reverse(VertTexPos frag_in) : TARGET
  577. {
  578. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  579. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  580. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  581. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  582. float3 yuv = yuv_1023 / 1023.;
  583. float3 rgb = YUV_to_RGB(yuv);
  584. rgb = srgb_nonlinear_to_linear(rgb);
  585. return float4(rgb, 1.);
  586. }
  587. float4 PSP010_PQ_2020_709_Reverse(VertTexPos frag_in) : TARGET
  588. {
  589. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  590. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  591. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  592. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  593. float3 yuv = yuv_1023 / 1023.;
  594. float3 pq = YUV_to_RGB(yuv);
  595. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  596. float3 rgb = rec2020_to_rec709(hdr2020);
  597. return float4(rgb, 1.);
  598. }
  599. float4 PSP010_HLG_2020_709_Reverse(VertTexPos frag_in) : TARGET
  600. {
  601. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  602. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  603. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  604. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  605. float3 yuv = yuv_1023 / 1023.;
  606. float3 hlg = YUV_to_RGB(yuv);
  607. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  608. float3 rgb = rec2020_to_rec709(hdr2020);
  609. return float4(rgb, 1.);
  610. }
  611. float3 PSY800_Limited(FragPos frag_in) : TARGET
  612. {
  613. float limited = image.Load(int3(frag_in.pos.xy, 0)).x;
  614. float full = (255.0 / 219.0) * limited - (16.0 / 219.0);
  615. return float3(full, full, full);
  616. }
  617. float3 PSY800_Full(FragPos frag_in) : TARGET
  618. {
  619. float3 full = image.Load(int3(frag_in.pos.xy, 0)).xxx;
  620. return full;
  621. }
  622. float4 PSRGB_Limited(FragPos frag_in) : TARGET
  623. {
  624. float4 rgba = image.Load(int3(frag_in.pos.xy, 0));
  625. rgba.rgb = (255.0 / 219.0) * rgba.rgb - (16.0 / 219.0);
  626. return rgba;
  627. }
  628. float3 PSBGR3_Limited(FragPos frag_in) : TARGET
  629. {
  630. float x = frag_in.pos.x * 3.0;
  631. float y = frag_in.pos.y;
  632. float b = image.Load(int3(x - 1.0, y, 0)).x;
  633. float g = image.Load(int3(x, y, 0)).x;
  634. float r = image.Load(int3(x + 1.0, y, 0)).x;
  635. float3 rgb = float3(r, g, b);
  636. rgb = (255.0 / 219.0) * rgb - (16.0 / 219.0);
  637. return rgb;
  638. }
  639. float3 PSBGR3_Full(FragPos frag_in) : TARGET
  640. {
  641. float x = frag_in.pos.x * 3.0;
  642. float y = frag_in.pos.y;
  643. float b = image.Load(int3(x - 1.0, y, 0)).x;
  644. float g = image.Load(int3(x, y, 0)).x;
  645. float r = image.Load(int3(x + 1.0, y, 0)).x;
  646. float3 rgb = float3(r, g, b);
  647. return rgb;
  648. }
  649. technique Planar_Y
  650. {
  651. pass
  652. {
  653. vertex_shader = VSPos(id);
  654. pixel_shader = PS_Y(frag_in);
  655. }
  656. }
  657. technique Planar_U
  658. {
  659. pass
  660. {
  661. vertex_shader = VSPos(id);
  662. pixel_shader = PS_U(frag_in);
  663. }
  664. }
  665. technique Planar_V
  666. {
  667. pass
  668. {
  669. vertex_shader = VSPos(id);
  670. pixel_shader = PS_V(frag_in);
  671. }
  672. }
  673. technique Planar_U_Left
  674. {
  675. pass
  676. {
  677. vertex_shader = VSTexPos_Left(id);
  678. pixel_shader = PS_U_Wide(frag_in);
  679. }
  680. }
  681. technique Planar_V_Left
  682. {
  683. pass
  684. {
  685. vertex_shader = VSTexPos_Left(id);
  686. pixel_shader = PS_V_Wide(frag_in);
  687. }
  688. }
  689. technique NV12_Y
  690. {
  691. pass
  692. {
  693. vertex_shader = VSPos(id);
  694. pixel_shader = PS_Y(frag_in);
  695. }
  696. }
  697. technique NV12_UV
  698. {
  699. pass
  700. {
  701. vertex_shader = VSTexPos_Left(id);
  702. pixel_shader = PS_UV_Wide(frag_in);
  703. }
  704. }
  705. technique I010_PQ_Y
  706. {
  707. pass
  708. {
  709. vertex_shader = VSPos(id);
  710. pixel_shader = PS_I010_PQ_Y_709_2020(frag_in);
  711. }
  712. }
  713. technique I010_HLG_Y
  714. {
  715. pass
  716. {
  717. vertex_shader = VSPos(id);
  718. pixel_shader = PS_I010_HLG_Y_709_2020(frag_in);
  719. }
  720. }
  721. technique I010_SRGB_Y
  722. {
  723. pass
  724. {
  725. vertex_shader = VSPos(id);
  726. pixel_shader = PS_I010_SRGB_Y(frag_in);
  727. }
  728. }
  729. technique I010_PQ_U
  730. {
  731. pass
  732. {
  733. vertex_shader = VSTexPos_TopLeft(id);
  734. pixel_shader = PS_I010_PQ_U_709_2020_WideWide(frag_in);
  735. }
  736. }
  737. technique I010_HLG_U
  738. {
  739. pass
  740. {
  741. vertex_shader = VSTexPos_TopLeft(id);
  742. pixel_shader = PS_I010_HLG_U_709_2020_WideWide(frag_in);
  743. }
  744. }
  745. technique I010_SRGB_U
  746. {
  747. pass
  748. {
  749. vertex_shader = VSTexPos_Left(id);
  750. pixel_shader = PS_I010_SRGB_U_Wide(frag_in);
  751. }
  752. }
  753. technique I010_PQ_V
  754. {
  755. pass
  756. {
  757. vertex_shader = VSTexPos_TopLeft(id);
  758. pixel_shader = PS_I010_PQ_V_709_2020_WideWide(frag_in);
  759. }
  760. }
  761. technique I010_HLG_V
  762. {
  763. pass
  764. {
  765. vertex_shader = VSTexPos_TopLeft(id);
  766. pixel_shader = PS_I010_HLG_V_709_2020_WideWide(frag_in);
  767. }
  768. }
  769. technique I010_SRGB_V
  770. {
  771. pass
  772. {
  773. vertex_shader = VSTexPos_Left(id);
  774. pixel_shader = PS_I010_SRGB_V_Wide(frag_in);
  775. }
  776. }
  777. technique P010_PQ_Y
  778. {
  779. pass
  780. {
  781. vertex_shader = VSPos(id);
  782. pixel_shader = PS_P010_PQ_Y_709_2020(frag_in);
  783. }
  784. }
  785. technique P010_HLG_Y
  786. {
  787. pass
  788. {
  789. vertex_shader = VSPos(id);
  790. pixel_shader = PS_P010_HLG_Y_709_2020(frag_in);
  791. }
  792. }
  793. technique P010_SRGB_Y
  794. {
  795. pass
  796. {
  797. vertex_shader = VSPos(id);
  798. pixel_shader = PS_P010_SRGB_Y(frag_in);
  799. }
  800. }
  801. technique P010_PQ_UV
  802. {
  803. pass
  804. {
  805. vertex_shader = VSTexPos_TopLeft(id);
  806. pixel_shader = PS_P010_PQ_UV_709_2020_WideWide(frag_in);
  807. }
  808. }
  809. technique P010_HLG_UV
  810. {
  811. pass
  812. {
  813. vertex_shader = VSTexPos_TopLeft(id);
  814. pixel_shader = PS_P010_HLG_UV_709_2020_WideWide(frag_in);
  815. }
  816. }
  817. technique P010_SRGB_UV
  818. {
  819. pass
  820. {
  821. vertex_shader = VSTexPos_Left(id);
  822. pixel_shader = PS_P010_SRGB_UV_Wide(frag_in);
  823. }
  824. }
  825. technique UYVY_Reverse
  826. {
  827. pass
  828. {
  829. vertex_shader = VSTexPosHalf_Reverse(id);
  830. pixel_shader = PSUYVY_Reverse(frag_in);
  831. }
  832. }
  833. technique YUY2_Reverse
  834. {
  835. pass
  836. {
  837. vertex_shader = VSTexPosHalf_Reverse(id);
  838. pixel_shader = PSYUY2_Reverse(frag_in);
  839. }
  840. }
  841. technique YVYU_Reverse
  842. {
  843. pass
  844. {
  845. vertex_shader = VSTexPosHalf_Reverse(id);
  846. pixel_shader = PSYVYU_Reverse(frag_in);
  847. }
  848. }
  849. technique I420_Reverse
  850. {
  851. pass
  852. {
  853. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  854. pixel_shader = PSPlanar420_Reverse(frag_in);
  855. }
  856. }
  857. technique I420_PQ_Reverse
  858. {
  859. pass
  860. {
  861. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  862. pixel_shader = PSPlanar420_PQ_Reverse(frag_in);
  863. }
  864. }
  865. technique I420_HLG_Reverse
  866. {
  867. pass
  868. {
  869. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  870. pixel_shader = PSPlanar420_HLG_Reverse(frag_in);
  871. }
  872. }
  873. technique I40A_Reverse
  874. {
  875. pass
  876. {
  877. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  878. pixel_shader = PSPlanar420A_Reverse(frag_in);
  879. }
  880. }
  881. technique I422_Reverse
  882. {
  883. pass
  884. {
  885. vertex_shader = VSPosWide_Reverse(id);
  886. pixel_shader = PSPlanar422_Reverse(frag_in);
  887. }
  888. }
  889. technique I210_Reverse
  890. {
  891. pass
  892. {
  893. vertex_shader = VSPosWide_Reverse(id);
  894. pixel_shader = PSPlanar422_10LE_Reverse(frag_in);
  895. }
  896. }
  897. technique I42A_Reverse
  898. {
  899. pass
  900. {
  901. vertex_shader = VSPosWide_Reverse(id);
  902. pixel_shader = PSPlanar422A_Reverse(frag_in);
  903. }
  904. }
  905. technique I444_Reverse
  906. {
  907. pass
  908. {
  909. vertex_shader = VSPos(id);
  910. pixel_shader = PSPlanar444_Reverse(frag_in);
  911. }
  912. }
  913. technique I412_Reverse
  914. {
  915. pass
  916. {
  917. vertex_shader = VSPos(id);
  918. pixel_shader = PSPlanar444_12LE_Reverse(frag_in);
  919. }
  920. }
  921. technique YUVA_Reverse
  922. {
  923. pass
  924. {
  925. vertex_shader = VSPos(id);
  926. pixel_shader = PSPlanar444A_Reverse(frag_in);
  927. }
  928. }
  929. technique YA2L_Reverse
  930. {
  931. pass
  932. {
  933. vertex_shader = VSPos(id);
  934. pixel_shader = PSPlanar444A_12LE_Reverse(frag_in);
  935. }
  936. }
  937. technique AYUV_Reverse
  938. {
  939. pass
  940. {
  941. vertex_shader = VSPos(id);
  942. pixel_shader = PSAYUV_Reverse(frag_in);
  943. }
  944. }
  945. technique NV12_Reverse
  946. {
  947. pass
  948. {
  949. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  950. pixel_shader = PSNV12_Reverse(frag_in);
  951. }
  952. }
  953. technique I010_SRGB_Reverse
  954. {
  955. pass
  956. {
  957. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  958. pixel_shader = PSI010_SRGB_Reverse(frag_in);
  959. }
  960. }
  961. technique I010_PQ_2020_709_Reverse
  962. {
  963. pass
  964. {
  965. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  966. pixel_shader = PSI010_PQ_2020_709_Reverse(frag_in);
  967. }
  968. }
  969. technique I010_HLG_2020_709_Reverse
  970. {
  971. pass
  972. {
  973. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  974. pixel_shader = PSI010_HLG_2020_709_Reverse(frag_in);
  975. }
  976. }
  977. technique P010_SRGB_Reverse
  978. {
  979. pass
  980. {
  981. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  982. pixel_shader = PSP010_SRGB_Reverse(frag_in);
  983. }
  984. }
  985. technique P010_PQ_2020_709_Reverse
  986. {
  987. pass
  988. {
  989. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  990. pixel_shader = PSP010_PQ_2020_709_Reverse(frag_in);
  991. }
  992. }
  993. technique P010_HLG_2020_709_Reverse
  994. {
  995. pass
  996. {
  997. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  998. pixel_shader = PSP010_HLG_2020_709_Reverse(frag_in);
  999. }
  1000. }
  1001. technique Y800_Limited
  1002. {
  1003. pass
  1004. {
  1005. vertex_shader = VSPos(id);
  1006. pixel_shader = PSY800_Limited(frag_in);
  1007. }
  1008. }
  1009. technique Y800_Full
  1010. {
  1011. pass
  1012. {
  1013. vertex_shader = VSPos(id);
  1014. pixel_shader = PSY800_Full(frag_in);
  1015. }
  1016. }
  1017. technique RGB_Limited
  1018. {
  1019. pass
  1020. {
  1021. vertex_shader = VSPos(id);
  1022. pixel_shader = PSRGB_Limited(frag_in);
  1023. }
  1024. }
  1025. technique BGR3_Limited
  1026. {
  1027. pass
  1028. {
  1029. vertex_shader = VSPos(id);
  1030. pixel_shader = PSBGR3_Limited(frag_in);
  1031. }
  1032. }
  1033. technique BGR3_Full
  1034. {
  1035. pass
  1036. {
  1037. vertex_shader = VSPos(id);
  1038. pixel_shader = PSBGR3_Full(frag_in);
  1039. }
  1040. }