Guest User

Untitled

a guest
Mar 19th, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 31.68 KB | None | 0 0
  1. Last login: Sun Mar 19 08:08:08 on ttys000
  2.  
  3. The default interactive shell is now zsh.
  4. To update your account to use zsh, please run `chsh -s /bin/zsh`.
  5. For more details, please visit https://support.apple.com/kb/HT208050.
  6. Daniels-MacBook-Pro:~ daniel$ /Applications/Hugin/tools_mac/nona -o test --gpu --debug test.pto
  7. nona: using graphics card: Apple Apple M1 Pro
  8. destStart=[0, 0]
  9. destEnd=[4000, 3000]
  10. destSize=[(4000, 3000)]
  11. srcSize=[(4000, 3000)]
  12. srcBuffer=0x7fee6ca00000
  13. srcAlphaBuffer=0x0
  14. destBuffer=0x7fee78000000
  15. destAlphaBuffer=0x7fee6ec5c000
  16. destGLInternalFormat=GL_RGBA8
  17. destGLFormat=GL_RGB
  18. destGLType=GL_UNSIGNED_BYTE
  19. srcGLInternalFormat=GL_RGBA8
  20. srcGLFormat=GL_RGB
  21. srcGLType=GL_UNSIGNED_BYTE
  22. srcAlphaGLType=GL_BYTE
  23. destAlphaGLType=GL_UNSIGNED_BYTE
  24.  
  25. warparound=0
  26. needsAtanWorkaround=0
  27. Retrieving GL_MAX_RECTANGLE_TEXTURE_SIZE: 16384
  28. Testing texture size 16384, result=16384
  29. maxTextureSize=16384
  30. Source chunks:
  31. [(0, 0) to (4000, 3000) = (4000x3000)]
  32. Dest chunks:
  33. [(0, 0) to (2000, 3000) = (2000x3000)]
  34. [(2000, 0) to (4000, 3000) = (2000x3000)]
  35. Total GPU memory used: 348000000
  36. Interpolator chunks:
  37. [(0, 0) to (4, 4) = (4x4)]
  38. #version 110
  39. #extension GL_ARB_texture_rectangle : enable
  40. uniform sampler2DRect SrcTexture;
  41. float sinh(in float x) { return (exp(x) - exp(-x)) / 2.0; }
  42. float cosh(in float x) { return (exp(x) + exp(-x)) / 2.0; }
  43. float atan2_xge0(const in float y, const in float x) {
  44. return atan(y, x);
  45. }
  46. float atan2_safe(const in float y, const in float x) {
  47. return atan(y, x);
  48. }
  49. float atan_safe(const in float yx) {
  50. return atan(yx);
  51. }
  52. void main(void)
  53. {
  54. float discardA = 1.0;
  55. float discardB = 0.0;
  56. vec2 src = gl_TexCoord[0].st;
  57. src -= vec2(2000.0000000000000000, 1500.0000000000000000);
  58.  
  59. // erect_rect(2773.5019927698886022)
  60. src.t = 2773.5019927698886022 * atan2_xge0(src.t, length(vec2(2773.5019927698886022, src.s)));
  61. src.s = 2773.5019927698886022 * atan2_safe(src.s, 2773.5019927698886022);
  62.  
  63. // rotate_erect(8713.2134852025337750, -0.0000000000000000000)
  64. {
  65. //src.s += -0.0000000000000000000;
  66. float w = (abs(src.s) > 8713.2134852025337750) ? 1.0 : 0.0;
  67. float n = (src.s < 0.0) ? 0.5 : -0.5;
  68. src.s += w * -17426.426970405067550 * ceil(src.s / 17426.426970405067550 + n);
  69. }
  70.  
  71. // sphere_tp_erect(2773.5019927698886022)
  72. {
  73. float phi = src.s / 2773.5019927698886022;
  74. float theta = -src.t / 2773.5019927698886022 + 1.5707963267948965580;
  75. if (theta < 0.0) {
  76. theta = -theta;
  77. phi += 3.1415926535897931160;
  78. }
  79. if (theta > 3.1415926535897931160) {
  80. theta = 3.1415926535897931160 - (theta - 3.1415926535897931160);
  81. phi += 3.1415926535897931160;
  82. }
  83. float s = sin(theta);
  84. vec2 v = vec2(s * sin(phi), cos(theta));
  85. float r = length(v);
  86. theta = 2773.5019927698886022 * atan2_safe(r, s * cos(phi));
  87. src = v * (theta / r);
  88. }
  89.  
  90. // persp_sphere(2773.5019927698886022)
  91. {
  92. mat3 m = mat3(1.0000000000000000000, 0.0000000000000000000, 0.0000000000000000000,
  93. 0.0000000000000000000, 1.0000000000000000000, 0.0000000000000000000,
  94. 0.0000000000000000000, 0.0000000000000000000, 1.0000000000000000000);
  95. float r = length(src);
  96. float theta = r / 2773.5019927698886022;
  97. float s = 0.0;
  98. if (r != 0.0) s = sin(theta) / r;
  99. vec3 v = vec3(s * src.s, s * src.t, cos(theta));
  100. vec3 u = v * m;
  101. r = length(u.st);
  102. theta = 0.0;
  103. if (r != 0.0) theta = 2773.5019927698886022 * atan2_safe(r, u.p) / r;
  104. src = theta * u.st;
  105. }
  106.  
  107. // rect_sphere_tp(2773.5019927698886022)
  108. {
  109. float r = length(src);
  110. float theta = r / 2773.5019927698886022;
  111. float rho = 0.0;
  112. if (theta >= 1.5707963267948965580) rho = 1.6e16;
  113. else if (theta == 0.0) rho = 1.0;
  114. else rho = tan(theta) / theta;
  115. src *= rho;
  116. }
  117.  
  118. // resize(0.99999965937272483618, 0.99999965937272483618)
  119. src *= vec2(0.99999965937272483618, 0.99999965937272483618);
  120.  
  121. src += vec2(1999.5000000000000000, 1499.5000000000000000);
  122.  
  123. src = src * discardA + vec2(-1000.0, -1000.0) * discardB;
  124. gl_FragColor = vec4(src.s, 0.0, 0.0, src.t);
  125. }
  126. #version 110
  127. #extension GL_ARB_texture_rectangle : enable
  128. uniform sampler2DRect CoordTexture;
  129. uniform sampler2DRect SrcTexture;
  130. uniform sampler2DRect AccumTexture;
  131. uniform vec2 SrcUL;
  132. uniform vec2 SrcLR;
  133. uniform vec2 KernelUL;
  134. uniform vec2 KernelWH;
  135. float w(const in float i, const in float f) {
  136. float A = -0.75000000000000000000;
  137. float c = abs(i - 1.0);
  138. float m = (i > 1.0) ? -1.0 : 1.0;
  139. float p = c + m * f;
  140. if (i == 1.0 || i == 2.0) {
  141. return (( A + 2.0 )*p - ( A + 3.0 ))*p*p + 1.0;
  142. } else {
  143. return (( A * p - 5.0 * A ) * p + 8.0 * A ) * p - 4.0 * A;
  144. }
  145. }
  146. void main(void)
  147. {
  148. vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
  149. vec4 accum = texture2DRect(AccumTexture, gl_TexCoord[0].st);
  150.  
  151. src -= SrcUL;
  152. vec2 t = floor(src) + -0.50000000000000000000;
  153. vec2 f = fract(src);
  154. vec2 k = vec2(0.0, 0.0);
  155.  
  156. for (float ky = 0.0; ky < 4.0000000000000000000; ky += 1.0) {
  157. k.t = ky + KernelUL.t;
  158. float wy = w(k.t, f.t);
  159. for (float kx = 0.0; kx < 4.0000000000000000000; kx += 1.0) {
  160. k.s = kx + KernelUL.s;
  161. float wx = w(k.s, f.s);
  162. vec2 ix = t + k;
  163. vec4 sp = texture2DRect(SrcTexture, ix);
  164. float weight = wx * wy * sp.a;
  165. accum += sp * weight;
  166. }
  167. }
  168.  
  169. gl_FragColor = accum;
  170. }
  171.  
  172. #version 120
  173. #extension GL_ARB_texture_rectangle : enable
  174. uniform sampler2DRect NormTexture;
  175. uniform sampler2DRect CoordTexture;
  176. uniform sampler2DRect InvLutTexture;
  177. uniform sampler2DRect DestLutTexture;
  178. void main(void)
  179. {
  180. // Normalization
  181. vec4 n = texture2DRect(NormTexture, gl_TexCoord[0].st);
  182. vec4 p = vec4(0.0, 0.0, 0.0, 0.0);
  183. if (n.a >= 0.2) p = n / n.a;
  184.  
  185. // Photometric
  186. // invLutSize = 256.00000000000000000
  187. // pixelMax = 255.00000000000000000
  188. // destLutSize = 1024.0000000000000000
  189. // destExposure = 0.00019929594818414287749
  190. // srcExposure = 0.00019929847914560141152
  191. // whiteBalanceRed = 1.0000000000000000000
  192. // whiteBalanceBlue = 1.0000000000000000000
  193. p.rgb = p.rgb * 255.00000000000000000;
  194. vec2 invR = texture2DRect(InvLutTexture, vec2(p.r, 0.0)).sq;
  195. vec2 invG = texture2DRect(InvLutTexture, vec2(p.g, 0.0)).sq;
  196. vec2 invB = texture2DRect(InvLutTexture, vec2(p.b, 0.0)).sq;
  197. vec3 invX = vec3(invR.x, invG.x, invB.x);
  198. vec3 invY = vec3(invR.y, invG.y, invB.y);
  199. vec3 invA = fract(p.rgb);
  200. p.rgb = mix(invX, invY, invA);
  201. // VigCorrMode=VIGCORR_RADIAL
  202. float vig = 1.0;
  203. {
  204. vec2 vigCorrCenter = vec2(1999.5000000000000000, 1499.5000000000000000);
  205. float radiusScale=0.00040000000000000001917;
  206. float radialVigCorrCoeff0 = 1.0000000000000000000;
  207. float radialVigCorrCoeff1 = 0.0000000000000000000;
  208. float radialVigCorrCoeff2 = 0.0000000000000000000;
  209. float radialVigCorrCoeff3 = 0.0000000000000000000;
  210. vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
  211. vec2 d = src - vigCorrCenter;
  212. d *= radiusScale;
  213. vig = radialVigCorrCoeff0;
  214. float r2 = dot(d, d);
  215. float r = r2;
  216. vig += radialVigCorrCoeff1 * r;
  217. r *= r2;
  218. vig += radialVigCorrCoeff2 * r;
  219. r *= r2;
  220. vig += radialVigCorrCoeff3 * r;
  221. }
  222. vec3 exposure_whitebalance = vec3(0.99998730064840746223, 0.99998730064840746223, 0.99998730064840746223);
  223. p.rgb = (p.rgb * exposure_whitebalance) / vig;
  224. p.rgb = p.rgb * 1023.0000000000000000;
  225. vec2 destR = texture2DRect(DestLutTexture, vec2(p.r, 0.0)).sq;
  226. vec2 destG = texture2DRect(DestLutTexture, vec2(p.g, 0.0)).sq;
  227. vec2 destB = texture2DRect(DestLutTexture, vec2(p.b, 0.0)).sq;
  228. vec3 destX = vec3(destR.x, destG.x, destB.x);
  229. vec3 destY = vec3(destR.y, destG.y, destB.y);
  230. vec3 destA = fract(p.rgb);
  231. p.rgb = mix(destX, destY, destA);
  232.  
  233. gl_FragColor = p;
  234. }
  235.  
  236. gpu shader program compile time = 0.014
  237. gpu shader texture/framebuffer setup time = 0.001
  238. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] coord image render time = 0.008
  239. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] src upload = 0.038
  240. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] src render = 0.003
  241. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.006
  242. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.009
  243. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] normalization setup = 0
  244. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] normalization render = 0.002
  245. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest rgb disassembly setup = 0
  246. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest rgb disassembly render = 0.002
  247. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] rgb readback = 0.004
  248. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest alpha disassembly setup = 0
  249. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest alpha disassembly render = 0.002
  250. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] alpha readback = 0.001
  251. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] coord image render time = 0.002
  252. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.001
  253. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.002
  254. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] normalization setup = 0
  255. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] normalization render = 0.001
  256. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest rgb disassembly setup = 0
  257. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest rgb disassembly render = 0.001
  258. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] rgb readback = 0.013
  259. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest alpha disassembly setup = 0
  260. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest alpha disassembly render = 0.002
  261. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] alpha readback = 0.002
  262. gpu destruct time = 0.005
  263. gpu total time = 0.119
  264. destStart=[0, 0]
  265. destEnd=[4000, 3000]
  266. destSize=[(4000, 3000)]
  267. srcSize=[(4000, 3000)]
  268. srcBuffer=0x7fee78000000
  269. srcAlphaBuffer=0x0
  270. destBuffer=0x7fee6ca00000
  271. destAlphaBuffer=0x7fee6ec5c000
  272. destGLInternalFormat=GL_RGBA8
  273. destGLFormat=GL_RGB
  274. destGLType=GL_UNSIGNED_BYTE
  275. srcGLInternalFormat=GL_RGBA8
  276. srcGLFormat=GL_RGB
  277. srcGLType=GL_UNSIGNED_BYTE
  278. srcAlphaGLType=GL_BYTE
  279. destAlphaGLType=GL_UNSIGNED_BYTE
  280.  
  281. warparound=0
  282. needsAtanWorkaround=0
  283. Retrieving GL_MAX_RECTANGLE_TEXTURE_SIZE: 16384
  284. Testing texture size 16384, result=16384
  285. maxTextureSize=16384
  286. Source chunks:
  287. [(0, 0) to (4000, 3000) = (4000x3000)]
  288. Dest chunks:
  289. [(0, 0) to (2000, 3000) = (2000x3000)]
  290. [(2000, 0) to (4000, 3000) = (2000x3000)]
  291. Total GPU memory used: 348000000
  292. Interpolator chunks:
  293. [(0, 0) to (4, 4) = (4x4)]
  294. #version 110
  295. #extension GL_ARB_texture_rectangle : enable
  296. uniform sampler2DRect SrcTexture;
  297. float sinh(in float x) { return (exp(x) - exp(-x)) / 2.0; }
  298. float cosh(in float x) { return (exp(x) + exp(-x)) / 2.0; }
  299. float atan2_xge0(const in float y, const in float x) {
  300. return atan(y, x);
  301. }
  302. float atan2_safe(const in float y, const in float x) {
  303. return atan(y, x);
  304. }
  305. float atan_safe(const in float yx) {
  306. return atan(yx);
  307. }
  308. void main(void)
  309. {
  310. float discardA = 1.0;
  311. float discardB = 0.0;
  312. vec2 src = gl_TexCoord[0].st;
  313. src -= vec2(2000.0000000000000000, 1500.0000000000000000);
  314.  
  315. // erect_rect(2773.5019927698886022)
  316. src.t = 2773.5019927698886022 * atan2_xge0(src.t, length(vec2(2773.5019927698886022, src.s)));
  317. src.s = 2773.5019927698886022 * atan2_safe(src.s, 2773.5019927698886022);
  318.  
  319. // rotate_erect(8713.2134852025337750, 0.67852758872614160612)
  320. {
  321. src.s += 0.67852758872614160612;
  322. float w = (abs(src.s) > 8713.2134852025337750) ? 1.0 : 0.0;
  323. float n = (src.s < 0.0) ? 0.5 : -0.5;
  324. src.s += w * -17426.426970405067550 * ceil(src.s / 17426.426970405067550 + n);
  325. }
  326.  
  327. // sphere_tp_erect(2773.5019927698886022)
  328. {
  329. float phi = src.s / 2773.5019927698886022;
  330. float theta = -src.t / 2773.5019927698886022 + 1.5707963267948965580;
  331. if (theta < 0.0) {
  332. theta = -theta;
  333. phi += 3.1415926535897931160;
  334. }
  335. if (theta > 3.1415926535897931160) {
  336. theta = 3.1415926535897931160 - (theta - 3.1415926535897931160);
  337. phi += 3.1415926535897931160;
  338. }
  339. float s = sin(theta);
  340. vec2 v = vec2(s * sin(phi), cos(theta));
  341. float r = length(v);
  342. theta = 2773.5019927698886022 * atan2_safe(r, s * cos(phi));
  343. src = v * (theta / r);
  344. }
  345.  
  346. // persp_sphere(2773.5019927698886022)
  347. {
  348. mat3 m = mat3(0.99999999761966595901, 6.8997594513900772722e-05, 1.0996696250148663720e-09,
  349. -6.8997594522663918096e-05, 0.99999999749265933158, 1.5937796527617674111e-05,
  350. 0.0000000000000000000, -1.5937796565554955059e-05, 0.99999999987299337256);
  351. float r = length(src);
  352. float theta = r / 2773.5019927698886022;
  353. float s = 0.0;
  354. if (r != 0.0) s = sin(theta) / r;
  355. vec3 v = vec3(s * src.s, s * src.t, cos(theta));
  356. vec3 u = v * m;
  357. r = length(u.st);
  358. theta = 0.0;
  359. if (r != 0.0) theta = 2773.5019927698886022 * atan2_safe(r, u.p) / r;
  360. src = theta * u.st;
  361. }
  362.  
  363. // rect_sphere_tp(2773.5019927698886022)
  364. {
  365. float r = length(src);
  366. float theta = r / 2773.5019927698886022;
  367. float rho = 0.0;
  368. if (theta >= 1.5707963267948965580) rho = 1.6e16;
  369. else if (theta == 0.0) rho = 1.0;
  370. else rho = tan(theta) / theta;
  371. src *= rho;
  372. }
  373.  
  374. // resize(0.99999965937272483618, 0.99999965937272483618)
  375. src *= vec2(0.99999965937272483618, 0.99999965937272483618);
  376.  
  377. src += vec2(1999.5000000000000000, 1499.5000000000000000);
  378.  
  379. src = src * discardA + vec2(-1000.0, -1000.0) * discardB;
  380. gl_FragColor = vec4(src.s, 0.0, 0.0, src.t);
  381. }
  382. #version 110
  383. #extension GL_ARB_texture_rectangle : enable
  384. uniform sampler2DRect CoordTexture;
  385. uniform sampler2DRect SrcTexture;
  386. uniform sampler2DRect AccumTexture;
  387. uniform vec2 SrcUL;
  388. uniform vec2 SrcLR;
  389. uniform vec2 KernelUL;
  390. uniform vec2 KernelWH;
  391. float w(const in float i, const in float f) {
  392. float A = -0.75000000000000000000;
  393. float c = abs(i - 1.0);
  394. float m = (i > 1.0) ? -1.0 : 1.0;
  395. float p = c + m * f;
  396. if (i == 1.0 || i == 2.0) {
  397. return (( A + 2.0 )*p - ( A + 3.0 ))*p*p + 1.0;
  398. } else {
  399. return (( A * p - 5.0 * A ) * p + 8.0 * A ) * p - 4.0 * A;
  400. }
  401. }
  402. void main(void)
  403. {
  404. vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
  405. vec4 accum = texture2DRect(AccumTexture, gl_TexCoord[0].st);
  406.  
  407. src -= SrcUL;
  408. vec2 t = floor(src) + -0.50000000000000000000;
  409. vec2 f = fract(src);
  410. vec2 k = vec2(0.0, 0.0);
  411.  
  412. for (float ky = 0.0; ky < 4.0000000000000000000; ky += 1.0) {
  413. k.t = ky + KernelUL.t;
  414. float wy = w(k.t, f.t);
  415. for (float kx = 0.0; kx < 4.0000000000000000000; kx += 1.0) {
  416. k.s = kx + KernelUL.s;
  417. float wx = w(k.s, f.s);
  418. vec2 ix = t + k;
  419. vec4 sp = texture2DRect(SrcTexture, ix);
  420. float weight = wx * wy * sp.a;
  421. accum += sp * weight;
  422. }
  423. }
  424.  
  425. gl_FragColor = accum;
  426. }
  427.  
  428. #version 120
  429. #extension GL_ARB_texture_rectangle : enable
  430. uniform sampler2DRect NormTexture;
  431. uniform sampler2DRect CoordTexture;
  432. uniform sampler2DRect InvLutTexture;
  433. uniform sampler2DRect DestLutTexture;
  434. void main(void)
  435. {
  436. // Normalization
  437. vec4 n = texture2DRect(NormTexture, gl_TexCoord[0].st);
  438. vec4 p = vec4(0.0, 0.0, 0.0, 0.0);
  439. if (n.a >= 0.2) p = n / n.a;
  440.  
  441. // Photometric
  442. // invLutSize = 256.00000000000000000
  443. // pixelMax = 255.00000000000000000
  444. // destLutSize = 1024.0000000000000000
  445. // destExposure = 0.00019929594818414287749
  446. // srcExposure = 0.00012755103081087685235
  447. // whiteBalanceRed = 1.0000000000000000000
  448. // whiteBalanceBlue = 1.0000000000000000000
  449. p.rgb = p.rgb * 255.00000000000000000;
  450. vec2 invR = texture2DRect(InvLutTexture, vec2(p.r, 0.0)).sq;
  451. vec2 invG = texture2DRect(InvLutTexture, vec2(p.g, 0.0)).sq;
  452. vec2 invB = texture2DRect(InvLutTexture, vec2(p.b, 0.0)).sq;
  453. vec3 invX = vec3(invR.x, invG.x, invB.x);
  454. vec3 invY = vec3(invR.y, invG.y, invB.y);
  455. vec3 invA = fract(p.rgb);
  456. p.rgb = mix(invX, invY, invA);
  457. // VigCorrMode=VIGCORR_RADIAL
  458. float vig = 1.0;
  459. {
  460. vec2 vigCorrCenter = vec2(1999.5000000000000000, 1499.5000000000000000);
  461. float radiusScale=0.00040000000000000001917;
  462. float radialVigCorrCoeff0 = 1.0000000000000000000;
  463. float radialVigCorrCoeff1 = 0.0000000000000000000;
  464. float radialVigCorrCoeff2 = 0.0000000000000000000;
  465. float radialVigCorrCoeff3 = 0.0000000000000000000;
  466. vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
  467. vec2 d = src - vigCorrCenter;
  468. d *= radiusScale;
  469. vig = radialVigCorrCoeff0;
  470. float r2 = dot(d, d);
  471. float r = r2;
  472. vig += radialVigCorrCoeff1 * r;
  473. r *= r2;
  474. vig += radialVigCorrCoeff2 * r;
  475. r *= r2;
  476. vig += radialVigCorrCoeff3 * r;
  477. }
  478. vec3 exposure_whitebalance = vec3(1.5624801063320612471, 1.5624801063320612471, 1.5624801063320612471);
  479. p.rgb = (p.rgb * exposure_whitebalance) / vig;
  480. p.rgb = p.rgb * 1023.0000000000000000;
  481. vec2 destR = texture2DRect(DestLutTexture, vec2(p.r, 0.0)).sq;
  482. vec2 destG = texture2DRect(DestLutTexture, vec2(p.g, 0.0)).sq;
  483. vec2 destB = texture2DRect(DestLutTexture, vec2(p.b, 0.0)).sq;
  484. vec3 destX = vec3(destR.x, destG.x, destB.x);
  485. vec3 destY = vec3(destR.y, destG.y, destB.y);
  486. vec3 destA = fract(p.rgb);
  487. p.rgb = mix(destX, destY, destA);
  488.  
  489. gl_FragColor = p;
  490. }
  491.  
  492. gpu shader program compile time = 0.007
  493. gpu shader texture/framebuffer setup time = 0.001
  494. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] coord image render time = 0.008
  495. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] src upload = 0.025
  496. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] src render = 0.003
  497. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.006
  498. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.008
  499. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] normalization setup = 0
  500. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] normalization render = 0.002
  501. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest rgb disassembly setup = 0
  502. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest rgb disassembly render = 0.002
  503. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] rgb readback = 0.002
  504. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest alpha disassembly setup = 0
  505. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest alpha disassembly render = 0.002
  506. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] alpha readback = 0.002
  507. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] coord image render time = 0.002
  508. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.002
  509. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.004
  510. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] normalization setup = 0
  511. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] normalization render = 0.002
  512. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest rgb disassembly setup = 0
  513. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest rgb disassembly render = 0.001
  514. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] rgb readback = 0.005
  515. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest alpha disassembly setup = 0
  516. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest alpha disassembly render = 0.001
  517. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] alpha readback = 0.001
  518. gpu destruct time = 0.004
  519. gpu total time = 0.09
  520. destStart=[0, 0]
  521. destEnd=[4000, 3000]
  522. destSize=[(4000, 3000)]
  523. srcSize=[(4000, 3000)]
  524. srcBuffer=0x7fee6ca00000
  525. srcAlphaBuffer=0x0
  526. destBuffer=0x7fee78000000
  527. destAlphaBuffer=0x7fee6ec5c000
  528. destGLInternalFormat=GL_RGBA8
  529. destGLFormat=GL_RGB
  530. destGLType=GL_UNSIGNED_BYTE
  531. srcGLInternalFormat=GL_RGBA8
  532. srcGLFormat=GL_RGB
  533. srcGLType=GL_UNSIGNED_BYTE
  534. srcAlphaGLType=GL_BYTE
  535. destAlphaGLType=GL_UNSIGNED_BYTE
  536.  
  537. warparound=0
  538. needsAtanWorkaround=0
  539. Retrieving GL_MAX_RECTANGLE_TEXTURE_SIZE: 16384
  540. Testing texture size 16384, result=16384
  541. maxTextureSize=16384
  542. Source chunks:
  543. [(0, 0) to (4000, 3000) = (4000x3000)]
  544. Dest chunks:
  545. [(0, 0) to (2000, 3000) = (2000x3000)]
  546. [(2000, 0) to (4000, 3000) = (2000x3000)]
  547. Total GPU memory used: 348000000
  548. Interpolator chunks:
  549. [(0, 0) to (4, 4) = (4x4)]
  550. #version 110
  551. #extension GL_ARB_texture_rectangle : enable
  552. uniform sampler2DRect SrcTexture;
  553. float sinh(in float x) { return (exp(x) - exp(-x)) / 2.0; }
  554. float cosh(in float x) { return (exp(x) + exp(-x)) / 2.0; }
  555. float atan2_xge0(const in float y, const in float x) {
  556. return atan(y, x);
  557. }
  558. float atan2_safe(const in float y, const in float x) {
  559. return atan(y, x);
  560. }
  561. float atan_safe(const in float yx) {
  562. return atan(yx);
  563. }
  564. void main(void)
  565. {
  566. float discardA = 1.0;
  567. float discardB = 0.0;
  568. vec2 src = gl_TexCoord[0].st;
  569. src -= vec2(2000.0000000000000000, 1500.0000000000000000);
  570.  
  571. // erect_rect(2773.5019927698886022)
  572. src.t = 2773.5019927698886022 * atan2_xge0(src.t, length(vec2(2773.5019927698886022, src.s)));
  573. src.s = 2773.5019927698886022 * atan2_safe(src.s, 2773.5019927698886022);
  574.  
  575. // rotate_erect(8713.2134852025337750, 1.1905382881270456519)
  576. {
  577. src.s += 1.1905382881270456519;
  578. float w = (abs(src.s) > 8713.2134852025337750) ? 1.0 : 0.0;
  579. float n = (src.s < 0.0) ? 0.5 : -0.5;
  580. src.s += w * -17426.426970405067550 * ceil(src.s / 17426.426970405067550 + n);
  581. }
  582.  
  583. // sphere_tp_erect(2773.5019927698886022)
  584. {
  585. float phi = src.s / 2773.5019927698886022;
  586. float theta = -src.t / 2773.5019927698886022 + 1.5707963267948965580;
  587. if (theta < 0.0) {
  588. theta = -theta;
  589. phi += 3.1415926535897931160;
  590. }
  591. if (theta > 3.1415926535897931160) {
  592. theta = 3.1415926535897931160 - (theta - 3.1415926535897931160);
  593. phi += 3.1415926535897931160;
  594. }
  595. float s = sin(theta);
  596. vec2 v = vec2(s * sin(phi), cos(theta));
  597. float r = length(v);
  598. theta = 2773.5019927698886022 * atan2_safe(r, s * cos(phi));
  599. src = v * (theta / r);
  600. }
  601.  
  602. // persp_sphere(2773.5019927698886022)
  603. {
  604. mat3 m = mat3(0.99999998665116685004, 0.00016339420484989285501, 5.6918562158017812270e-09,
  605. -0.00016339420494903108194, 0.99999998604442419392, 3.4835116346982139155e-05,
  606. 0.0000000000000000000, -3.4835116811990298087e-05, 0.99999999939325734388);
  607. float r = length(src);
  608. float theta = r / 2773.5019927698886022;
  609. float s = 0.0;
  610. if (r != 0.0) s = sin(theta) / r;
  611. vec3 v = vec3(s * src.s, s * src.t, cos(theta));
  612. vec3 u = v * m;
  613. r = length(u.st);
  614. theta = 0.0;
  615. if (r != 0.0) theta = 2773.5019927698886022 * atan2_safe(r, u.p) / r;
  616. src = theta * u.st;
  617. }
  618.  
  619. // rect_sphere_tp(2773.5019927698886022)
  620. {
  621. float r = length(src);
  622. float theta = r / 2773.5019927698886022;
  623. float rho = 0.0;
  624. if (theta >= 1.5707963267948965580) rho = 1.6e16;
  625. else if (theta == 0.0) rho = 1.0;
  626. else rho = tan(theta) / theta;
  627. src *= rho;
  628. }
  629.  
  630. // resize(0.99999965937272483618, 0.99999965937272483618)
  631. src *= vec2(0.99999965937272483618, 0.99999965937272483618);
  632.  
  633. src += vec2(1999.5000000000000000, 1499.5000000000000000);
  634.  
  635. src = src * discardA + vec2(-1000.0, -1000.0) * discardB;
  636. gl_FragColor = vec4(src.s, 0.0, 0.0, src.t);
  637. }
  638. #version 110
  639. #extension GL_ARB_texture_rectangle : enable
  640. uniform sampler2DRect CoordTexture;
  641. uniform sampler2DRect SrcTexture;
  642. uniform sampler2DRect AccumTexture;
  643. uniform vec2 SrcUL;
  644. uniform vec2 SrcLR;
  645. uniform vec2 KernelUL;
  646. uniform vec2 KernelWH;
  647. float w(const in float i, const in float f) {
  648. float A = -0.75000000000000000000;
  649. float c = abs(i - 1.0);
  650. float m = (i > 1.0) ? -1.0 : 1.0;
  651. float p = c + m * f;
  652. if (i == 1.0 || i == 2.0) {
  653. return (( A + 2.0 )*p - ( A + 3.0 ))*p*p + 1.0;
  654. } else {
  655. return (( A * p - 5.0 * A ) * p + 8.0 * A ) * p - 4.0 * A;
  656. }
  657. }
  658. void main(void)
  659. {
  660. vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
  661. vec4 accum = texture2DRect(AccumTexture, gl_TexCoord[0].st);
  662.  
  663. src -= SrcUL;
  664. vec2 t = floor(src) + -0.50000000000000000000;
  665. vec2 f = fract(src);
  666. vec2 k = vec2(0.0, 0.0);
  667.  
  668. for (float ky = 0.0; ky < 4.0000000000000000000; ky += 1.0) {
  669. k.t = ky + KernelUL.t;
  670. float wy = w(k.t, f.t);
  671. for (float kx = 0.0; kx < 4.0000000000000000000; kx += 1.0) {
  672. k.s = kx + KernelUL.s;
  673. float wx = w(k.s, f.s);
  674. vec2 ix = t + k;
  675. vec4 sp = texture2DRect(SrcTexture, ix);
  676. float weight = wx * wy * sp.a;
  677. accum += sp * weight;
  678. }
  679. }
  680.  
  681. gl_FragColor = accum;
  682. }
  683.  
  684. #version 120
  685. #extension GL_ARB_texture_rectangle : enable
  686. uniform sampler2DRect NormTexture;
  687. uniform sampler2DRect CoordTexture;
  688. uniform sampler2DRect InvLutTexture;
  689. uniform sampler2DRect DestLutTexture;
  690. void main(void)
  691. {
  692. // Normalization
  693. vec4 n = texture2DRect(NormTexture, gl_TexCoord[0].st);
  694. vec4 p = vec4(0.0, 0.0, 0.0, 0.0);
  695. if (n.a >= 0.2) p = n / n.a;
  696.  
  697. // Photometric
  698. // invLutSize = 256.00000000000000000
  699. // pixelMax = 255.00000000000000000
  700. // destLutSize = 1024.0000000000000000
  701. // destExposure = 0.00019929594818414287749
  702. // srcExposure = 0.00031887755475383414107
  703. // whiteBalanceRed = 1.0000000000000000000
  704. // whiteBalanceBlue = 1.0000000000000000000
  705. p.rgb = p.rgb * 255.00000000000000000;
  706. vec2 invR = texture2DRect(InvLutTexture, vec2(p.r, 0.0)).sq;
  707. vec2 invG = texture2DRect(InvLutTexture, vec2(p.g, 0.0)).sq;
  708. vec2 invB = texture2DRect(InvLutTexture, vec2(p.b, 0.0)).sq;
  709. vec3 invX = vec3(invR.x, invG.x, invB.x);
  710. vec3 invY = vec3(invR.y, invG.y, invB.y);
  711. vec3 invA = fract(p.rgb);
  712. p.rgb = mix(invX, invY, invA);
  713. // VigCorrMode=VIGCORR_RADIAL
  714. float vig = 1.0;
  715. {
  716. vec2 vigCorrCenter = vec2(1999.5000000000000000, 1499.5000000000000000);
  717. float radiusScale=0.00040000000000000001917;
  718. float radialVigCorrCoeff0 = 1.0000000000000000000;
  719. float radialVigCorrCoeff1 = 0.0000000000000000000;
  720. float radialVigCorrCoeff2 = 0.0000000000000000000;
  721. float radialVigCorrCoeff3 = 0.0000000000000000000;
  722. vec2 src = texture2DRect(CoordTexture, gl_TexCoord[0].st).sq;
  723. vec2 d = src - vigCorrCenter;
  724. d *= radiusScale;
  725. vig = radialVigCorrCoeff0;
  726. float r2 = dot(d, d);
  727. float r = r2;
  728. vig += radialVigCorrCoeff1 * r;
  729. r *= r2;
  730. vig += radialVigCorrCoeff2 * r;
  731. r *= r2;
  732. vig += radialVigCorrCoeff3 * r;
  733. }
  734. vec3 exposure_whitebalance = vec3(0.62499208618804980020, 0.62499208618804980020, 0.62499208618804980020);
  735. p.rgb = (p.rgb * exposure_whitebalance) / vig;
  736. p.rgb = p.rgb * 1023.0000000000000000;
  737. vec2 destR = texture2DRect(DestLutTexture, vec2(p.r, 0.0)).sq;
  738. vec2 destG = texture2DRect(DestLutTexture, vec2(p.g, 0.0)).sq;
  739. vec2 destB = texture2DRect(DestLutTexture, vec2(p.b, 0.0)).sq;
  740. vec3 destX = vec3(destR.x, destG.x, destB.x);
  741. vec3 destY = vec3(destR.y, destG.y, destB.y);
  742. vec3 destA = fract(p.rgb);
  743. p.rgb = mix(destX, destY, destA);
  744.  
  745. gl_FragColor = p;
  746. }
  747.  
  748. gpu shader program compile time = 0.005
  749. gpu shader texture/framebuffer setup time = 0.001
  750. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] coord image render time = 0.008
  751. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] src upload = 0.024
  752. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] src render = 0.003
  753. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.006
  754. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.009
  755. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] normalization setup = 0
  756. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] normalization render = 0.002
  757. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest rgb disassembly setup = 0
  758. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest rgb disassembly render = 0.002
  759. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] rgb readback = 0.002
  760. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest alpha disassembly setup = 0
  761. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] dest alpha disassembly render = 0.002
  762. gpu dest chunk=[(0, 0) to (2000, 3000) = (2000x3000)] alpha readback = 0.002
  763. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] coord image render time = 0.002
  764. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] setup = 0.001
  765. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] source chunk=[(0, 0) to (4000, 3000) = (4000x3000)] interpolation chunk=[(0, 0) to (4, 4) = (4x4)] render = 0.003
  766. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] normalization setup = 0
  767. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] normalization render = 0.001
  768. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest rgb disassembly setup = 0
  769. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest rgb disassembly render = 0.001
  770. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] rgb readback = 0.003
  771. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest alpha disassembly setup = 0
  772. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] dest alpha disassembly render = 0.001
  773. gpu dest chunk=[(2000, 0) to (4000, 3000) = (2000x3000)] alpha readback = 0.002
  774. gpu destruct time = 0.002
  775. gpu total time = 0.082
  776. Daniels-MacBook-Pro:~ daniel$
  777.  
Advertisement
Add Comment
Please, Sign In to add comment