format_conversion.effect 28 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162
  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_WideWide(FragTexWideWide frag_in) : TARGET
  252. {
  253. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  254. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  255. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  256. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  257. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * 0.25;
  258. rgb = srgb_linear_to_nonlinear(rgb);
  259. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  260. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  261. float2 uv = float2(u, v);
  262. uv = floor(saturate(uv) * 1023. + 0.5) * (64. / 65535.);
  263. return uv;
  264. }
  265. float PS_U(FragPos frag_in) : TARGET
  266. {
  267. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  268. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  269. return u;
  270. }
  271. float PS_V(FragPos frag_in) : TARGET
  272. {
  273. float3 rgb = image.Load(int3(frag_in.pos.xy, 0)).rgb;
  274. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  275. return v;
  276. }
  277. float PS_U_Wide(FragTexWide frag_in) : TARGET
  278. {
  279. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  280. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  281. float3 rgb = (rgb_left + rgb_right) * 0.5;
  282. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  283. return u;
  284. }
  285. float PS_V_Wide(FragTexWide frag_in) : TARGET
  286. {
  287. float3 rgb_left = image.Sample(def_sampler, frag_in.uuv.xz).rgb;
  288. float3 rgb_right = image.Sample(def_sampler, frag_in.uuv.yz).rgb;
  289. float3 rgb = (rgb_left + rgb_right) * 0.5;
  290. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  291. return v;
  292. }
  293. float PS_I010_PQ_U_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  294. {
  295. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  296. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  297. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  298. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  299. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  300. rgb = rec709_to_rec2020(rgb);
  301. rgb = linear_to_st2084(rgb);
  302. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  303. return u * (1023. / 65535.);
  304. }
  305. float PS_I010_HLG_U_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  306. {
  307. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  308. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  309. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  310. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  311. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  312. rgb = rec709_to_rec2020(rgb);
  313. rgb = linear_to_hlg(rgb, hdr_lw);
  314. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  315. return u * (1023. / 65535.);
  316. }
  317. float PS_I010_SRGB_U_WideWide(FragTexWideWide frag_in) : TARGET
  318. {
  319. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  320. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  321. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  322. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  323. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * 0.25;
  324. rgb = srgb_linear_to_nonlinear(rgb);
  325. float u = dot(color_vec1.xyz, rgb) + color_vec1.w;
  326. return u * (1023. / 65535.);
  327. }
  328. float PS_I010_PQ_V_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  329. {
  330. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  331. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  332. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  333. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  334. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  335. rgb = rec709_to_rec2020(rgb);
  336. rgb = linear_to_st2084(rgb);
  337. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  338. return v * (1023. / 65535.);
  339. }
  340. float PS_I010_HLG_V_709_2020_WideWide(FragTexWideWide frag_in) : TARGET
  341. {
  342. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  343. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  344. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  345. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  346. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * (0.25 * sdr_white_nits_over_maximum);
  347. rgb = rec709_to_rec2020(rgb);
  348. rgb = linear_to_hlg(rgb, hdr_lw);
  349. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  350. return v * (1023. / 65535.);
  351. }
  352. float PS_I010_SRGB_V_WideWide(FragTexWideWide frag_in) : TARGET
  353. {
  354. float3 rgb_topleft = image.Sample(def_sampler, frag_in.uuvv.xz).rgb;
  355. float3 rgb_topright = image.Sample(def_sampler, frag_in.uuvv.yz).rgb;
  356. float3 rgb_bottomleft = image.Sample(def_sampler, frag_in.uuvv.xw).rgb;
  357. float3 rgb_bottomright = image.Sample(def_sampler, frag_in.uuvv.yw).rgb;
  358. float3 rgb = (rgb_topleft + rgb_topright + rgb_bottomleft + rgb_bottomright) * 0.25;
  359. rgb = srgb_linear_to_nonlinear(rgb);
  360. float v = dot(color_vec2.xyz, rgb) + color_vec2.w;
  361. return v * (1023. / 65535.);
  362. }
  363. float3 YUV_to_RGB(float3 yuv)
  364. {
  365. yuv = clamp(yuv, color_range_min, color_range_max);
  366. float r = dot(color_vec0.xyz, yuv) + color_vec0.w;
  367. float g = dot(color_vec1.xyz, yuv) + color_vec1.w;
  368. float b = dot(color_vec2.xyz, yuv) + color_vec2.w;
  369. return float3(r, g, b);
  370. }
  371. float3 PSUYVY_Reverse(FragTex frag_in) : TARGET
  372. {
  373. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  374. float2 y01 = y2uv.yw;
  375. float2 cbcr = y2uv.zx;
  376. float leftover = frac(frag_in.uv.x);
  377. float y = (leftover < 0.5) ? y01.x : y01.y;
  378. float3 yuv = float3(y, cbcr);
  379. float3 rgb = YUV_to_RGB(yuv);
  380. return rgb;
  381. }
  382. float3 PSYUY2_Reverse(FragTex frag_in) : TARGET
  383. {
  384. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  385. float2 y01 = y2uv.zx;
  386. float2 cbcr = y2uv.yw;
  387. float leftover = frac(frag_in.uv.x);
  388. float y = (leftover < 0.5) ? y01.x : y01.y;
  389. float3 yuv = float3(y, cbcr);
  390. float3 rgb = YUV_to_RGB(yuv);
  391. return rgb;
  392. }
  393. float3 PSYVYU_Reverse(FragTex frag_in) : TARGET
  394. {
  395. float4 y2uv = image.Load(int3(frag_in.uv.xy, 0));
  396. float2 y01 = y2uv.zx;
  397. float2 cbcr = y2uv.wy;
  398. float leftover = frac(frag_in.uv.x);
  399. float y = (leftover < 0.5) ? y01.x : y01.y;
  400. float3 yuv = float3(y, cbcr);
  401. float3 rgb = YUV_to_RGB(yuv);
  402. return rgb;
  403. }
  404. float3 PSPlanar420_Reverse(VertTexPos frag_in) : TARGET
  405. {
  406. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  407. int3 xy0_chroma = int3(frag_in.uv, 0);
  408. float cb = image1.Load(xy0_chroma).x;
  409. float cr = image2.Load(xy0_chroma).x;
  410. float3 yuv = float3(y, cb, cr);
  411. float3 rgb = YUV_to_RGB(yuv);
  412. return rgb;
  413. }
  414. float4 PSPlanar420_PQ_Reverse(VertTexPos frag_in) : TARGET
  415. {
  416. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  417. int3 xy0_chroma = int3(frag_in.uv, 0);
  418. float cb = image1.Load(xy0_chroma).x;
  419. float cr = image2.Load(xy0_chroma).x;
  420. float3 yuv = float3(y, cb, cr);
  421. float3 pq = YUV_to_RGB(yuv);
  422. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  423. float3 rgb = rec2020_to_rec709(hdr2020);
  424. return float4(rgb, 1.);
  425. }
  426. float4 PSPlanar420A_Reverse(VertTexPos frag_in) : TARGET
  427. {
  428. int3 xy0_luma = int3(frag_in.pos.xy, 0);
  429. float y = image.Load(xy0_luma).x;
  430. int3 xy0_chroma = int3(frag_in.uv, 0);
  431. float cb = image1.Load(xy0_chroma).x;
  432. float cr = image2.Load(xy0_chroma).x;
  433. float alpha = image3.Load(xy0_luma).x;
  434. float3 yuv = float3(y, cb, cr);
  435. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  436. return rgba;
  437. }
  438. float3 PSPlanar422_Reverse(FragPosWide frag_in) : TARGET
  439. {
  440. float y = image.Load(int3(frag_in.pos_wide.xz, 0)).x;
  441. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  442. float cb = image1.Load(xy0_chroma).x;
  443. float cr = image2.Load(xy0_chroma).x;
  444. float3 yuv = float3(y, cb, cr);
  445. float3 rgb = YUV_to_RGB(yuv);
  446. return rgb;
  447. }
  448. float4 PSPlanar422_10LE_Reverse(FragPosWide frag_in) : TARGET
  449. {
  450. float y = image.Load(int3(frag_in.pos_wide.xz, 0)).x;
  451. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  452. float cb = image1.Load(xy0_chroma).x;
  453. float cr = image2.Load(xy0_chroma).x;
  454. float3 yuv = float3(y, cb, cr);
  455. yuv *= 65535. / 1023.;
  456. float3 rgb = YUV_to_RGB(yuv);
  457. rgb = srgb_nonlinear_to_linear(rgb);
  458. return float4(rgb, 1.);
  459. }
  460. float4 PSPlanar422A_Reverse(FragPosWide frag_in) : TARGET
  461. {
  462. int3 xy0_luma = int3(frag_in.pos_wide.xz, 0);
  463. float y = image.Load(xy0_luma).x;
  464. int3 xy0_chroma = int3(frag_in.pos_wide.yz, 0);
  465. float cb = image1.Load(xy0_chroma).x;
  466. float cr = image2.Load(xy0_chroma).x;
  467. float alpha = image3.Load(xy0_luma).x;
  468. float3 yuv = float3(y, cb, cr);
  469. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  470. return rgba;
  471. }
  472. float3 PSPlanar444_Reverse(FragPos frag_in) : TARGET
  473. {
  474. int3 xy0 = int3(frag_in.pos.xy, 0);
  475. float y = image.Load(xy0).x;
  476. float cb = image1.Load(xy0).x;
  477. float cr = image2.Load(xy0).x;
  478. float3 yuv = float3(y, cb, cr);
  479. float3 rgb = YUV_to_RGB(yuv);
  480. return rgb;
  481. }
  482. float4 PSPlanar444_12LE_Reverse(FragPos frag_in) : TARGET
  483. {
  484. int3 xy0 = int3(frag_in.pos.xy, 0);
  485. float y = image.Load(xy0).x;
  486. float cb = image1.Load(xy0).x;
  487. float cr = image2.Load(xy0).x;
  488. float3 yuv = float3(y, cb, cr);
  489. yuv *= 65535. / 4095.;
  490. float3 rgb = YUV_to_RGB(yuv);
  491. rgb = srgb_nonlinear_to_linear(rgb);
  492. return float4(rgb, 1.);
  493. }
  494. float4 PSPlanar444A_Reverse(FragPos frag_in) : TARGET
  495. {
  496. int3 xy0 = int3(frag_in.pos.xy, 0);
  497. float y = image.Load(xy0).x;
  498. float cb = image1.Load(xy0).x;
  499. float cr = image2.Load(xy0).x;
  500. float alpha = image3.Load(xy0).x;
  501. float3 yuv = float3(y, cb, cr);
  502. float4 rgba = float4(YUV_to_RGB(yuv), alpha);
  503. return rgba;
  504. }
  505. float4 PSPlanar444A_12LE_Reverse(FragPos frag_in) : TARGET
  506. {
  507. int3 xy0 = int3(frag_in.pos.xy, 0);
  508. float y = image.Load(xy0).x;
  509. float cb = image1.Load(xy0).x;
  510. float cr = image2.Load(xy0).x;
  511. float alpha = image3.Load(xy0).x * 16.;
  512. float3 yuv = float3(y, cb, cr);
  513. yuv *= 65535. / 4095.;
  514. float3 rgb = YUV_to_RGB(yuv);
  515. rgb = srgb_nonlinear_to_linear(rgb);
  516. return float4(rgb, alpha);
  517. }
  518. float4 PSAYUV_Reverse(FragPos frag_in) : TARGET
  519. {
  520. float4 yuva = image.Load(int3(frag_in.pos.xy, 0));
  521. float4 rgba = float4(YUV_to_RGB(yuva.xyz), yuva.a);
  522. return rgba;
  523. }
  524. float3 PSNV12_Reverse(VertTexPos frag_in) : TARGET
  525. {
  526. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  527. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  528. float3 yuv = float3(y, cbcr);
  529. float3 rgb = YUV_to_RGB(yuv);
  530. return rgb;
  531. }
  532. float4 PSI010_SRGB_Reverse(VertTexPos frag_in) : TARGET
  533. {
  534. float ratio = 65535. / 1023.;
  535. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  536. int3 xy0_chroma = int3(frag_in.uv, 0);
  537. float cb = image1.Load(xy0_chroma).x * ratio;
  538. float cr = image2.Load(xy0_chroma).x * ratio;
  539. float3 yuv = float3(y, cb, cr);
  540. float3 rgb = YUV_to_RGB(yuv);
  541. rgb = srgb_nonlinear_to_linear(rgb);
  542. return float4(rgb, 1.);
  543. }
  544. float4 PSI010_PQ_2020_709_Reverse(VertTexPos frag_in) : TARGET
  545. {
  546. float ratio = 65535. / 1023.;
  547. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  548. int3 xy0_chroma = int3(frag_in.uv, 0);
  549. float cb = image1.Load(xy0_chroma).x * ratio;
  550. float cr = image2.Load(xy0_chroma).x * ratio;
  551. float3 yuv = float3(y, cb, cr);
  552. float3 pq = YUV_to_RGB(yuv);
  553. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  554. float3 rgb = rec2020_to_rec709(hdr2020);
  555. return float4(rgb, 1.);
  556. }
  557. float4 PSI010_HLG_2020_709_Reverse(VertTexPos frag_in) : TARGET
  558. {
  559. float ratio = 65535. / 1023.;
  560. float y = image.Load(int3(frag_in.pos.xy, 0)).x * ratio;
  561. int3 xy0_chroma = int3(frag_in.uv, 0);
  562. float cb = image1.Load(xy0_chroma).x * ratio;
  563. float cr = image2.Load(xy0_chroma).x * ratio;
  564. float3 yuv = float3(y, cb, cr);
  565. float3 hlg = YUV_to_RGB(yuv);
  566. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  567. float3 rgb = rec2020_to_rec709(hdr2020);
  568. return float4(rgb, 1.);
  569. }
  570. float4 PSP010_SRGB_Reverse(VertTexPos frag_in) : TARGET
  571. {
  572. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  573. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  574. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  575. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  576. float3 yuv = yuv_1023 / 1023.;
  577. float3 rgb = YUV_to_RGB(yuv);
  578. rgb = srgb_nonlinear_to_linear(rgb);
  579. return float4(rgb, 1.);
  580. }
  581. float4 PSP010_PQ_2020_709_Reverse(VertTexPos frag_in) : TARGET
  582. {
  583. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  584. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  585. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  586. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  587. float3 yuv = yuv_1023 / 1023.;
  588. float3 pq = YUV_to_RGB(yuv);
  589. float3 hdr2020 = st2084_to_linear_eetf(pq, hdr_lw, hdr_lmax) * maximum_over_sdr_white_nits;
  590. float3 rgb = rec2020_to_rec709(hdr2020);
  591. return float4(rgb, 1.);
  592. }
  593. float4 PSP010_HLG_2020_709_Reverse(VertTexPos frag_in) : TARGET
  594. {
  595. float y = image.Load(int3(frag_in.pos.xy, 0)).x;
  596. float2 cbcr = image1.Load(int3(frag_in.uv, 0)).xy;
  597. float3 yuv_65535 = floor(float3(y, cbcr) * 65535. + 0.5);
  598. float3 yuv_1023 = floor(yuv_65535 * 0.015625);
  599. float3 yuv = yuv_1023 / 1023.;
  600. float3 hlg = YUV_to_RGB(yuv);
  601. float3 hdr2020 = hlg_to_linear(hlg, hlg_exponent) * maximum_over_sdr_white_nits;
  602. float3 rgb = rec2020_to_rec709(hdr2020);
  603. return float4(rgb, 1.);
  604. }
  605. float3 PSY800_Limited(FragPos frag_in) : TARGET
  606. {
  607. float limited = image.Load(int3(frag_in.pos.xy, 0)).x;
  608. float full = (255.0 / 219.0) * limited - (16.0 / 219.0);
  609. return float3(full, full, full);
  610. }
  611. float3 PSY800_Full(FragPos frag_in) : TARGET
  612. {
  613. float3 full = image.Load(int3(frag_in.pos.xy, 0)).xxx;
  614. return full;
  615. }
  616. float4 PSRGB_Limited(FragPos frag_in) : TARGET
  617. {
  618. float4 rgba = image.Load(int3(frag_in.pos.xy, 0));
  619. rgba.rgb = (255.0 / 219.0) * rgba.rgb - (16.0 / 219.0);
  620. return rgba;
  621. }
  622. float3 PSBGR3_Limited(FragPos frag_in) : TARGET
  623. {
  624. float x = frag_in.pos.x * 3.0;
  625. float y = frag_in.pos.y;
  626. float b = image.Load(int3(x - 1.0, y, 0)).x;
  627. float g = image.Load(int3(x, y, 0)).x;
  628. float r = image.Load(int3(x + 1.0, y, 0)).x;
  629. float3 rgb = float3(r, g, b);
  630. rgb = (255.0 / 219.0) * rgb - (16.0 / 219.0);
  631. return rgb;
  632. }
  633. float3 PSBGR3_Full(FragPos frag_in) : TARGET
  634. {
  635. float x = frag_in.pos.x * 3.0;
  636. float y = frag_in.pos.y;
  637. float b = image.Load(int3(x - 1.0, y, 0)).x;
  638. float g = image.Load(int3(x, y, 0)).x;
  639. float r = image.Load(int3(x + 1.0, y, 0)).x;
  640. float3 rgb = float3(r, g, b);
  641. return rgb;
  642. }
  643. technique Planar_Y
  644. {
  645. pass
  646. {
  647. vertex_shader = VSPos(id);
  648. pixel_shader = PS_Y(frag_in);
  649. }
  650. }
  651. technique Planar_U
  652. {
  653. pass
  654. {
  655. vertex_shader = VSPos(id);
  656. pixel_shader = PS_U(frag_in);
  657. }
  658. }
  659. technique Planar_V
  660. {
  661. pass
  662. {
  663. vertex_shader = VSPos(id);
  664. pixel_shader = PS_V(frag_in);
  665. }
  666. }
  667. technique Planar_U_Left
  668. {
  669. pass
  670. {
  671. vertex_shader = VSTexPos_Left(id);
  672. pixel_shader = PS_U_Wide(frag_in);
  673. }
  674. }
  675. technique Planar_V_Left
  676. {
  677. pass
  678. {
  679. vertex_shader = VSTexPos_Left(id);
  680. pixel_shader = PS_V_Wide(frag_in);
  681. }
  682. }
  683. technique NV12_Y
  684. {
  685. pass
  686. {
  687. vertex_shader = VSPos(id);
  688. pixel_shader = PS_Y(frag_in);
  689. }
  690. }
  691. technique NV12_UV
  692. {
  693. pass
  694. {
  695. vertex_shader = VSTexPos_Left(id);
  696. pixel_shader = PS_UV_Wide(frag_in);
  697. }
  698. }
  699. technique I010_PQ_Y
  700. {
  701. pass
  702. {
  703. vertex_shader = VSPos(id);
  704. pixel_shader = PS_I010_PQ_Y_709_2020(frag_in);
  705. }
  706. }
  707. technique I010_HLG_Y
  708. {
  709. pass
  710. {
  711. vertex_shader = VSPos(id);
  712. pixel_shader = PS_I010_HLG_Y_709_2020(frag_in);
  713. }
  714. }
  715. technique I010_SRGB_Y
  716. {
  717. pass
  718. {
  719. vertex_shader = VSPos(id);
  720. pixel_shader = PS_I010_SRGB_Y(frag_in);
  721. }
  722. }
  723. technique I010_PQ_U
  724. {
  725. pass
  726. {
  727. vertex_shader = VSTexPos_TopLeft(id);
  728. pixel_shader = PS_I010_PQ_U_709_2020_WideWide(frag_in);
  729. }
  730. }
  731. technique I010_HLG_U
  732. {
  733. pass
  734. {
  735. vertex_shader = VSTexPos_TopLeft(id);
  736. pixel_shader = PS_I010_HLG_U_709_2020_WideWide(frag_in);
  737. }
  738. }
  739. technique I010_SRGB_U
  740. {
  741. pass
  742. {
  743. vertex_shader = VSTexPos_TopLeft(id);
  744. pixel_shader = PS_I010_SRGB_U_WideWide(frag_in);
  745. }
  746. }
  747. technique I010_PQ_V
  748. {
  749. pass
  750. {
  751. vertex_shader = VSTexPos_TopLeft(id);
  752. pixel_shader = PS_I010_PQ_V_709_2020_WideWide(frag_in);
  753. }
  754. }
  755. technique I010_HLG_V
  756. {
  757. pass
  758. {
  759. vertex_shader = VSTexPos_TopLeft(id);
  760. pixel_shader = PS_I010_HLG_V_709_2020_WideWide(frag_in);
  761. }
  762. }
  763. technique I010_SRGB_V
  764. {
  765. pass
  766. {
  767. vertex_shader = VSTexPos_TopLeft(id);
  768. pixel_shader = PS_I010_SRGB_V_WideWide(frag_in);
  769. }
  770. }
  771. technique P010_PQ_Y
  772. {
  773. pass
  774. {
  775. vertex_shader = VSPos(id);
  776. pixel_shader = PS_P010_PQ_Y_709_2020(frag_in);
  777. }
  778. }
  779. technique P010_HLG_Y
  780. {
  781. pass
  782. {
  783. vertex_shader = VSPos(id);
  784. pixel_shader = PS_P010_HLG_Y_709_2020(frag_in);
  785. }
  786. }
  787. technique P010_SRGB_Y
  788. {
  789. pass
  790. {
  791. vertex_shader = VSPos(id);
  792. pixel_shader = PS_P010_SRGB_Y(frag_in);
  793. }
  794. }
  795. technique P010_PQ_UV
  796. {
  797. pass
  798. {
  799. vertex_shader = VSTexPos_TopLeft(id);
  800. pixel_shader = PS_P010_PQ_UV_709_2020_WideWide(frag_in);
  801. }
  802. }
  803. technique P010_HLG_UV
  804. {
  805. pass
  806. {
  807. vertex_shader = VSTexPos_TopLeft(id);
  808. pixel_shader = PS_P010_HLG_UV_709_2020_WideWide(frag_in);
  809. }
  810. }
  811. technique P010_SRGB_UV
  812. {
  813. pass
  814. {
  815. vertex_shader = VSTexPos_TopLeft(id);
  816. pixel_shader = PS_P010_SRGB_UV_WideWide(frag_in);
  817. }
  818. }
  819. technique UYVY_Reverse
  820. {
  821. pass
  822. {
  823. vertex_shader = VSTexPosHalf_Reverse(id);
  824. pixel_shader = PSUYVY_Reverse(frag_in);
  825. }
  826. }
  827. technique YUY2_Reverse
  828. {
  829. pass
  830. {
  831. vertex_shader = VSTexPosHalf_Reverse(id);
  832. pixel_shader = PSYUY2_Reverse(frag_in);
  833. }
  834. }
  835. technique YVYU_Reverse
  836. {
  837. pass
  838. {
  839. vertex_shader = VSTexPosHalf_Reverse(id);
  840. pixel_shader = PSYVYU_Reverse(frag_in);
  841. }
  842. }
  843. technique I420_Reverse
  844. {
  845. pass
  846. {
  847. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  848. pixel_shader = PSPlanar420_Reverse(frag_in);
  849. }
  850. }
  851. technique I420_PQ_Reverse
  852. {
  853. pass
  854. {
  855. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  856. pixel_shader = PSPlanar420_PQ_Reverse(frag_in);
  857. }
  858. }
  859. technique I40A_Reverse
  860. {
  861. pass
  862. {
  863. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  864. pixel_shader = PSPlanar420A_Reverse(frag_in);
  865. }
  866. }
  867. technique I422_Reverse
  868. {
  869. pass
  870. {
  871. vertex_shader = VSPosWide_Reverse(id);
  872. pixel_shader = PSPlanar422_Reverse(frag_in);
  873. }
  874. }
  875. technique I210_Reverse
  876. {
  877. pass
  878. {
  879. vertex_shader = VSPosWide_Reverse(id);
  880. pixel_shader = PSPlanar422_10LE_Reverse(frag_in);
  881. }
  882. }
  883. technique I42A_Reverse
  884. {
  885. pass
  886. {
  887. vertex_shader = VSPosWide_Reverse(id);
  888. pixel_shader = PSPlanar422A_Reverse(frag_in);
  889. }
  890. }
  891. technique I444_Reverse
  892. {
  893. pass
  894. {
  895. vertex_shader = VSPos(id);
  896. pixel_shader = PSPlanar444_Reverse(frag_in);
  897. }
  898. }
  899. technique I412_Reverse
  900. {
  901. pass
  902. {
  903. vertex_shader = VSPos(id);
  904. pixel_shader = PSPlanar444_12LE_Reverse(frag_in);
  905. }
  906. }
  907. technique YUVA_Reverse
  908. {
  909. pass
  910. {
  911. vertex_shader = VSPos(id);
  912. pixel_shader = PSPlanar444A_Reverse(frag_in);
  913. }
  914. }
  915. technique YA2L_Reverse
  916. {
  917. pass
  918. {
  919. vertex_shader = VSPos(id);
  920. pixel_shader = PSPlanar444A_12LE_Reverse(frag_in);
  921. }
  922. }
  923. technique AYUV_Reverse
  924. {
  925. pass
  926. {
  927. vertex_shader = VSPos(id);
  928. pixel_shader = PSAYUV_Reverse(frag_in);
  929. }
  930. }
  931. technique NV12_Reverse
  932. {
  933. pass
  934. {
  935. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  936. pixel_shader = PSNV12_Reverse(frag_in);
  937. }
  938. }
  939. technique I010_SRGB_Reverse
  940. {
  941. pass
  942. {
  943. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  944. pixel_shader = PSI010_SRGB_Reverse(frag_in);
  945. }
  946. }
  947. technique I010_PQ_2020_709_Reverse
  948. {
  949. pass
  950. {
  951. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  952. pixel_shader = PSI010_PQ_2020_709_Reverse(frag_in);
  953. }
  954. }
  955. technique I010_HLG_2020_709_Reverse
  956. {
  957. pass
  958. {
  959. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  960. pixel_shader = PSI010_HLG_2020_709_Reverse(frag_in);
  961. }
  962. }
  963. technique P010_SRGB_Reverse
  964. {
  965. pass
  966. {
  967. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  968. pixel_shader = PSP010_SRGB_Reverse(frag_in);
  969. }
  970. }
  971. technique P010_PQ_2020_709_Reverse
  972. {
  973. pass
  974. {
  975. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  976. pixel_shader = PSP010_PQ_2020_709_Reverse(frag_in);
  977. }
  978. }
  979. technique P010_HLG_2020_709_Reverse
  980. {
  981. pass
  982. {
  983. vertex_shader = VSTexPosHalfHalf_Reverse(id);
  984. pixel_shader = PSP010_HLG_2020_709_Reverse(frag_in);
  985. }
  986. }
  987. technique Y800_Limited
  988. {
  989. pass
  990. {
  991. vertex_shader = VSPos(id);
  992. pixel_shader = PSY800_Limited(frag_in);
  993. }
  994. }
  995. technique Y800_Full
  996. {
  997. pass
  998. {
  999. vertex_shader = VSPos(id);
  1000. pixel_shader = PSY800_Full(frag_in);
  1001. }
  1002. }
  1003. technique RGB_Limited
  1004. {
  1005. pass
  1006. {
  1007. vertex_shader = VSPos(id);
  1008. pixel_shader = PSRGB_Limited(frag_in);
  1009. }
  1010. }
  1011. technique BGR3_Limited
  1012. {
  1013. pass
  1014. {
  1015. vertex_shader = VSPos(id);
  1016. pixel_shader = PSBGR3_Limited(frag_in);
  1017. }
  1018. }
  1019. technique BGR3_Full
  1020. {
  1021. pass
  1022. {
  1023. vertex_shader = VSPos(id);
  1024. pixel_shader = PSBGR3_Full(frag_in);
  1025. }
  1026. }